How can I return the HTML "Title" property for a MailItem

K

Kristy

Hi

I need to get the 'title' name of the current item into a string so
that I can include it in a Word Template that summarises certain
MailItems. I now that it is usually just 'Message' but since it can
be changed I need to include it.

I can see it using Outlook Spy under HMTLEditor>DispHTMLDocument>title
but how do I return that info myself programmatically at run time?

I tried using HrGetOneProp like below but that didn't work... what am
I missing?

Set utils = CreateObject("Redemption.MAPIUtils")
Set MailItem = golApp.ActiveInspector.CurrentItem
PR_TITLE_PROP = utils.GetIDsFromNames(MailItem.MAPIOBJECT,
"{3050F55F-98B5-11CF-BB82-00AA00BDCE0B}", "Title", True)
PR_TITLE_PROP = PR_CONTACTINFO_PROP + &H1E
TitleField = utils.HrGetOneProp(MailItem.MAPIOBJECT, PR_TITLE_PROP)

Thanks

Kris
 
K

Ken Slovak - [MVP - Outlook]

The easiest way to get at that might be by using a Document item and a
property of that Document item using the IE object model. See the Help in
the Object Browser, it has an example of getting the Document object from an
HTMLEditor object. That property is restricted however and will fire the
security prompts in Outlook 2003 and 2002 SP3.

The MSDN library has information about getting at various Document
properties in its information about the SHDocVw library. It would be from
either SHDocVw.WebBrowser.Document or SHDocVw.InternetExplorer.Document.
 
D

Dmitry Streblechenko \(MVP\)

Can you see that property using OutlookSpy from within the Inspector (click
IMessage)? Did you try to save the message first?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top