Greetings all.
To begin, a warning: Though I have dabbled a (very) little with Excel macros but am I am completely new to word macros.
I have spent a long time developing a new work template in Word (2016) which includes a number of custom building blocks (in the QuickParts gallery). What I would like is for when a new document is created with this template for the user to be presented with a simple userform that offers a selection of some of these building blocks (say "BB01" and "BB02") and to insert whichever one is selected. So far I have managed to:
- Create and test a simple macro which, if run manually, then inserts a predetermined building block (i.e. the name of the building block is hard-coded into the macro)
- Create a simple userform with just three elements: a ComboBox, an "OK" command button and a "Cancel" command Button. The ComboBox currently offers a choice of two options and these are currently hard-coded into the userform and mirror the names of two of my building blocks). Clearly it would be more elegant for these choices to somehow generate automatically from the list of available building blocks (though I would only want a subset of these to show up), but for now I am happy to hard code them if that is easier.
The bit I am now struggling with is connecting the dots between the above two, i.e. for the first macro to insert the chosen building block from the userform rather than the hard-coded one.
I realise this is probably a very ambitious ask given my complete lack of VBA knowledge, but any pointers would be much appreciated. If my plea does prick your interest and you feel inclined to help, please explain things to me as if I were a five year old...
Many thanks.
Bookmarks