1. Xavier BOURGOIN
  2. PowerBuilder
  3. Wednesday, 06 March 2019

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
0
Votes
Undo

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
Thanks René. It was a good idea, but it doesn't work.

  1. Xavier BOURGOIN
  2. Wednesday, 6 March 2019
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. René Ullrich
  2. Wednesday, 6 March 2019
René,

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

Thanks a lot for your answer
  1. Xavier BOURGOIN
  2. Wednesday, 6 March 2019
There are no comments made yet.
  1. Wednesday, 6 March 2019
  2. PowerBuilder
  3. # 1
  • Page :
  • 1


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