MS Word 98 scripting
MS Word 98 scripting
- Subject: MS Word 98 scripting
- From: Andrew Duncan <email@hidden>
- Date: Wed, 11 Apr 2001 11:22:28 +1000
Hi,
I'm trying to move some data from a FM Pro 5 database to MS Word 98. I can
successfully move field data from FM Pro to cells in a MS Word table but I
can't seem to set data outside of the table. Does anyone know how to achieve
this, for example to set the second word on line 20 to "hello"? Here's the
script I'm working on so far:
----
tell application "FileMaker Pro"
set var1 to get data cell "test" of current record of document 1
set var2 to get data cell "fax" of current record of document 1
set var3 to get data cell "first_name" of current record of document 1
set var_name to var1 as text
set var_fax to var2 as text
set var_firstname to var3 as text
tell application "Microsoft Word"
activate
open file "Andrew's Mac:Applications (Mac OS 9):Microsoft Office
98:Templates:samplefax"
set cell 2 of table 1 to var_name
set cell 14 of table 1 to var_fax
set text second word of line 20 to var_firstname
do Visual Basic " ActiveWindow.ActivePane.View.Zoom.Percentage =
100"
end tell
end tell
---
It breaks down at the line:
set text second word of line 20 to var_firstname - the event log shows "-->
Microsoft Word got an error: Can't set text "Andrew" of line 20 to "Andrew""
I can't seem to find the right command to change the second word on line 20.
Any ideas?
Thanks - Andrew