Set objPage = Item.GetInspector.ModifiedFormPages("Message")
Set objTemplate =
objPage.Controls("cmbTemplate")
Add Items in cmbTemplate:
objTemplate.additem "please Call me immedi...."
objTemplate.additem "Hope you have a good trip...."
objTemplate.additem "Everything is Ok...."
objTemplate.additem "I am busy now...."
Next step is Template
selection from cmbTemplate:
We can use only click event of
any control on this page so that we create Click event of cmbTemplateby
writing
Sub
cmbTemplate_Click()
End
sub
Apply this code on
above event
Set objPage = Item.GetInspector.ModifiedFormPages("Message")
Set objTemplate = objPage.Controls("cmbTemplate")
Item.Body=objTemplate.Text
Now we can see preview
by click on 'Run this Form' button on custom form page menu bar.
We need to publish the
form in the forms library or in the folder where you want to use .If you publish
it in a public folder, it will be available for all users who have permission to
access the folder. If you publish it in a personal folder, it's for your use
only.
In this example we
publish this form in Personal Forms Library with name 'MyApplicaationForm'.
Call custom form from vb.net
side:
For calling this custom form from
vb.net form with the help of these lines of code:
Dim outLookApp As New Microsoft.Office.Interop.Outlook.Application()
Dim objNameSpace As Microsoft.Office.Interop.Outlook.NameSpace
= outLookApp.GetNamespace("MAPI")
Dim objFolder As Microsoft.Office.Interop.Outlook.MAPIFolder
=
objNameSpace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox)
Dim MailItem As Microsoft.Office.Interop.Outlook.MailItem
=DirectCast(outLookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem),
Microsoft.Office.Interop.Outlook.MailItem)
MailItem = DirectCast(objFolder.Items.Add("IPM.Note.MyApplicationForm"),
Microsoft.Office.Interop.Outlook.MailItem)
MailItem.Display("IPM.Note.MyApplicationForm")
(Need to add
Microsoft.Office.Interop.Outlook library referance)