PRB: The HeaderRecord String for Word's CreateDataSource Method is Limited in Size to 255 Characters (298418)
The information in this article applies to:
- Microsoft Word 2002
- Microsoft Word 2000
- Microsoft Word 97 for Windows
This article was previously published under Q298418 SYMPTOMS
When you create a new MailMerge data source for a Word document, and you specify a HeaderRecord that is longer than 255 characters in length to Word's CreateDataSource method, you receive the following error message:
Run-time error '9105':
String is longer than 255 characters
CAUSE
This is an internal limitation to the MailMergeCreateDataSource function. The HeaderRecord cannot be longer than 255 characters.
RESOLUTION
If you need to create a new data source that has more fields than can be listed in a 255 character string, you cannot use CreateDataSource to create the new file. Instead, open a new document with Documents.Add and programmatically add a table to it with all the field names that you need. Save the file and use OpenDataSource to add the new document as the data source.
Modification Type: | Major | Last Reviewed: | 12/15/2003 |
---|
Keywords: | kbAutomation kbprb KB298418 |
---|
|