Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Word Macro VBA

  • 17-08-2007 10:41AM
    #1
    Registered Users, Registered Users 2 Posts: 8,641 ✭✭✭


    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,053 ✭✭✭✭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