[Solved] VBA : Beginner wit Word VBA

  • hi guys,


    i've been able to use vba on excel with pretty good results, however when i tried to program it on word, it seems that what i've learnt is not applicable.


    i cant event summon a simple userform or messages.


    do you guys know of any word-vba examples i can refer to ?


    thanks alot in advance


    cheers
    xlite:P

    Cheers
    ___________
    Xlite :sheep:
    [st]All you need to learn VBA is an internet connection and Ozgrid.com[/st]

  • oops, i was able to command a userform to appear after all,
    but still can't get it to appear when the document is being opened although i have it placed on ThisDocument (Open) mode


    anything i missed?


    and how come i can't apply a macro to a shape like it was on excel?


    cheers
    xlite:P

    Cheers
    ___________
    Xlite :sheep:
    [st]All you need to learn VBA is an internet connection and Ozgrid.com[/st]

  • Hi xlite,


    This worked for me.


    Private Sub Document_Open()
    UserForm1.Show
    End Sub


    Although I did have to set the security level to medium before it worked.


    Doesn't look as those autoshapes in Word have an OnAction property.
    The closest I can find is to Insert a fieldcode and use the MACROBUTTON setting.


    Have a look here for a example.
    http://word.mvps.org/FAQs/Tbls…s/InsertAdrsWMacroFld.htm


    Maybe there is more info on that site.


    Cheers
    Andy

    [h4]Cheers
    Andy
    [/h4]

  • hi Andy
    thanks a lot fo yr help


    feels like threading water all over again he he:P


    cheers
    xlite

    Cheers
    ___________
    Xlite :sheep:
    [st]All you need to learn VBA is an internet connection and Ozgrid.com[/st]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!