Re: Setting Data Source for Microsoft Word mail merge
Re: Setting Data Source for Microsoft Word mail merge
- Subject: Re: Setting Data Source for Microsoft Word mail merge
- From: Jim Skibbie <email@hidden>
- Date: Wed, 29 Sep 2010 14:48:23 -0500
- Thread-topic: Setting Data Source for Microsoft Word mail merge
Title: Re: Setting Data Source for Microsoft Word mail merge
Does anyone have experience with data merge via Applescript for MS Word that might be able to answer this question?
From: Jim Skibbie
Date: Tue, 21 Sep 2010 16:31:49 -0500
To: Applescript Users <email@hidden>
Conversation: Setting Data Source for Microsoft Word mail merge
Subject: Setting Data Source for Microsoft Word mail merge
I’m trying to automate a mail merge in Microsoft Word (2008) via Applescript to make some sticker labels. Basically, I have a document X that has the labels all laid out with merge fields. I have another document Y that is the data source (a csv file).
The script below works and executes the data merge, except that on the line that requests to “open data source y name...” which I’m using to set the data source for the merge, a dialog box called “Edit Labels” pops up in Word. If the user does not cancel or “OK” this dialog box, the script eventually times out.
tell application "Microsoft Word"
open DocumentPath -- (alias as string) to main document that houses the merge label layout
set x to document file_name_doc -- file_name_doc is the name of the document as string) to main
set y to data merge of x
open data source y name (DataPath) format open format encoded text --DataPath is an (alias as string) to the data file
execute data merge y
end tell
Is there a way to get around this? I’m not sure why this dialog box pops up and I cannot find any parameter in the “open data source” command to say I want to ignore this dialog.
Thanks.
Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden