Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Prezados o erro é o seguinte : Object doesn't support this property or method: 'vmail.Text'
a variavel vmail é uma concatenação de mails com ;
sub Acomp_mail_Bloco_Cirurgico
set vmail = ActiveDocument.Variables("vtestemail")
Set myApp = CreateObject ("Outlook.Application")
Set myMessage = myApp.CreateItem(olMailItem)
'newfile = "teste imagem"
'myMessage.body = ("teste imagem")
myMessage.HTMLBODY = "<img src='C:\Apps\HDP\Imagens\Prints\Acomp\OQS. Procedimentos Realizados na Unidade Endovascular.jpg'/>"
'myMessage.Attachments.Add("C:\Users\Admin\Desktop\123.xlsx") 'If you want to attach a file
myMessage.BodyFormat = 2 'HTMLFormat
myMessage.To = vmail.Text '(erro nesta linha)
myMessage.Subject = "teste"
'myAttachments.Add "C:\Apps\HDP\Imagens\Prints\Acomp\teste.jpg"
Set myInspector = myMessage.GetInspector 'add signature to e-mail
Set myDoc = myInspector.WordEditor
'ActiveDocument.GetSheetObject("CH46").CopyBitmapToClipboard
'myDoc.Range(0,0).PasteSpecial False, False, 0, False, 5
'myInspector.WordEditor.Content.InsertBefore chr(13)
'myInspector.WordEditor.Content.InsertBefore chr(13)
' myInspector.WordEditor.Content.InsertBefore EmailBody & chr(13) & chr(13)
myMessage.Display
myMessage.Send
Set myMessage = Nothing
Set myApp = Nothing
Set myInspector = Nothing
Set myDoc = Nothing
End sub
ActiveDocument.Variables("vtestemail").GetContent.String
Ao inves de text tente usar .GetContent().String
ActiveDocument.Variables("vtestemail").GetContent.String
Muito Obrigado Mestre!!!