Hi,

I've got a problem with memory using MS Word..

Situation:
MS Office 2000 (fully updated)
Window w2k professional (fully updated)

I have a table on a SQL Server database.
In this table I put complete word documents as objects.

Now, I have a small vb script that copies the word object
and then pastes it in Word.
This works nice, but after a number of items, I get a
message: Not enough memory, If continuing you cannot
undo...
You can continue for a number of items, but after that
Word crashes..

I found a possible fix in the knowledge base concerning
too much edits, but this wasn't it.. I added a save
command, but I still got the problem...

Did anyone else have this problem???
Or maybe a solution??

Bye,
Sander

Re: Memory error filling a MS Word document from MS Access by JGM

JGM
Wed Dec 03 12:35:49 CST 2003

Hi Malcom,

I really do not mean to pick on details, but looking at your code a question
came to mind:

> With objWord.Application
> .ScreenUpdating = True
> .ScreenRefresh
> .ScreenUpdating = False
> End With

Does this means that when using this Sub, we have to inlcude a

Application.ScreenUpdating = True

line near the end of the module calling the PreventWordDeath sub?
Or does ScreenUpdating always revert to True by default when the code
finishes executing?

Thanks for helping me learn!
Cheers!

p.s. Still got a bloody finger?
p.p.s You have wolves in Wales? Weren't they all hunted down long ago? If
not, you have to admire their resilience (something to think about while
trying to sleep...)!
;-)

--
_______________________________________
Jean-Guy Marcil
jmarcil@sympatico.ca

"Malcolm Smith" <malcol.smith@droganqdrup.com> a écrit dans le message de
news: memo.20031203152719.8072A@mksmith.aits-uk.net...
> Sander
>
> This is a known problem in Word (and I am glad that I am not asked to
> reproduce it) however, I do have a fix:
>
>
> Private Sub PreventWordDeath(objWord As Word.Application, objDoc As
> Word.Document)
>
> On Error Resume Next
>
>
> objDoc.UndoClear
> objDoc.Repaginate
>
> objWord.Options.Pagination = False
> With objWord.Application
> .ScreenUpdating = True
> .ScreenRefresh
> .ScreenUpdating = False
> End With
>
> End Sub
>
>
> What you do is to call this routine with a pointer to Word and one to the
> Document and call it after each longish iteration. I use this after each
> table when I make my reports.
>
> Here's an example of something which I use daily:
> http://www.ukhorseracing.co.uk/selections/index.pdf
>
> Just to prove that this fault is fixable.
>
> Hope that this helps
> - Malc
> www.dragondrop.com



Re: Memory error filling a MS Word document from MS Access by Cindy

Cindy
Thu Dec 04 04:46:42 CST 2003

Hi Jgm,

> Or does ScreenUpdating always revert to True by default when the code
> finishes executing?
>
Yes, unlike Excel!

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)


Re: Memory error filling a MS Word document from MS Access by Sander

Sander
Thu Dec 04 05:46:05 CST 2003

Hi Malcolm,

This was the solution for me!!!!
Thanks.. This saves me a few days.... :-)))

After adding your code it worked perfect...

Bye,
Sander


>-----Original Message-----
>Sander
>
>This is a known problem in Word (and I am glad that I am
not asked to
>reproduce it) however, I do have a fix:
>
>
>Private Sub PreventWordDeath(objWord As
Word.Application, objDoc As
>Word.Document)
>
> On Error Resume Next
>
>
> objDoc.UndoClear
> objDoc.Repaginate
>
> objWord.Options.Pagination = False
> With objWord.Application
> .ScreenUpdating = True
> .ScreenRefresh
> .ScreenUpdating = False
> End With
>
>End Sub
>
>
>What you do is to call this routine with a pointer to
Word and one to the
>Document and call it after each longish iteration. I
use this after each
> table when I make my reports.
>
>Here's an example of something which I use daily:
>http://www.ukhorseracing.co.uk/selections/index.pdf
>
>Just to prove that this fault is fixable.
>
>Hope that this helps
> - Malc
> www.dragondrop.com
>.
>

Re: Memory error filling a MS Word document from MS Access by JGM

JGM
Thu Dec 04 10:28:46 CST 2003

Hi Cindy,

Are you telling me that 2 softwares that are part of a single package, that
are designed to work together, that are closely inter-related, etc. etc. are
released by a large company in such a way that the said softwares have
behaviours that are different on such a simple issue?

Unbelievable!

Thanks for the heads-up!
--
_______________________________________
Jean-Guy Marcil
jmarcil@sympatico.ca

