Hi Jamal,
1. The procedure for adding the code to a particular document, instead of to the Normal template, is exactly the same. However, every reference to 'ActiveDocument' should be changed to 'ThisDocument'.
2 & 3. That is correct.
4. You can store the code in doc or docm files, not in docx files
5. Your comment is contradictory:
Quote:
It is working very well when the document is saved but unfortunately it doesn’t work when it is saved, saved as or printed
|
Does it work when saving, or does it not? AFAIK, the 'wdApp_DocumentBeforeSave' module, if correctly implemented in a Class Module, should work for both 'Save' and 'Save As' procedures.
As I am travelling, I am not in a position to review this matter more fully right now.