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 2007

Tip: Looking for answers? Try searching our database.

UndoClear doesn't?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ken - 15 Aug 2007 17:44 GMT
I've noticed that a particular tmp file increases in size every time I edit
any of my styles in a Word document.  It happens whether I make the changes
manually or using a macro, and the the UndoClear method doesn't seem to have
any effect.  It's a problem because if I run a macro that does a LOT of
editing, the tmp file eventually gets so big that the macro no longer runs (I
get a messaging saying the command can't be executed because there's a memory
or disk problem).

The tmp file in question is in c:\Documents and Settings\[me]\Local
Settings\Temp and is always called ~WRS####.tmp (#### is a number that
changes every time I restart Word).

Track changes is off.

Any ideas on how to prevent Word from keeping track of all these changes so
the tmp file doesn't expand until it crashes?  The only way I've found to
eliminate the problem is to close Word and restart it, which deletes the tmp
file and starts the process all over again.

I posted about this earlier today but after doing some investigating I've
narrowed down the problem so I'm posting this separate thread that's more
specific.  Thanks for being understanding!
Helmut Weber - 15 Aug 2007 20:22 GMT
Hi Ken,

about the UndoClear-method,
I think, as Word was originally designed IMHO as an
ordinary office-application for small documents,
UndoClear may not clear anything but only set a flag
for, lets say, "disregard" something,
trading speed for slow reliability.

There was once an unknown barrier of complexity,
which Word just couldn't handle anymore.
Maybe it is still there.

I'd try to split up all that editing in single steps.
SaveAs doc-000.doc.
Do Step 1
SaveAs doc-001.doc.
Do step 2
SaveAS doc-002.doc.

Sure, slow and not that easy.

To the best of my knowledge.

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

Jay Freedman - 15 Aug 2007 20:53 GMT
What I can add to Helmut's suggestion isn't from real knowledge but
guesswork based on little clues.

According to http://support.microsoft.com/?kbid=211632, a temp file that
starts with ~WRS is a "scratch file". Its description is:

~~~~
When Word runs out of internal random access memory (RAM), it always creates
a single temporary scratch file in the Temp directory to hold information.
This scratch file holds information that is swapped out from the Word
internal file cache, which is allocated from global system memory. The
scratch file varies in size from 64 kilobytes (KB) to 3.5 megabytes (MB).
~~~~

This is where the guesswork comes in: Although it's true that the Undo
buffer is internal to Word, I don't know whether it's part of the internal
file cache that overflows into the scratch file. I also don't know whether
Word has code to shrink the scratch file when the overflow is reduced, or
whether it only grows until the document is closed and the temp file is
discarded.

If Helmut's suggestion of periodically saving the document doesn't help,
then try periodically closing and reopening the document. I'd also be
looking hard at the macro to see whether the amount of editing it does can
be reduced. For example, if you're deleting a group of adjacent paragraphs,
try not to delete them one at a time.

Signature

Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> I've noticed that a particular tmp file increases in size every time
> I edit any of my styles in a Word document.  It happens whether I
[quoted text clipped - 18 lines]
> I've narrowed down the problem so I'm posting this separate thread
> that's more specific.  Thanks for being understanding!
Ken - 17 Aug 2007 02:19 GMT
Thanks Helmut and Jay.  I'm going to have to rewrite the macro a bit but a
lot of the editing is unavoidable, so I'll also have to figure out a way to
calculate/guess when that temp file is getting out of hand (400-500mb seems
to be the point where Word gives up) and warn the user to restart Word.
Closing and opening the document doesn't affect that temp file, only closing
Word properly.  I've noticed that those  WRS files don't get deleted if Word
crashes, but they don't seem to have any effect on subsequent Word sessions
(might be wrong on that).

> What I can add to Helmut's suggestion isn't from real knowledge but
> guesswork based on little clues.
[quoted text clipped - 45 lines]
> > I've narrowed down the problem so I'm posting this separate thread
> > that's more specific.  Thanks for being understanding!
Jay Freedman - 17 Aug 2007 14:32 GMT
Cleaning up after crashes may help to prevent future crashes...
http://www.gmayor.com/what_to_do_when_word_crashes.htm

Signature

Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> Thanks Helmut and Jay.  I'm going to have to rewrite the macro a bit
> but a lot of the editing is unavoidable, so I'll also have to figure
[quoted text clipped - 63 lines]
>>> I've narrowed down the problem so I'm posting this separate thread
>>> that's more specific.  Thanks for being understanding!
Ken - 18 Aug 2007 11:46 GMT
Turns out that temp file bloat is a bug that MS identified in Word 97 (!!)
and hasn't fixed.  Here's a link to the KB article:

WD97: Creating Large Numbers of Styles Creates Huge Scratch File
http://support.microsoft.com/kb/168805/en-us

Their solution is to restart Word.  That's the only way I've found to get
past it.  Clearing out other temp files has no effect.

I'm not creating large numbers of styles but I'm working with styles a lot.  
Every time I access a style property the temp file grows, and if I access a
lot of properties the file grows a lot which eventually stops Word from
working properly.

Argh.

They've confirmed that it's a problem and are researching it.  Since 1997.  
It would be nice if they'd fix things like this as a bit more of a priority
than rearranging menus and designing pretty ribbon bars.

Now I've got to figure out a way to track that scratch file and notify the
user before it gets too big.

> Cleaning up after crashes may help to prevent future crashes...
> http://www.gmayor.com/what_to_do_when_word_crashes.htm
[quoted text clipped - 66 lines]
> >>> I've narrowed down the problem so I'm posting this separate thread
> >>> that's more specific.  Thanks for being understanding!
 
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.