开发者

Word 2007 form fields unprotect document via VBA clears all fields but not in Word 2002 version

I have VBA code that prints a word document generated from a word template with form fields and then has to unprotect it to change the header and print the doc again. When I unprotect the doc 开发者_C百科to change the content of the header all form fields are cleared. But: When I use a Word 2002 doc that just got saved as the 2007 dotm format everything works fine.


Shame on me. It's so easy to fix that I should think about quitting my job as a developer - or don't work as long as in the last months every day :-)

Answer: Parameter NoReset has to be set to True

ActiveDocument.Protect NoReset=True
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