Jump to content

Recommended Posts

Posted

Hello, I am trying to open an Outlook template, edit the contents depending on user input, and then generate a message with the updated information. So far, I have been able to take care of everything except editing the html in the body (Thanks to Waters and the useful UDF). Basically, the body is html (edited and formatted) and I cannot find a way to edit it properly. So if the body in the template says "Hello, John" and the user chooses the name to be "George", I would like to replace it accordingly. What would be the best approach to doing so? Any help is greatly appreciated.

Posted

If you use my UDF you simply would read the HTMLBody property of the mail item to a variable by using function _OL_ItemGet. Make the necessary modifications to the variable and then set the property by using function _OL_ItemModify.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

Example 5 in _OL_ItemCreate.au3 example script shows how to create a mail item from a template.

Use the returned item object to call _OL_ItemGet, change the HTML body and set the property again:

$aProperties = _OL_ItemGet($oOL, $oItem, Default, "HTMLBody")
$sHTMLBody = $aProperties[1][1]
$sHTMLBody = "Modify the HTMP Body here"
_OL_ItemModify($oOL, $oItem, Default, "HTMLBody=" & $sHTMLBody)
Untested and error checking is missing!

My UDFs and Tutorials:

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...