Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Michigan, USA
    Posts
    408
    Thanks
    0
    Thanked 0 Times in 0 Posts

    AutoOpen Macro (Word 2007)

    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: <pre>Sub AutoOpen()
    '
    ' AutoOpen Macro
    ' Application.GoBack
    End Sub</pre>

    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.
    <font face="Comic Sans MS"><big><font color=4682b4>Sherry</font color=4682b4></big></font face=comic>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: AutoOpen Macro (Word 2007)

    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.

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Michigan, USA
    Posts
    408
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoOpen Macro (Word 2007)

    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.
    <font face="Comic Sans MS"><big><font color=4682b4>Sherry</font color=4682b4></big></font face=comic>

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: AutoOpen Macro (Word 2007)

    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....

  5. #5
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Michigan, USA
    Posts
    408
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoOpen Macro (Word 2007)

    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. <img src=/S/smile.gif border=0 alt=smile width=15 height=15> Thanks for your help Hans.
    <font face="Comic Sans MS"><big><font color=4682b4>Sherry</font color=4682b4></big></font face=comic>

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: AutoOpen Macro (Word 2007)

    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.

  7. #7
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Michigan, USA
    Posts
    408
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoOpen Macro (Word 2007)

    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.
    <font face="Comic Sans MS"><big><font color=4682b4>Sherry</font color=4682b4></big></font face=comic>

Posting Permissions

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