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
Dmitry Streblechenko - 13 Oct 2005 19:01 GMT
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
> Does anyone know how to get the "Name" of an Outlook Form page from
> within a C++ Outlook COM Add-In?
[quoted text clipped - 26 lines]
> ie Debug.Print UserForm.Name -> Prints out the correct name of the
> form
Steve D - 13 Oct 2005 19:10 GMT
Thanks Dmitry - I'll give that a try when I get back to work
Steve