Is it possible to add a click event to a Word label?

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.
 
D

Doug Robbins - Word MVP

Use a MacroButton field (Insert>Text>Quick Parts>Field)

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top