Convert Word Template from MS Word 2003 to MS Word 2007
I have a problem moving a Word template from Word 2003 to Word 2007
The code I need to convert is
Sub Standardbrev()
Documents.Add Template:= _
"p:\setup\stdbrev.DOT", NewTemplate:= _
False
mask "<Navn>", False
mask "<Adresse>", False
mask "<Postby>", False
mask "<att>", True
mask "<Jura Nr>", False
mask "<Vedr>", False
mask "<Jurist>", False
End Sub
Edit, problems: When I try to copy / paste the code into a dotx document, I get a compile error:
No subfunction or function defined.
If I go outside the mask, I can run the macro and open the stdbrev.DOT file in a new window
Edit: what it does in 2003: When you run the macro, you will see 7 fields (1 for each mask) where you can fill in the information in them. Information replaces mask fields in the document
Hope this explains my problem.
Edit: I found a solution, I misunderstood some of the code and didn't know that the mask was a function written by someone else a long time ago. Sorry for posting this noobish question
a source to share
mask
is not a built-in function. This function must be defined somewhere in the module, and you must also copy this function into a Word 2007 document (which is why you get the "Sub or Function not defined." Error). You can see where this function is defined by right clicking on mask
and then selecting Definition.
However, the easiest way to "transfer" this would be to simply open a Word 2003 document in Office 2007 and then save it as a .dotm or .docm file (depending on whether you want to create a template or a regular document).
a source to share