Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a custom Outlook form from an Access form? 1

Status
Not open for further replies.

AllenRitch

Technical User
May 20, 2003
52
US
I would like to have a button on an Access form that opens a custom Outlook form I created. I know how to use the following code to open and send a default mail message, but of course, this isn’t what I need.

Set outLookApp = CreateObject("Outlook.Application")
Set eMailItem = outLookApp.CreateItem(olMailItem)

I’m not sure if this is relevant or not, but the Message class of my custom Outlook form is IPM.Note.Bankruptcy. Would I use this in place of olMailItem?

Assuming this can be done, can I also automatically populate the user-defined Outlook text fields with my Access text fields?

Thanks
 
With further research, I discovered how to open the custom Outlook form using the following code:

Set outLookApp = CreateObject("Outlook.Application")
Set outLookName = outLookApp.GetNamespace("MAPI")
Set outLookFolder = outLookName.GetDefaultFolder(olFolderInbox)
Set eMailItem = outLookFolder.Items.Add("IPM.Note.Bankruptcy")

However, on my Access form, I have a field/control named DebtorName. I also have a custom field on the Outlook form named DebtorName as well. Is it possible to automatically populate the value of DebtorName on the custom Outlook form with the value of DebtorName on the Access form?
 
For those of you who care. You can populate custom fields between Access & Outlook using the following:

Set outLookProp = eMailItem.UserProperties.Add("txtDebtorName1", olText)
outLookProp = strDebtorName
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top