outlook merge field

A

adubb

i have a textbox in a custom outlook form. I am trying to merge the
information in that textbox to a field in microsoft word. however I am
getting a type mismatch error. here is my code in my outlook form:

Sub cmdPrint_Click()
Dim oWordApp
dim strMyField
dim oDoc
' Open a new document
Set oWordApp = CreateObject("Word.Application")
Set oDoc = oWordApp.Documents.Add("C:\Terminated Employee Checklist.dot")
' Set the first bookmark to the contact's full name
Set strMyField = Item.UserProperties.Find("FullName")
oDoc.FormFields("Text1").Result = strMyField
End Sub
 
S

Sue Mosher [MVP-Outlook]

FullNames is a built-in property, not a custom property, hence Item.FullName is the correct syntax. See http://www.outlookcode.com/d/propsyntax.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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