Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Edison, New Jersey, USA
    Posts
    215
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Coding the view of a document (W97)

    I have a toolbar button for references. When the user opens the document, it appears in normal view. How can I code it open in Page View? (or a specific view)

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Coding the view of a document (W97)

    How was the document or template from which document derives last saved?
    Open it, change the view to Page (called Print in 200X), then save it.

    In code you can change the view with this:

    ActiveWindow.View.Type = wdNormalView

    If you record a macro that changes the view, you'll see .Pane object
    statements too. You may need those.

    I hope that helps??
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Edison, New Jersey, USA
    Posts
    215
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Coding the view of a document (W97)

    So I could put the
    ActiveWindow.View.Type=wdNormalView
    into the WordObject/Document Open ? Will have to try it , Thanks.

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Coding the view of a document (W97)

    Sure. But what about the saved state of the template or doc?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Edison, New Jersey, USA
    Posts
    215
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Coding the view of a document (W97)

    It is a read only file.... Therefor, if I last saved it as Page View, it will open in Page View?
    And If I last Viewed it at 80%, it will reopen at 80%..... How does it "remember"/Store it's last "state of being"?

  6. #6
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Coding the view of a document (W97)

    Yes and Yes unless there's autoexec or document_open code that makes changes to settings.

    How? By design, I guess.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  7. #7
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Coding the view of a document (W97)

    One other thing to bear in mind when manually changing the viewstate of a template or document: the changes won't 'stick' unless you dirty the document and save it, before closing it (all you need to do is type a space at the end of the document, then backspace, and then save).

    If you want to enforce it via code, I think the constant in Word 97 was called "wdPageView" (which changed to "wdPrintView" in Word 2000 and later; they kept the 'wdPageView' though for backward compatibility).

    Gary

  8. #8
    Lounger
    Join Date
    Aug 2002
    Location
    Sierra Madre, California, USA
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Coding the view of a document (W97)

    I am doing a similar thing to force the view of a Word XP document:

    <pre>Public Sub ShowBlackline()

    With ActiveWindow.View
    .ShowRevisionsAndComments = True
    .RevisionsView = wdRevisionsViewFinal
    End With

    ActiveDocument.Saved = False

    ActiveDocument.Save
    End Sub</pre>


    I'm using ActiveDocument.Saved=False to dirty the document - it seems to work great so far.
    Does anyone have a better way or know of any issues doing it this way?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •