Word does not remember position of window

K

Kurt_Wenger

Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I have just installed office:mac 2008 on my new iMac. Exept, that Word does not remember the position of the window for allready saved documents, everything works OK. According to some comment I found in the forum, I edited a script to size and also position the active window. No problem with this script. At reopening the saved documentm the size of the window is correct but it is always positioned at the upper left corner.
All other office applications do remember the last position of the window.

I this normal for Word or not? How can I fix it?

Thanks for your answer
 
J

John McGhie

This is "supposed" to work in Word 2008, but due to a bug, it doesn't...
And it won't be fixed before the next version...

You can add the "Top" and "Left" parameters to your script.

That won't "remember" the position, but it will move the Window to a
position you specify when you re-open.

If you want to, you can write a script that writes the Top and Left
positions (in pixels) to a Document Variable on save. Don't forget to check
that the Document Variable exists before attempting to write to it, or you
will blow up.

Then read them back in from the document variable on open.

It's another two or three lines of code, but it will do what you want.

Cheers

Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel
I have just installed office:mac 2008 on my new iMac. Exept, that Word does
not remember the position of the window for allready saved documents,
everything works OK. According to some comment I found in the forum, I edited
a script to size and also position the active window. No problem with this
script. At reopening the saved documentm the size of the window is correct but
it is always positioned at the upper left corner.
All other office applications do remember the last position of the window.

I this normal for Word or not? How can I fix it?

Thanks for your answer

--

The email below is my business email -- Please do not email me about forum
matters unless I ask you to; or unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410
+61 4 1209 1410, mailto:[email protected]
 
K

Kurt_Wenger

This is "supposed" to work in Word 2008, but due to a bug, it doesn't...
> And it won't be fixed before the next version...
>
> You can add the "Top" and "Left" parameters to your script.
>
> That won't "remember" the position, but it will move the Window to a
> position you specify when you re-open.
>
> If you want to, you can write a script that writes the Top and Left
> positions (in pixels) to a Document Variable on save. Don't forget to check
> that the Document Variable exists before attempting to write to it, or you
> will blow up.
>
> Then read them back in from the document variable on open.
>
> It's another two or three lines of code, but it will do what you want.
>
> Cheers
>
> On 11/12/09 3:09 AM, in article (e-mail address removed)2ac0,
> "[email protected]" wrote:
>
>
> --
>
> The email below is my business email -- Please do not email me about forum
> matters unless I ask you to; or unless you intend to pay!
>
> John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
> McGhie Information Engineering Pty Ltd
> Sydney, Australia. | Ph: +61 (0)4 1209 1410
> +61 4 1209 1410, mailto:[email protected]
>
Hi John

Thanks for your answer.
I do not know how to edit the mentioned script to a Document Variable on save. Maybe You can give me some hints?

Cheers>
 
J

John McGhie

Hi Kurt:

No, sorry, I can't tell you. I am a VBA coder, not AppleScript. One of the
other guys will be along in a minute.

I could show you how to do it in VBA, but not in AppleScript. There should
be a "Variables" collection in the AppleScript dictionary. A document
variable is simply a persistent property you can write into a document file.
It is not exposed from the user interface, only from code.

A Custom Document Property would be just as good, but coders tend to steer
clear of them because Custom Document Properties are visible to the user,
who can change or delete them and upset your code :)

Here are the examples from VBA Help in Word 2004:

The following example saves a document variable in the same location as the
macro that is running (document or template) using the ThisDocument
property.

ThisDocument.Variables.Add Name:="Age", Value:=12

The following example uses the Value property with a Variable object to
return the value of a document variable.

num = ThisDocument.Variables("Age").Value

For your purposes, you need "ActiveDocument" in place of "ThisDocument",
because you want to write the variable into the document being saved, not
into the common template.

You need to test for the presence of the variable before you attempt to
write to it, or you'll blow up. In VBA you have to iterate the Variables
collection looking for the name, using a For...Each...Next loop. In
AppleScript, I believe you can do it with a Try...Catch clause.

Hope this helps


Hi John

Thanks for your answer.
I do not know how to edit the mentioned script to a Document Variable on save.
Maybe You can give me some hints?

Cheers>

--

The email below is my business email -- Please do not email me about forum
matters unless I ask you to; or unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410
+61 4 1209 1410, mailto:[email protected]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top