

Are these bookmarks or text box items on a user form? More to the point what sort of data will they contain? The MVP recommendation adds nothing but confusion and, ultimately, badly written code which is going to be murder to debug or maintain in the future. With the recommendation on the MVP site there is no way to know what 'Text1' and 'Text2' refer to. Compare and contrast with the advice on the MVP site which says " Create two bookmarks in your template named “Text1” and “Text2”."

If one looks at the code and sees a reference to bookmark called 'bmkSubject' in a memo template is is obvious to the viewer that this bookmark handles the subject title of the document. In this example five bookmarks are placed onto the document these are named 'bmkTo', 'bmkFrom', 'bmkDate', 'bmkSubject' and 'bmkStartHere'. Since we are naming bookmarks we shall prefix 'bmk' to the bookmark names. One of the conventions of programming in VB or VBA is to prefix the variable or object name with a small lower case string to help remind the developer what the variable or object does.

One of the golden rules of programming is to make sure that the object and variable names reflect what the variable and object does. Note that the bookmark names have sensible names.
#How to create a bookmark in word template how to#
Word Code / Best Practices How To Create A Simple Template With A User Form Step ThreeĪdd bookmarks at the various points within template where the user is to insert data.
