![]() |
|
#20
|
||||
|
||||
|
OK, this line is probably erroring because it doesn't have a document path or the named file doesn't exist in that document path.
Why might a document not have a document path? If you double click on a template (dotx or dotm file), Word creates a brand new document which hasn't yet been saved - and therefore it doesn't have a folder path. If you hover over ThisDocument.Path, does it show a valid path? If it does, look in that folder to verify the named file exists there (the Message Cover file) Generally, I would recommend that you put the two templates in a folder that the users can access - you don't need a docm file if you put the code inside a dotm template. If they create a new docx file by double clicking the dotm file then when they save the document, the template path will be saved as the 'Attached Template' so they will still have access to the macros and the Building Blocks. Your code could then make use of the template location for the email cover by either using ThisDocument.Path (the file the code is running from) or ActiveDocument.AttachedTemplate.Path (the path where the attached template is saved).
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Check Boxes Not Displayed via MailMerge CheckBox Insertion code
|
JennEx | Mail Merge | 2 | 05-28-2019 05:55 PM |
One Content Control Checkbox checks another Content Control Checkbox
|
DEsh | Word VBA | 2 | 10-06-2017 08:23 PM |
| Copy ActiveX-Checkbox with code | DanielM125 | Word VBA | 0 | 06-04-2015 12:49 AM |
Uncheck Checkbox Code not working if document protected
|
bandrist | Word VBA | 2 | 08-14-2013 09:02 AM |
| Excel ->VB code for Checkbox (control toolbox) | kirkstyle | Excel | 0 | 08-16-2006 04:17 PM |