Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Applescript > word 2008 scrip...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 10 Topic 1636 of 1674
Post > Topic >>

word 2008 script questions

by "G.Miller" <geoff.w.miller@[EMAIL PROTECTED] > Jul 3, 2008 at 06:50 AM

hi, just about as amateur as it can get when it comes to applescript.
i was able to create a script that i used to call from a filemaker 7
database that took information from a record in the database, opened
word (version X), and basically inserted the information.  all was
well until i upgraded to leopard, necessitating and upgrade to
filemaker 9 and word 2008.  my old script used VBA and now im trying
to redo it using applescript.

ive been searching online, trying to piece things together but have
run into a snag that i cannot figure out.
so far i have....

tell application "FileMaker Pro"
   tell layout "Create Estimate"
      set mycontactaddress to cellValue of field "contact_address" of
current record
   end tell
end tell
tell application "Finder"
   open file "letterhead" of desktop
end tell
tell application "Microsoft Word"
   activate
   set myDoc to active do***ent
   set myAddressTable to make new table at myDoc with properties
{number of rows:1, number of columns:2}
   set enable borders of border options of myAddressTable to false
   set content of text object of (get cell from table myAddressTable
of myDoc row 1 column 1) to "Cell 1, 1"
end tell

There are two problems.
1. if i run the script with Word initially closed, i get the error
"Microsoft Word got an error: Can=92t get active do***ent."  on the 'set
myDoc to active do***ent' step.
if Word is active but there are no do***ents open, i get and error
"Microsoft Word got an error: Can=92t make class table." on the 'set
myAddressTable to make new table...' step.
if Word is active and "letterhead" is open, then it doesn't produce an
error on either of those steps.
is the script getting ahead of itself (thats what it seems like).  can
i get it to pause between steps?

2. i get the error "Microsoft Word got an error: myAddressTable of
active do***ent doesn=92t understand the get cell from table message."
on the 'set content of text object...' step.
ive tried deleting that line and replacing it with "set myAddressCell
to cell 1 of row 1 of myAddressTable of myDoc" only to get the error
"Microsoft Word got an error: The object you are trying to access does
not exist" with 'cell 1' being the highlighted object that the error
refers to.

all i am trying to do at this point is insert text into the first cell
in the table i created.
any help is appreciated.  thanks.
 




 10 Posts in Topic:
word 2008 script questions
"G.Miller" <  2008-07-03 06:50:00 
Re: word 2008 script questions
Jolly Roger <jollyroge  2008-07-03 09:21:07 
Re: word 2008 script questions
"G.Miller" <  2008-07-03 08:04:46 
Private Message
   2008-07-03 08:43:25 
Private Message
   2008-07-03 13:02:36 
Re: word 2008 script questions
"G.Miller" <  2008-07-03 12:09:58 
Re: word 2008 script questions
Jolly Roger <jollyroge  2008-07-03 14:57:42 
Private Message
   2008-07-03 14:03:40 
Re: word 2008 script questions
"G.Miller" <  2008-07-03 15:33:41 
Re: word 2008 script questions
Jolly Roger <jollyroge  2008-07-03 17:48:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 10:56:32 CST 2008.