Qlik Community

Qlik Brasil

Group community for Brazil users. discussion only in Portuguese.

marcelviegas
Contributor II

macro email x variavel

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

Tags (1)
1 Solution

Accepted Solutions
Employee
Employee

Re: macro email x variavel

ActiveDocument.Variables("vtestemail").GetContent.String

3 Replies
Highlighted
Employee
Employee

Re: macro email x variavel

Ao inves de text tente usar .GetContent().String

Employee
Employee

Re: macro email x variavel

ActiveDocument.Variables("vtestemail").GetContent.String

marcelviegas
Contributor II

Re: macro email x variavel

Muito Obrigado Mestre!!!