#1
|
|||
|
|||
how to replace the Model property of a closed document
Hello,
Does anyone know how to replace the Model property of a closed document, without opening it, in order to end up with .AttachedTemplate=""? Many thanks in advance! Best regards , David |
#2
|
|||
|
|||
here's what I currently have, but maybe there's another way ?
Dim doc As Document Set doc = Documents.Open(fileName:=fileNamePath, Visible:=False) doc.AttachedTemplate = "" doc.Close SaveChanges:=True |
#3
|
||||
|
||||
That is the way I would be doing it. I don't believe you can modify the attached template setting without opening the file.
It may be possible to modify one of the xml files within the zipped docx file format but that is effectively 'opening' the file if you are going to save it anyway.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to recover the advanced properties of a closed document? | Ddadoo57 | Word VBA | 5 | 03-20-2023 01:46 PM |
Find and replace all the text flagged with the 'wdDeletedTextMarkStrikeThrough' property | alex100 | Word VBA | 4 | 08-31-2020 06:02 AM |
Extract Document Property and insert it into the same document, for many files in a folder | MisrIdley | Word VBA | 1 | 12-07-2017 12:41 PM |
Vba code to save document as pdf using document property text and rename folder. | staicumihai | Word VBA | 1 | 12-21-2015 07:39 AM |
How to save a macro in a document generated with a word model? | Cristin7 | Word VBA | 4 | 03-25-2014 03:25 AM |