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 > new word 2008 a...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 1637 of 1674
Post > Topic >>

new word 2008 applescript questions

by "G.Miller" <geoff.w.miller@[EMAIL PROTECTED] > Jul 9, 2008 at 11:29 AM

hi, im stuck trying to create a script that adds data to a word
do***ent.  im trying to figure out how to add spaces (ie similar to
typing the return key) between things i insert into a doc as follows:

-open do***ent
-advance the cursor down below the logo that is already there
-type return
-insert the date as text (not as field)
-type return
-add table, format and populate
-advance cursor down below the table
-type return
-insert text from a variable

everything works great except i end up with: the logo, 2 spaces, the
date, the table, 1 space, text
what im looking for is: the logo, 1 space, the date, 1 space, the
table, 1 space, text

if i substitute 'type text selection text "the date"' for the 'insert
date time' step, the spacing is correct, but obviously it just says
"the date".  what am i missing?  ive read through the word 2004
applescript guide to no avail.

-----script
tell application "Microsoft Word"
	open alias ((path to desktop as text) & "letterhead")
	set myDoc to active do***ent
	-- advance cursor down
	navigate text object of selection to goto a line item position
relative count 2
	--add space
	type paragraph selection
	-- insert date, not as field
	insert date time at text object of selection date time format "MMMM
dd, yyyy" without insert as field
	--add space
	type paragraph selection
	-- add table, format and populate
	set myAddressTable to make new table at myDoc with properties {number
of rows:1, number of columns:2}
	set enable borders of myAddressTable's border options to false
	-- add contact info and contact numbers to table
	set content of text object of (get cell from table myAddressTable row
1 column 1) to mycontactaddress
	set content of text object of (get cell from table myAddressTable row
1 column 2) to mycontactnumbers
	-- align the contact numbers right
	set alignment of paragraph format of text object of (get cell from
table myAddressTable row 1 column 2) to align paragraph right
	navigate text object of selection to goto a line item position
relative count 2
	-- advance cursor down
	type paragraph selection
	--insert text from variable
	set content of text object of selection to myestimatebody
end tell
 




 4 Posts in Topic:
new word 2008 applescript questions
"G.Miller" <  2008-07-09 11:29:56 
Re: new word 2008 applescript questions
Jo_y <jo_y@[EMAIL PROT  2008-07-22 08:50:02 
Re: new word 2008 applescript questions
Jo_y <jo_y@[EMAIL PROT  2008-07-24 14:18:53 
Re: new word 2008 applescript questions
Jerry Kindall <jerryki  2008-07-24 17:16:41 

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 14:29:25 CST 2008.