R
Roman Benko
I am working with Word 2007 and Visual Studio 2008
In Excel I can add a label to the active worksheet and assign code to run if
the user clicks on the label (see below). I can use similar code to add a
label to a Word document, but I can't see how to add code to run if the user
clicks on the label. There is no OnAction property to set. Can someone
explain how to add a code handler if the user clicks on a label in a Word
document? Thanks.
'EXCEL:
Dim label As Microsoft.Office.Interop.Excel.Shape
label =
Globals.ThisWorkbook.ActiveSheet.Shapes.AddLabel(msoTextOrientationHorizontal, 30, 30, 140, 15)
label.OnAction = "myLabelClickCode"
'WORD:
Dim label As Microsoft.Office.Interop.Word.Shape
label = Globals.ThisDocument.Shapes.AddLabel(msoTextOrientationHorizontal,
10, 10, 30, 15)
'there is no label.OnAction property available to set.
In Excel I can add a label to the active worksheet and assign code to run if
the user clicks on the label (see below). I can use similar code to add a
label to a Word document, but I can't see how to add code to run if the user
clicks on the label. There is no OnAction property to set. Can someone
explain how to add a code handler if the user clicks on a label in a Word
document? Thanks.
'EXCEL:
Dim label As Microsoft.Office.Interop.Excel.Shape
label =
Globals.ThisWorkbook.ActiveSheet.Shapes.AddLabel(msoTextOrientationHorizontal, 30, 30, 140, 15)
label.OnAction = "myLabelClickCode"
'WORD:
Dim label As Microsoft.Office.Interop.Word.Shape
label = Globals.ThisDocument.Shapes.AddLabel(msoTextOrientationHorizontal,
10, 10, 30, 15)
'there is no label.OnAction property available to set.