![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
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 |
#2
|
|||
|
|||
![]()
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 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "adubb" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mail merge to Outlook | zombeese | Outlook - General Queries | 13 | June 23rd 06 05:56 PM |
How do I merge two calendars in Outlook 2003? | rasmund | Outlook - Calandaring | 1 | March 6th 06 07:25 PM |
Adding Follow Up field to Field Chooser Programatically. | c | Outlook and VBA | 3 | February 25th 06 03:10 PM |
use the Catagory field to create a mail merge? | Clara | Outlook - Using Contacts | 1 | February 4th 06 07:06 PM |
Populate Company field from Contact field in custom task form | Sue Mosher [MVP-Outlook] | Outlook - Using Forms | 0 | January 20th 06 08:37 PM |