![]() |
|
|||||||
|
|
|
Thread Tools | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Firstly, you can import styles from attached template more simply
Code:
ActiveDocument.UpdateStyles 'Imports styles from the attached template
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
#2
|
|||
|
|||
|
Thanks for the tip on updating the styles with the single command! My journey into macros started with recording them (like a lot of others I'm sure) and that's what it records when you do the manual procedure and I never looked into anything more efficient.
I have a fairly complicated setup which tries to deal with all sorts of eventualities and they're all to do with SharePoint and how it tries its best to mess with templates and styles. The master "refresh" macro lives in a separate template that people have on their own computers (in the Word startup folder) and is tasked with first linking the correct template. The document templates all have their own macro which does the actual refreshing, as there's no one size fits all process for the refreshing (sometimes the document has custom numbering which we don't want to reset with a refresh, or sometimes some substitution needs to be done with SharePoint paths as the synced folder name and the URL don't match if someone renames the site). That's called by the master macro. Your simple solution will work most of the time, however there's a few instances where the document is linked to a template with a valid update macro, but I want to change it to a different one. I think this would have to involve using my method, which is where the issue becomes relevant again. |
|
| Tags |
| attachedtemplate, debugging |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| In a macro to clean up language, what functions do "ClearFormatting" and "Replacement" serve? | ctviggen | Word VBA | 2 | 12-04-2023 10:06 AM |
| Modifying a Macro that Splits Word Docs by Heading to Skip Some Headings ("Bibliographies") | learnerlamp | Word VBA | 0 | 10-18-2023 01:20 PM |
| Excel 2003: VBA "Function" causes "#VALUE!" errors after running "insert/delete row" custom macro | Matt C | Excel Programming | 2 | 01-08-2022 06:03 AM |
How do you use the "seq" command to start a list at "2" (not "1")?
|
techwriter3k | Word | 4 | 05-22-2020 07:59 AM |
| remove repeated words with " macro " or " wild cards " in texts with parentheses and commas | jocke321 | Word VBA | 2 | 12-10-2014 11:27 AM |