Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / October 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve D - 13 Oct 2005 16:17 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.