Microsoft Word Suite
238
Example
This example creates a new data source document named "Data.doc" and attaches the data source to
the active document. The new data source includes a five-column table that has the field names
specified by the header record argument.
create data source data merge of active document ¬
name "Macintosh HD:Users:Shared:Data.doc" ¬
header record "Name, Address, City, State, Zip"
Command: create header source
Creates a Word document that stores a header record that's used in place of the data source header
record in a data merge. This method attaches the new header source to the specified document,
which becomes a main document if it's not one already.
Note The new header source uses a table to arrange data merge field names.
Syntax
create header source data merge Required. An expression that returns a data merge object.
name Unicode text Required. The path and file name for the new header source.
[password document Unicode text] Optional. The password required to open the new header
source.
[write password Unicode text] Optional. The password required to save changes to the header
source.
[header record Unicode text] Optional. A string that specifies the field names for the header
record. If this argument is omitted, the standard header record is used: Title, FirstName,
LastName, JobTitle, Company, Address1, Address2, City, State, PostalCode, Country,
HomePhone, WorkPhone.
Example
This example creates a header source with five field names and attaches the new header source
named "Header.doc" to the active document.
create header source data merge of active document name "Header.doc" ¬
header record "Name, Address, City, State, Zip"
This example creates a header source for the document named "Main.doc" (with the standard
header record) and opens the data source named "Data.doc."
create header source data merge of document "Main.doc" name "Fields.doc"
open data source data merge of document "Main.doc" ¬
name "Macintosh HD:Users:Shared:Data.doc"