Access.2007.VBA.Bibl..

(John Hannent) #1
Create a standard item using the CreateItemmethod of the Application object:

Set msg = appOutlook.CreateItem(olMailItem)

Create a custom mail message item from a saved Outlook template:

strTemplate = “D:\Templates\Outlook\Personnel.oft”
Set msg = appOutlook.CreateItemFromTemplate(strTemplate)

In previous versions of Office, you could open a saved Outlook template (.oft file) by
simply double-clicking it in an Explorer window. This no longer works, because of more
rigorous Microsoft security measures. In Office 2007 running on Windows Vista, if you try to open an
Outlook template directly, you will get the warning message shown in Figure 8.17.

FIGURE 8.17

A warning message when opening a saved Outlook template file.


After clicking OK, the file will then open as a standard item, not your custom form. To get around this
annoying security feature, select Tools➪Forms➪Choose Form in the main Outlook window, as
shown in Figure 8.18.

FIGURE 8.18

Selecting a custom form in the Outlook interface.


TIPTIP


Working with Outlook Items 8

Free download pdf