1. Xavier BOURGOIN
  2. PowerBuilder
  3. Wednesday, 6 March 2019 08:34 AM UTC

Hello,

I use to build outlook Email with OLE components and I want to insert the default digital signature in the htmlbody.

Someone can help me?

 

I give you part of my code with the variables declarations :

OLEObject viole_application
OLEObject ole_item, ole_attach
string vls_htmlbody
string vls_file

viole_application.ConnectToNewObject("outlook.application")
ole_item = viole_application.CreateItem(0)
ole_attach = ole_item.Attachments

...

vls_htmlbody = ...
vls_file = ...
...
ole_item.htmlBody = vls_htmlbody
//I want to insert here the default outlook digital signature 

ole_attach.add(vls_fichier)

...

 

Thanks

René Ullrich Accepted Answer Pending Moderation
  1. Wednesday, 6 March 2019 09:27 AM UTC
  2. PowerBuilder
  3. # 1

I think the default signature should be already inserted if you create a new message.

So you have to insert your message into the html body (instead of overwrite it).

Try

ole_item.htmlBody = vls_htmlbody + ole_item.htmlBody

Comment
  1. Xavier BOURGOIN
  2. Wednesday, 6 March 2019 13:43 PM UTC
Thanks René. It was a good idea, but it doesn't work.

  1. Helpful
  1. René Ullrich
  2. Wednesday, 6 March 2019 14:55 PM UTC
I tested it out with body instead of htmlbody: The trick is to call the display function before you set the body. Outlook adds the signature when you call the Display function and if body is not modified.



ole_item.Display

ole_item.Body = vls_body + ole_item.Body



It should also work with htmlbody but you have to insert your content into the existing html document.
  1. Helpful
  1. Xavier BOURGOIN
  2. Wednesday, 6 March 2019 15:35 PM UTC
René,

I just add ole_item.Display and it's work perfectly even with htmlbody

Thanks a lot for your answer
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.