RE: question to MS Word 2008 scripters..
RE: question to MS Word 2008 scripters..
- Subject: RE: question to MS Word 2008 scripters..
- From: Thomas Maffucci <email@hidden>
- Date: Tue, 03 Mar 2009 00:24:15 -0500
- Thread-topic: question to MS Word 2008 scripters..
Pinus wrote
>>I need to know the top position of the last
>>paragraph I've inserted, since I need to place this text box right
>>after this last paragraph.
>>Unfortunately, I've spent my sunday afternoon looking for a solution
>>without success. So know I'm asking if there is at least a way to know
>>the top position of the last inserted paragraph so I can use it to
>>place my text box ? Maybe there is no solution at all ?
Pinus,
This solution is not the most elegant but it works. You will need to
download and install an old but very reliable scripting addition (OSAX)
called "Extra Suites". Here is the link
http://order.kagi.com/cgi-bin/r1.cgi?ENX&
The script below will prompt you to move the mouse to the location on the
document where you wish to place the text box. Hit the return or enter key
on the keyboard and the text box will be placed where you moved the mouse on
the document.
tell application "Microsoft Word"
set myDocument to make new document
set {lft, tp, rgt, bot} to {0, 22, 742, 980}
set the bounds of the front window to {lft, tp, rgt, bot}
display dialog "Move Mouse to set top left corner of text Box, then hit
return key Don't move mouse after placement"
tell application "Extra Suites"
set thisloc to ES mouse location
end tell
--Vertical Loc 218 is the top edge of the Doc based on the above Window
placement
--Horizontal Loc 68 is the left edge of the Doc based on the above
Window placement
set leftmar to (item 1 of thisloc) - 68
set topmar to (item 2 of thisloc) - 218
-- Width and height are preset
set myTBox to make new text box at myDocument with properties ¬
{text orientation:horizontal, left position:leftmar, top:topmar,
width:300, height:200}
set content of text range of text frame of myTBox to "Test Box"
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden