• AutoOpen Macro (Word 2007)

    Author
    Topic
    #454877

    I am trying to create an AutoOpen macro that will return the cursor to the location it was in when saved. I know how to do this manually (Shift + F5). I used the macro recorder and named the macro AutoOpen but the document still opens at the top. This is the macro as recorded:

    Sub AutoOpen()
    '
    ' AutoOpen Macro
    '    Application.GoBack
     End Sub

    I am using Word 2007 but am accessing Word 2003 documents and am saving them in their 2003 format when done. What do I have to do to make a macro run on open.

    Thanks.

    Viewing 0 reply threads
    Author
    Replies
    • #1130291

      Where have you placed this code? It should be in a standard module in Normal.dot.
      As it is, the line Application.GoBack is commented out by the apostrophe ‘ at the beginning of the line. See if it works if you remove the apostrophe.

      There have been problems with GoBack in some versions of Word. See GoBack (Shift+F5) doesn’t work in some newly-opened documents for a description and work-around code.

      • #1130297

        Looking in VB, the macro is in Normal, Modules, NewMacros. I tried the code in the link but there was no change. And the line (Application.GoBack) isn’t commented in the actual macro. That was my error when posting here. This same macro works fine when I use Word 2003. I’ll keep researching.

        Thanks Hans.

        • #1130298

          There are reports that Application.GoBack doesn’t work in the new .docx format.

          You could try the suggestion by MVP Graham Mayor mentioned in Opening a saved document….

          • #1130305

            Well, I did try MVP Graham Mayor’s macros but still no change. This is probably all the time I want to spend on this as I am only evaluating a free trial that came with my PC. I figured why not try it – and I am pretty sure I won’t bother spending the money on Office 2007. First, I own 2003 already so no out of pocket expense. But more important the learning curve is a bit much. I can’t imagine a business switching to 2007 – productivity would go down the tubes. I’ll play with it a bit more before I uninstall to see if I change my mind. smile Thanks for your help Hans.

            • #1130307

              I can understand you don’t want to spend much time on it now, but have you made sure that macros are enabled? If the macro security setting is too strict, macros will be disabled without notification.

              In Word 2007, macro security can be set by selecting the Office button > Word Options > Trust Center > Trust Center Settings > Macro Settings.

            • #1130341

              Yes, the macro security is to disable with notification if it comes from an untrusted location. Interestingly enough, I noticed today that it now seems to be working – sporadically. Sometimes it goes back and sometimes not. I will watch it closely and see if I can figure out a pattern.

    Viewing 0 reply threads
    Reply To: AutoOpen Macro (Word 2007)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: