Button Onaction and combo box

wperry

New member
Joined
Mar 22, 2012
Messages
1
Programming Experience
Beginner
I am creating a new tab in word 2010 for custom templates
My xml file is working great and adds 5 buttons on the tab inserted after the info tab. Beside each button I have a combo box that has 9 items
can anyone tell me how I can make my button onAction event open a
OpenFileDialog() based on the cbo selection??
Here is the code I am trying

Sub OnAction(ByVal control As IRibbonControl)
Dim myStream As Stream = Nothing
Dim openFileDialog1 As New OpenFileDialog()

If "cbo01" = "item01" Then
openFileDialog1.InitialDirectory = \\xxxxxxxxxxx
ElseIf "cbo1" = "item02" Then
openFileDialog1.InitialDirectory = \\xxxxxxxx
ElseIf "cbo1" = "item03" Then
openFileDialog1.InitialDirectory = \\xxxxxx
ElseIf "cbo1" = "item04" Then
openFileDialog1.InitialDirectory = \\xxxxxxx
ElseIf "cbo1" = "item05" Then
openFileDialog1.InitialDirectory = \\xxxxxxxxx
ElseIf "cbo1" = "item06" Then
openFileDialog1.InitialDirectory = \\xxxxxxxxx
ElseIf "cbo1" = "item07" Then
openFileDialog1.InitialDirectory = \\xxxxxxxxx
ElseIf "cbo1" = "item08" Then
openFileDialog1.InitialDirectory = \\xxxxxxxx
ElseIf "cbo1" = "item09" Then
openFileDialog1.InitialDirectory = \\xxxxxxxx

End If
openFileDialog1.ShowDialog()
End Sub
 
Back
Top