Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Meena Bhashyam
 
Posts: n/a
Default MailMerge.CreateHeaderSource

I am having problems getting this functionality to work!
I have Word 2003, and am trying to give the users a list of fields to select
while creating their letter templates.
Using the following statement gives me a message box that the headerstring
is 255 characters, which it is.

Dim headerString as String
Dim fileName as String

headerString = "LastName, FirstName, Address1, Address2, City, State, Zip,
Country, ........" '(Len(headerString) 255 chars)

fileName = "HeaderFields.doc"

objWord.MailMerge.CreateHeaderSource fileName, , , headerString

I think this limitation is due to the fact that it stores the fields in a
single row table in the Word Document specified by fileName. Cannot have
unlimited number of cells on one row.

I tried getting around this by manually creating an excel spreadsheet with
the fields in different cells, and calling

objWord.MailMerge.OpenHeaderSource fileName.xls

This time it failed on an RPC call. Has anybody faced this problem before?
 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:59 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"