locked
Word 2010 Macro Problem - AutoOpen and Zoom RRS feed

  • Question

  • All, I have a simple AutoOpen macro to open files in "Final" mode and zoom to page width. When I open a new file (File/New/Blank Template (nomal.dotm)) the page is not zoomed to page width. Opening normal.dotm directly opens th file zoomed to page width. Can anyone tell me where I am going wrong please?

    Sub AutoOpen()
    ' Open a document with "Final" (without markups showing)
    ' Szigeti 101209
    '
        ActiveDocument.ShowRevisions = False
    '
    ' Zoom to page width
    '
        ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit
    '
    End Sub

    Saturday, December 11, 2010 7:22 PM

Answers

  • The macro will need to be named AutoNew for it to run when a new document is created (or you need another macro with that name that contains the same code.

    -- Hope this helps.

    Doug Robbins - Word MVP,
    dkr[atsymbol]mvps[dot]org
    Posted via the Community Bridge

    "Aussie_1" wrote in message news:46ba71fa-ae32-44ea-b1b1-e882c9be5b16@communitybridge.codeplex.com...

    All, I have a simple AutoOpen macro to open files in "Final" mode and zoom to page width. When I open a new file (File/New/Blank Template (nomal.dotm)) the page is not zoomed to page width. Opening normal.dotm directly opens th file zoomed to page width. Can anyone tell me where I am going wrong please?

    Sub AutoOpen()
    ' Open a document with "Final" (without markups showing)
    ' Szigeti 101209
    '
        ActiveDocument.ShowRevisions = False
    '
    ' Zoom to page width
    '
        ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit
    '
    End Sub


    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org
    • Marked as answer by Aussie_1 Monday, December 13, 2010 12:49 AM
    Saturday, December 11, 2010 9:08 PM

All replies

  • The macro will need to be named AutoNew for it to run when a new document is created (or you need another macro with that name that contains the same code.

    -- Hope this helps.

    Doug Robbins - Word MVP,
    dkr[atsymbol]mvps[dot]org
    Posted via the Community Bridge

    "Aussie_1" wrote in message news:46ba71fa-ae32-44ea-b1b1-e882c9be5b16@communitybridge.codeplex.com...

    All, I have a simple AutoOpen macro to open files in "Final" mode and zoom to page width. When I open a new file (File/New/Blank Template (nomal.dotm)) the page is not zoomed to page width. Opening normal.dotm directly opens th file zoomed to page width. Can anyone tell me where I am going wrong please?

    Sub AutoOpen()
    ' Open a document with "Final" (without markups showing)
    ' Szigeti 101209
    '
        ActiveDocument.ShowRevisions = False
    '
    ' Zoom to page width
    '
        ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit
    '
    End Sub


    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org
    • Marked as answer by Aussie_1 Monday, December 13, 2010 12:49 AM
    Saturday, December 11, 2010 9:08 PM
  • Doug,

    Thanks a million :-) That worked!

    All the research that I did ... and to miss that solution ... oh well ... I learn someting every day ...

    Monday, December 13, 2010 12:49 AM