"Cindy M -WordMVP-" <C.Meister-C@hispeed.ch> a écrit dans le message de
news: VA.00008d7a.0038d272@speedy...
> Hi Jgm,
>
> > Or does ScreenUpdating always revert to True by default when the code
> > finishes executing?
> >
> Yes, unlike Excel!
>
> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
> http://www.mvps.org/word
>
> This reply is posted in the Newsgroup; please post any follow question
> or reply in the newsgroup and not by e-mail :-)
>



Re: Memory error filling a MS Word document from MS Access by Cindy

Cindy
Fri Dec 05 08:52:22 CST 2003

Hi Jgm,

> Are you telling me that 2 softwares that are part of a single package, that
> are designed to work together, that are closely inter-related, etc. etc. are
> released by a large company in such a way that the said softwares have
> behaviours that are different on such a simple issue?
>
> Unbelievable!
>
Well... they started out as completely separate packages, back in the late
eighties. Their own development teams, totally different philosophies (one is
a spreadsheet and the other a word processor, after all)...

Only in 1993 or so did Microsoft's *marketing* come up with the "Office suite"
concept as a way to sell the entire spectrum of what a typical desktop should
need. And the purpose was to edge out the excellent stand-alone apps such as
Lotus 1-2-3 and WordPerfect (from two different companies). No thought was
given, at the time, to any kind of "standard" functionality or developer
interface.

Compared to what we had then, and what we have now, things have decidedly
improved (all the Office apps use VBA instead of a recorded macro, each with
its own language). But there are definitely things that Excel can do better
than Word, and vice versa. And also differing concepts for the same "term"
that can drive you practically nuts. This is one, how the two applications use
templates another.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)


Re: Memory error filling a MS Word document from MS Access by JGM

JGM
Fri Dec 05 09:40:36 CST 2003

Hi Cindy,

Thanks for taking the time to explain things...

Now, M$ does not seem as totally incompetent as I previously thought, just
lazy!

And I know what you mean about templates... The first time I tried building
a toolbar in Excel, and to associate it with an .xlt, the way we do it with
a .dot... what a mess! I could not get rid of the ?&%$&/"$?$ toolbar... it
was always there! I took me a while to figure that one out!

Cheers!
--
_______________________________________
Jean-Guy Marcil
jmarcil@sympatico.ca

"Cindy M -WordMVP-" <C.Meister-C@hispeed.ch> a écrit dans le message de
news: VA.00008d89.006f7c77@speedy...
> Hi Jgm,
>
> > Are you telling me that 2 softwares that are part of a single package,
that
> > are designed to work together, that are closely inter-related, etc. etc.
are
> > released by a large company in such a way that the said softwares have
> > behaviours that are different on such a simple issue?
> >
> > Unbelievable!
> >
> Well... they started out as completely separate packages, back in the late
> eighties. Their own development teams, totally different philosophies (one
is
> a spreadsheet and the other a word processor, after all)...
>
> Only in 1993 or so did Microsoft's *marketing* come up with the "Office
suite"
> concept as a way to sell the entire spectrum of what a typical desktop
should
> need. And the purpose was to edge out the excellent stand-alone apps such
as
> Lotus 1-2-3 and WordPerfect (from two different companies). No thought was
> given, at the time, to any kind of "standard" functionality or developer
> interface.
>
> Compared to what we had then, and what we have now, things have decidedly
> improved (all the Office apps use VBA instead of a recorded macro, each
with
> its own language). But there are definitely things that Excel can do
better
> than Word, and vice versa. And also differing concepts for the same "term"
> that can drive you practically nuts. This is one, how the two applications
use
> templates another.
>
> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
> http://www.mvps.org/word
>
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)
>



Re: Memory error filling a MS Word document from MS Access by Cindy

Cindy
Sat Dec 06 04:46:00 CST 2003

Hi Jgm,

> Now, M$ does not seem as totally incompetent as I previously thought, just
> lazy!
>
I'm not sure it's even that so much as $$$. Unlike the OpenOffice stuff,
there aren't a lot of officianados out there, distributing code out of the
goodnes off their hearts :-) I suppose we could argue if MS would lay open
the code, this would also happen for their products. OTOH, seems, these
days, that the ones distributing code for free that interacts with MS
products are more the other kind (viruses) <sigh> So I suspect that, even if
MS were to consider opening up their source code, there might be lots of
liability questions involved.

If MS had to re-design and re-code such extensive applications from scratch,
it wouldn't be cheap! The question would then become: could the sales
possibly ever cover these costs?

So, a little bit at a time, for the most obvious things (Open, Save, New
file interfaces, for example) is probably the best we can hope for :-)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)