I'm running Word 365 and have a need to add a couple of inline command buttons to a document. This is rather like adding a command button to a worksheet in Excel, except that the target is a Word Document not a spreadsheet.
I have some 'sample' code that I am starting with (copied from a MS SUpport posting):
The sub zTestAddInlineButton allows me to execute the AddInLineButton sub without having to provide a parameter.
Everything goes (fairly) well, except that the button gets added in the same place every time. If I move to a different place in the document and run the macro again, it still ends up in the same place (which happens to be the start of the document).
Obviously (?) there are aspects to adding an OLEControl to the InLineShapes collection that are not being addressed. The properties of an InLineShape include a Range - which should allow me to specify a location. The question then becomes - how do I determine where the cursor is - so I can use those values for the InLineShape.Range?
This may well be an extended conversation, as most of my experience is with Excel VBA.
All help and most suggestions appreciated!
Tony
Bookmarks