• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
MS Word 98 scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MS Word 98 scripting


  • Subject: MS Word 98 scripting
  • From: Andrew Duncan <email@hidden>
  • Date: Wed, 11 Apr 2001 12:10:33 +1000

Further to my earlier message I've discovered that if there is a table in
the MS Word document the script fails to insert the data after the table. If
I remove the table all works fine and I can reference the text by line. When
I have:

set text second word of line 20 to var_firstname

with the table it replaces a word within the table itself even though it
isn't line 20. It can't seem to work with a table in the document itself.
Anyone come across this before or know how to reference a line that is after
a table in the document.

Kind regards,
Andrew


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


  • Prev by Date: Re: X-script header Re: =b4
  • Next by Date: Re: error codes explained
  • Previous by thread: MS Word 98 scripting
  • Next by thread: Re: X-script header Re: =b4
  • Index(es):
    • Date
    • Thread