Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

In Word 2003 -- setting doc view to 100%, externally?

Status
Not open for further replies.

Walipala

Technical User
Jan 5, 2007
21
US
I would like to set a directory full of Word 2003 docs to view at 100% when opened the next time around. Is this a property that can be set all by itself? I have noticed that when I just do this alone, either manually or by running the following code in a macro, the property does not 'take' after saving and closing.

Code:
ActiveWindow.ActivePane.View.Zoom.Percentage = 100

Is there a way to accomplish this, or must I also make (and then save) some other change to the docs as well? Thanks in advance.
 
And what about this ?
ActiveWindow.ActivePane.View.Zoom.Percentage = 100
ActiveDocument.Saved = False
ActiveDocument.Close True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
The zoom percentage is saved with the document - and each must be changed. Are you saying that even when you do it for a single document, it isn't saved?

The best thing to do is probably to have a Document_Open macro which forces the zoom to 100% regardless of what has been saved. But it does depend a little on whether you're trying to do this for yourself or for multiple users.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
Yes Tony, even when I do it with a single document my view-percentage is not saved... if that's ALL I do. If however, I make another change to the doc, even something as lame as adding a space somewhere, then saving the doc, then removing the space again, then saving again and closing, the new view will be preserved.

PHV, your code seems to work, thanks. When I run it in a macro on say, a 150%-view doc, it does reopen with a view of 100%. I would love to know why.

For what it's worth, the original code I was using had (what I thought was) a save-document statement but it didn't do the job I wanted it to...

Code:
ActiveWindow.ActivePane.View.Zoom.Percentage = 100
ActiveDocument.Save
 
I would love to know why
The magic is here:
ActiveDocument.Saved = False
ie, pretend that the doc has changed ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Great, thanks. I believe I can work that into another process that's had me frustrated. I discovered that I cannot create and save custom document properties either. I have a macro that creates them, saves, and closes the doc. But when I would reopen the document the new properties are no longer there.

This seems like a bug to me, since any changes made to just the built-in doc properties ARE preserved. But anyway... it was my down and dirty solution to reassign values to some of the built-in properties as part of creating the custom properties. Looks like I might be able to use that statement instead.
 
For some reason, there are a few types of changes you can make to a document which do not, themselves, flag the file as dirty so, if they are all you do, 'saving' the file does nothing. Explicitly setting .Saved = False (as PHV has done) forces the 'save' to actually save the document including the changes you have made - whatever they are.

The other side of this coin is that there are some changes that you don't want to save (toolbar button status changes in templates for example) which do trigger an unwanted 'do you want to save changes' message when closed.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top