OLE IDispatch exception code 0: Buffer for return string is too sm

D

Diana

I am using Word 2003 in VFP9.0 to create a document with embedded variables.
The current method requires a repeated Selection() of the entire document.
I've apparently reached a threshhold of some sort, because on some large
documents I receive this error - although it does eventually complete the
document build if the user hits Ignore through the whole process, but ick!
What is the buffer limitation, and is there any way of setting the buffer
bigger? if so how?
 
Z

zkid

If the error is caused by the repeated use of Selection() (and most likely
all of the code that goes along with it), you could try just clearning the
Undo menu to releases some stack space. So, after each chunk of code (I'm
assuming it's a loop), insert ActiveDocument.UndoClear.
 
D

Diana

Thanks so much.
I'm sure that this would help, but unfortunately, this is not word.vba, it's
word.basic, and UndoClear is not a valid function. oh, Legacy Systems!!!
I believe I may be able to call a macro that will call the UndoClear, but
the syntax is giving me fits. Thanks for your input.
 
Z

zkid

I'm sorry, did you say you're using Word Basic within Word 2003 within Visual
Fox Pro? I'm very confused here. Did you know this is the VBA forum?

If the programming is on the Fox Pro side, a name that seems to pop up for
all things Fox Pro is Cindy Winegarden. She seems to really know her stuff.
Try posting your question in the following discussion group:
microsoft.public.sqlserver.connect. It looks like Cindy peruses it quite
often, and I'm sure she can put you on the correct track.
 
D

Diana

Thanks.
I'm programming in FoxPro using a CreateObject(Word.Basic) to manipulate
text in a Word 2003 document. The rest of the original Word application
works, but I run into this kind of problem trying to extend functionality.
I found this forum (Word Programming) while looking for Word Basic; I have
yet to find a forum that deals specifically with Word Basic, since it has
been superceded by vba - I am lucky that I found an old Word Basic Help
file. Microsoft would prefer that I re-write the word application using VB.

There are not many people who have experience in VFP calling Word, but I
will see if I can get Cindy Winegarten to pick up on a post.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top