Getting the name of a Form Page in OL AddIn (C++)

S

Steve D

Does anyone know how to get the "Name" of an Outlook Form page from
within a C++ Outlook COM Add-In?

Its very simple in VBScript:
p3Name = GetInspector.ModifiedFormPages(3).Name

However, I'm porting the VBScript to a C++ COM Add-In and can't work
out how to do the same thing!

Code snippet is:

Outlook::pagesPtr pPages;
_UserFormPtr pPage3;

pPages = pInspector->GetModifiedFormPages();
pPage3 = pPages->Item(variant_t(3L));

As far as I can see, the _UserForm does not have a "Name" property
associated with it.

Using Outlook Spy, I browsed down the Inspector/ModifiedFormPages to
get a _UserForm view of the page. I noticed that the "Name" property is
not listed in Outlook Spy

However, in Outlook Spy, on the Script tab, there is a Global Variable
listed called "UserForm", and I can run some script in there to
correctly print out the "name" of the form page

ie Debug.Print UserForm.Name -> Prints out the correct name of the
form
 
D

Dmitry Streblechenko

AFAK that property is only accessble using late binding (don't ask me why).
Use IDispatch::GetIDsOfNames/Invoke to retrieve its value.

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