Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Word Macro VBA

Options
  • 17-08-2007 10:41am
    #1
    Registered Users Posts: 7,678 ✭✭✭


    I am trying to write a macro that will load a form.

    I can figure out how to populate text and show the vb editor but not display a form when a button is pressed on the toolbar.

    Can anyone help please
    
    Sub displayText()
    '
    ' displayTextMacro
    ' Macro recorded 17/08/2007 by Trampas'
        Selection.TypeText Text:="Hello"
    
    End Sub
    
    
    Sub displayVBEd()
    '
    ' displayVBEdMacro
    ' Macro recorded 17/08/2007 by Trampas''
        ShowVisualBasicEditor = True
    
    End Sub
    
    

    The template can't be in the Normal.dot but can be referenced from it.

    Can someone direct me in the right direction please.

    Thanks
    Gareth


Comments

  • Closed Accounts Posts: 18,056 ✭✭✭✭BostonB


    Its bad practise to use the normal.dot. Create a new template.dot and write it in that. In the VB editor add a new module to this template to write your code in. You have to create a userform and then write some code to load it.
    TrampasForm.Show


Advertisement