Pages Collection

K

Konstantin Becker

Hello!
I try to add a new Page to the AppointmentItem. I do it from C# over COM
with:

AppointmentItem x =
(AppointmentItem )Application.CreateItem(OlItemType.olAppointmentItem);
Inspector ins = x.GetInspector;
Pages p = (Pages)ins.ModifiedFormPage;
p.Add("Test");
ins.ShowFormPage("Test");
x.Display();

it's work!

Now I want to add a Control to the page "Test";
I do it so:

Page y = (Page)p["Test"];
y.Controls.Add(.....);

But Page class or interface does not exist in
Microsoft.Office.Interop.Outlook. I can't cast the object.
What can I do. Please help me!!!

thanks in advanced

Konstantin

P.S. Sorry for my english.
 
K

Ken Slovak - [MVP - Outlook]

The Page object is a member of the MSForms 2.0 library in Outlook forms. You
cannot add to the existing pages that are in an Outlook form item. You can
only modify an existing page and show it and rename it to what you want.

In addition it's not so great to add controls at runtime to a modified page
that you can get with the ModifiedFormPages collection. That one-offs the
form, which causes all sorts of problems.
 

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