Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2005

Tip: Looking for answers? Try searching our database.

performance when copying multiple styles over many documents

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jay - 20 Aug 2005 00:32 GMT
I have created macros to rebuild documents which are all created from
similar templates. As part of standardising them, I copy styles from a
template into each document.
When processing a directory full of files (20 to 60 or more files) I
see that the longest part of the operation is the styles copy.
Right now I am copying the styles without attaching the styles
template.
Does attaching a template as below (from another thread in this forum)
with UpdateStylesOnOpen=true serve to copy styles, or only copy
attributes of shared styles?

   With ActiveDocument
       .UpdateStylesOnOpen = True
       .AttachedTemplate = sTemplatesPath & sTemplateName
       .UpdateStylesOnOpen = False
       .AttachedTemplate = sTemplatesPath & sTemplateName
   End With

Is Word trying to update the document after each style copy?
Can I keep it from doing that, until all styles are copied?

I'd rather keep the docs standalone rather than depending on an
external template.

Thanks
Jay
Cindy M  -WordMVP- - 21 Aug 2005 08:44 GMT
Hi Jay,

I've never investigated this in any depth, but...

If you attach a template, then update the styles, there's no guarantee
that you'll get the results you expect. This is especially the case with
table and numbering styles, especially anything to do with numbering.
For this, the Organizer method is more reliable.

If speed is a problem, you might want to consider recreating the styles
in the documents with your code. Take you longer to code, but it should
run faster... You can probably speed up writing the code by recording a
small change to each style in a macro.

> I have created macros to rebuild documents which are all created from
> similar templates. As part of standardising them, I copy styles from a
[quoted text clipped - 19 lines]
> I'd rather keep the docs standalone rather than depending on an
> external template.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)
jay - 22 Aug 2005 17:18 GMT
Hi, Cindy
Thanks- that's an idea.
At this point, I'll probably just live with the performance slowness,
since the styles should only need to be copied over once per directory.
(and occasionally, depending on who works on the docs?)

Most of my code has come from the MVP site or these forums- thanks
again to all you MVPs!

Regards
Jay
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.