![]() Hope this helps, Doug Robbins - MVP Office Apps & Services (Word). In the File>Options>Advanced dialog, uncheck the box before 'Use CTRL + Click to follow hyperlink'. When disabled, the code above may generate the run-time error '6068', "Programmatic Access to Visual Basic Project is not trusted. Is there a programmatic way of turning the Ctrl+Click into just Click (either in Web view or Page Layout view like it does in Full Screen View) Dax. When you click the CommandButton control, the Click event of the control fires.Īdditional notes for Word 2002 and Word 2003īy default, access to a Word VBA project is disabled. Once the macro "Test" finishes running, you will see a new CommandButton control on a new document. " MsgBox ""You Clicked the CommandButton""" & vbCrLf & _ĭoc.VBProject.VBComponents("ThisDocument").CodeModule.AddFromString sCode SCode = "Private Sub " & & "_Click()" & vbCrLf & _ '**Note: The click event resides in the This Document module ![]() 'Add a procedure for the click event of the inlineshape Set shp = (ClassType:="Forms.CommandButton.1") Insert a new module, and then add the following code example. Select the reference for Microsoft Visual Basic for Applications Extensibility. Press Alt+F11 to go to the Visual Basic Editor. The ability to manipulate the Visual Basic Project of a Microsoft Office document at run-time requires a reference to the Microsoft Visual Basic for Applications Extensibility library.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |