Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Oct 2007
    Thanked 2 Times in 1 Post

    Addins - AutoNew (2003)

    Since you've been so good with answers before, here's another question [img]/forums/images/smilies/smile.gif[/img]

    I have some macros in an "Addin". I have a template file which automatically adds the add-in in the AutoNew and AutoOpen functions. This means that the add-in, including a toolbar, is available to anyone who creates a document based on the template (assuming they have both the add-in and the template installed, which they will..).

    No, once i've added the addin to the template/document based on the template in the AutoNew, i actually want to display one of the forms that is contained in the add-in. So in the template file it would look something like:

    Sub AutoNew()

    Call AddMacros ()

    End Sub

    Where MyForm is contained within the add-in. Obviously this doesn't work, because "MyForm" is not in scope. Is there any way I can get the form to display automatically when a new document is created based on a template, which includes the addin where the form is defined?

    At the moment, the user has to click the toolbar button to get the form to display, but i'd rather do it automatically.


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Addins - AutoNew (2003)

    Create a macro in a module in the add-in itself that displays the form:

    Sub ShowMyForm()
    End Sub

    You can execute this from another document as follows:

    Application.Run "ShowMyForm"

Posting Permissions

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