Results 1 to 2 of 2

Thread: Ms-word Event

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Location
    India
    Posts
    15

    Ms-word Event

    i have problem realted to MS-WORD EVENT. SUPPOSE IF I CLICKS ON "BOLD TOOLBAR BUTTON". THIS BUTTON WORKS ACCORDING TO MY CODE.

    LIKE

    SUB BOLD()
    MSGBOX " bOLD"
    END SUB

    THIS CODE IS WORKING PERFECTLY,

    BUT DRAWING TOOLBAR BUTTONS, DOES NOT WORK EXCEPT TEXTBOX TOOLBAR BUTTON.

    ANY ONE HAVE ANY IDEA IN THIS REGARDING, I WOULD BE OBLIZED TO GET RESPONCE OF MY PROBLEM.

    -------------
    VISHI
    vb,

  2. #2
    New Member
    Join Date
    Nov 2002
    Location
    Sydney - Australia
    Posts
    14
    Do you want to create a toolbar and then add a button to it to run your code. If so, this is how you do it.

    Code:
    Dim newButton As CommandBarButton
    
    Application.CommandBars.Add(Name:="New ToolBar").Visible = True
    CommandBars("New ToolBar").Position = msoBarTop
    
    Set newButton = CommandBars("New ToolBar").Controls.Add(Type:=msoControlButton)
    With newButton
        .Caption = "BOLD TOOLBAR BUTTON"
        .OnAction = "BOLD"
        .Style = msoButtonCaption
    End With

Posting Permissions

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



Click Here to Expand Forum to Full Width