Microsoft Word Suite
303
This example changes the formatting of the Heading 1 style in the template attached to the active
document. The update styles command updates the styles in the active document.
set aDoc to open as document attached template of active document
set name of font object of Word style style heading1 of aDoc to "Arial"
set font size of font object of Word style style heading1 of aDoc to 16
set bold of font object of Word style style heading1 of aDoc to false
close aDoc saving yes
update styles active document
Command: open data source
Attaches a data source to the specified document, which becomes a main document if it's not one
already.
Syntax
open data source data merge Required. An expression that returns a data merge object.
name Unicode text Required. The data source file name. You can specify a Microsoft Query
(.qry) file instead of specifying a data source, a connection string, and a query string.
[format enumeration] Optional. The file converter used to open the document. Can be one of the
following: open format auto, open format document, open format mac readable, open format
rtf, open format template, open format text, open format unicode text, or open format web
pages. The default value is open format auto.
To specify an external file format, use the open format property with a file converter object to
determine the value to use with this argument.
[confirm conversions Boolean] Optional. True to display the Convert File dialog box if the file
isnt in Word format.
[read only Boolean] Optional. True to open the data source on a readonly basis.
[link to source Boolean] Optional. True to perform the query specified by connection and SQL
statement each time the main document is opened.
[add to recent files Boolean] Optional. True to add the file name to the list of recently used files
at the bottom of the File menu.
[password document Unicode text] Optional. The password used to open the data source.
[password template Unicode text] Optional. The password used to open the template.
[Revert Boolean] Optional. Controls what happens if name is the file name of an open
document. True to discard any unsaved changes to the open document and reopen the file;
false to activate the open document.
[write password Unicode text] Optional. The password used to save changes to the document.
[WritePasswordTemplate Unicode text] Optional. The password used to save changes to the
template.
[connection Unicode text] Optional. A range within which the query specified by SQL
statement is to be performed. When retrieving data through ODBC, you specify a connection
string.