Field.DoClick method (Word)

Clicks the specified field.

Syntax

expression. DoClick

expression Required. A variable that represents a 'Field' object.

Remarks

If the field is a GOTOBUTTON field, this method moves the insertion point to the specified location or selects the specified bookmark. If the field is a MACROBUTTON field, this method runs the specified macro. If the field is a HYPERLINK field, this method jumps to the target location.

Example

If the first field in the selection is a GOTOBUTTON field, this example clicks it (the insertion point is moved to the specified location, or the specified bookmark is selected).

Dim fldTemp 
 
Set fldTemp = Selection.Fields(1) 
If fldTemp.Type = wdFieldGoToButton Then fldTemp.DoClick

See also

Field Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.