Results 1 to 2 of 2

Thread: MS Word and CommandBar [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member Bombdrop's Avatar
    Join Date
    Apr 2001
    Location
    St Helens, England, UK
    Posts
    667

    Smile MS Word and CommandBar [RESOLVED]

    Hi all need some help over here. I am placing a Cobmbox in the standard command bar in MS Word, I want to know how i can detect if the value in the combo has changed.

    I have wrote the followig to fill the combo put how can i detect if the value has changed

    VB Code:
    1. Dim conTelList  As ADODB.Connection
    2. Dim recNames    As ADODB.Recordset
    3.  
    4. Set conTelList = New ADODB.Connection
    5.  
    6. conTelList.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\Lvp-web\published\websites\Ganda intranet\_databases\phone_internal2000.mdb;Persist Security Info=False"
    7. Set recNames = New ADODB.Recordset
    8. recNames.Open "plist1partner", conTelList
    9.  
    10.  
    11.  
    12. Dim objToolbar As CommandBar
    13.  
    14. Dim btnItem2 As CommandBarComboBox
    15.  
    16. Set objToolbar = CommandBars("standard")
    17.  
    18.  
    19. Set btnItem2 = objToolbar.Controls.Add(Type:=msoControlComboBox, _
    20.     Temporary:=True)
    21.    
    22. With btnItem2
    23.     Do While Not recNames.EOF
    24.         .AddItem recNames(1)
    25.         recNames.MoveNext
    26.     Loop
    27.     btnItem2.ToolTipText = "Names"
    28.  
    29. End With

    Thanks!!!!

  2. #2

    Thread Starter
    Fanatic Member Bombdrop's Avatar
    Join Date
    Apr 2001
    Location
    St Helens, England, UK
    Posts
    667
    Found out how to do it

    VB Code:
    1. btnItem2.OnAction = "MySub"



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