A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

outlook merge field



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 23rd 06, 06:59 PM posted to microsoft.public.outlook.program_forms
adubb
external usenet poster
 
Posts: 13
Default outlook merge field

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  
Old May 27th 06, 03:14 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default outlook merge field

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 09:06 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.