MS Word window sizes.
MS Word window sizes.
- Subject: MS Word window sizes.
- From: Timofey Danshin <email@hidden>
- Date: Fri, 2 Apr 2010 13:22:19 +0400
Hi.
Being an editor of translations, i often need to have two documents in two different languages open side by side. To that end wrote a small script that is intended to check the screen resolution and fit all the MS Word's windows side by side. It soon turned out that word can't do that if there are more than two documents open. Well, that was not much of a problem, because i only need two. But after a while the script stopped working even with two windows! Or, rather, it sometimes works, but, more often it doesn't. What can there be wrong?
Here is the script. I would greatly appreciate your help.
tell application "Finder"
set screenbounds to bounds of window of desktop
end tell
set {a, b, c, d} to screenbounds
tell application "Microsoft Word"
activate
set allWordWindows to windows
set numOfWindows to number of windows
if (numOfWindows > 2) then
display dialog "Too many windows. Only two can be supported by Word" buttons {"Ok"}
return
end if
repeat with i from 0 to numOfWindows - 1
set startingPoint to i * ((c / numOfWindows) - 1 as integer)
set bounds of item (i + 1) of allWordWindows to {startingPoint + 1, 22, startingPoint + (c / numOfWindows as integer), d}
set view type of view of allWordWindows(i + 1) to draft view
set page fit of zoom of view of allWordWindows(i + 1) to page fit best fit
set track revisions of document of allWordWindows(i + 1) to true
end repeat
end tell
And here is the error message I get:
error "Microsoft Word got an error: Can’t set bounds of window \"072574_en.doc [Compatibility Mode]\" to {1, 22, 720, 900}." number -10006 from bounds of window "072574_en.doc [Compatibility Mode]"
--
Best Regards,
Timofey.
_______________________________________________
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