Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
Por gmarotti
#16784
Não estou consegindo finalizar minha planilha, montei a mesma com algumas abas ocultas, sendo ela email (onde o conteudo do email é formado), e principal onde faço os lancamentos e pego os dados.

o email da pessoa que deve receber esta em PRINCIPAL!H1
como coloco na formula abaixo?


Sub EMAIL()

Application.ScreenUpdating = False
Sheets("EMAIL").Visible = True
Sheets("EMAIL").Select
ActiveSheet.Range("A1:F17").Select

ActiveWorkbook.EnvelopeVisible = True

With ActiveSheet.MailEnvelope
.Introduction = ""
.Item.To = "????"
.Item.Subject = "T-Maki Restaurante - PEDIDO"
.Item.Send

Sheets("EMAIL").Select
Sheets("EMAIL").Visible = False
Application.ScreenUpdating = True
Sheets("PRINCIPAL").Select

End With

End Sub
Por daniexcel
Posts
#16914
segue uma macro que tenho para envio de email.. espero que possa te ajudar

Código: Selecionar todos
     Dim OL              As Object
     Dim EmailItem       As Object
     Dim Wb              As Workbook
      
     Application.ScreenUpdating = False
     Set OL = CreateObject("Outlook.Application")
     Set EmailItem = OL.CreateItem(olMailItem)
     Set Wb = ActiveWorkbook
     Wb.Save
     With EmailItem
         .Subject = "coloque aqui o assunto"
         .Body = "coloque aqui o texto"
         .To = email@email.com
         .Importance = olImportanceNormal
         'ou olImprotanceHigh Ou olImprotanceLow para definar o grau de importância
         .Attachments.Add Wb.FullName
         .Send
     End With
      
     Application.ScreenUpdating = True
      
      
      
     Set Wb = Nothing
     Set OL = Nothing
     Set EmailItem = Nothing
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord