Results 1 to 9 of 9
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    543
    Thanks
    56
    Thanked 0 Times in 0 Posts

    AutoNew not firing (WinXPP OXP)

    I have had some templates for some time and they have worked as required. Suddenly the AutoNew module is not firing when a template is opened from an embeded toolbar.
    cheers

    Phil Carter

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: AutoNew not firing (WinXPP OXP)

    Um, what's an embedded toolbar?

    If the template is embedded in a document using OLE (i.e., you see an icon of the template), then Auto macros may not fire. This has been documented in MSKB articles, and I don't think there's a workaround. (But I haven't searched recently.)

    Some Auto macros do not fire when Internet Explorer components are used in the launching of a document. So, if I recall correctly, Auto macros might not fire if you are using a hyperlink and the settings require that the document open in the Word application rather than the browser window.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    543
    Thanks
    56
    Thanked 0 Times in 0 Posts

    Re: AutoNew not firing (WinXPP OXP)

    Jefferson

    Sorry wrong terminology! I must have been thinking about my reports which have an attached toolbar!

    The templates concerned are individual eg letter, fax etc. I have designed them so a dialogue shows which allows the user to input address information for the template being used. The information is then inserted at bookmarks within the document.
    cheers

    Phil Carter

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: AutoNew not firing (WinXPP OXP)

    If the templates are opened either using (1) File>New from inside Word, or (2) double-click in Windows Explorer/My Computer, then the AutoNew macro should fire. Security settings could block an AutoNew macro from firing if the template is on a network drive, or if you have High security but don't trust installed add-ins and templates. Can you describe your set-up in more detail?

  5. #5
    4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    543
    Thanks
    56
    Thanked 0 Times in 0 Posts

    Re: AutoNew not firing (WinXPP OXP)

    The templates work just fine when, as you suggest, they are opened using File|New or double clicking in Explorer. They are all stored locally in Cocument and Settings All UsersTemplatesCompany Templates. To make them simpler for the users I decided to create a separate toolbar just for these templates. As I have stated they worked just fine but now seem to have got a bug and AutoNew won't fire.

    If I include an AutoOpen module with the document the dialogue box opens but, of course, it must be saved as a template.
    cheers

    Phil Carter

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: AutoNew not firing (WinXPP OXP)

    What is the macro behind the toolbar button, or is it a hyperlink? If it's a hyperlink, try using a macro instead:

    Sub NewFromTemplate1()
    Documents.Add Template:="cocument and Settings All UsersTemplatesCompany Templatestemplate1.dot"
    End Sub

    (This was thrown up from memory, so apologies for any syntax errors.)

  7. #7
    4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    543
    Thanks
    56
    Thanked 0 Times in 0 Posts

    Re: AutoNew not firing (WinXPP OXP)

    I had it linked directly to the AutoNew module which all that does is to fire the input form (frmDocument.Show).

    Tried putting your macro behind but couldn't get it to work.
    cheers

    Phil Carter

  8. #8
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: AutoNew not firing (WinXPP OXP)

    > Tried putting your macro behind but couldn't get it to work.

    Well... I need another clue. <img src=/S/grin.gif border=0 alt=grin width=15 height=15> Did it fail to create a new document, or did it create a new document that just sat there without running its AutoNew?

    What if you change my code to:

    <pre>Sub NewUsingFileOpenDialog()
    Const strPath As String = "cocuments and SettingsAll Users" & _
    "TemplatesCompany Templates"
    ChangeFileOpenDirectory strPath
    With Dialogs(wdDialogFileOpen)
    If .Display = -1 Then
    ' Not 100% confident it will find the correct path
    Documents.Add Template:=.Name
    End If
    End With
    End Sub</pre>

    Does that work better?

  9. #9
    4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    543
    Thanks
    56
    Thanked 0 Times in 0 Posts

    Re: AutoNew not firing (WinXPP OXP)

    Jefferson

    It failed to create a document just opened the template and sat there.

    Your revised code works a treat. Didn't solve the problem with AutoOpen not firing but gave me a very good work around that seems to satisfy the punters.

    Thanks Vmuch for your help on this.
    cheers

    Phil Carter

Posting Permissions

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