Custom Meeting Request form

G

GSK

I want to customise the Meeting Request form. I have added a new Meeting
Request Form from Design Form section. In one of
the tabs (P.2) I have placed some controls (textbox, button,labels) and
"Required Attendees" field from Field Chooser options.
How can I add the VB code to the form to invoke the button click event and
populate the Required Attendees field ? When I do Alt + F11, am not able to
access the form elements.

Kindly let me know how to add code and populate the Required Attendees field
programatically.

Thanks in advance.
Regards
GSK
 
S

Sue Mosher [MVP-Outlook]

Alt+F11 opens the VBA coding environment. Code on custom forms is not VBA, but VBScript. With the form in design mode, click the View Code button.
 
G

GSK

Thanks. But am not sure how to access the controls(buttons,textbox) in the
Script editor window. If you could provide some example it would be really
great.

Thanks and Regards
GSK
 
S

Sue Mosher [MVP-Outlook]

You need to type in the complete procedure declaration for any Click event handlers, e.g.:

Sub CommandButton1_Click()
Msgbox "It works"
End Sub

For Item-level events, use the Script | Event Handler command.

The VBA environment is still useful, of course, for prototyping code and for looking up Outlook property names in the object browser.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
G

GSK

To start with I tried this in the P.2 form

Function Item_Open()
Msgbox "hi"
Item.GetInspector.ShowFormPage ("P.2")
Msgbox "hi"
End Function

Private Sub CommandButton2_Click()
Msgbox "hi"
End Sub

When I ran it, I am getting both the "Hi" messages but the P.2 form is not
selected.
When I go to P.2 form and click on the button, the message is not displayed.

Also please let me know would it be possible to a use
MAPI.Session/address/field and query the CdoPR_BUSINESS_ADDRESS_CITY value
and display in the controls.

THanks again.
GSK
 
G

GSK

I just found the syntax issue and its working now the Form selection and
button click. But I still have the other question. Please let me know would
it be possible to a use
MAPI.Session/address/field and query the CdoPR_BUSINESS_ADDRESS_CITY value
and display in text field on click of button in the Custom form.

Thanks
GSK
 
G

GSK

Thanks Sue.
In the Custom form I have added _RecipientControl1 field from the Field
chooser and renamed the Field name to RecipientControl1
I am not able to set the value for the field. THe below code doesn't work.
Please let me know how to set the value. What am currently trying to do is
based on the resource entered, identify the city where the User belongs to
and Query the Meeting Room in the city (meeting room is again an Outlook GAL
resource) and I want to populate the value to the Recipeitn Control.

Set objPage = Item.GetInspector.ModifiedFormPages("P.2")
Set objControl = objPage.Controls("RecipientControl1")
objControl.Value = "Meeting Room Austin"
Msgbox objControl.Value

Thanks
Siva
 
S

Sue Mosher [MVP-Outlook]

That's the control that exposes the Recipients collection. You need to use that collection's methods, e.g. Recipients.Add, not try to write code for the control.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 

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