khbh
asked on
Problems creating a Word.Basic object, when Word is loaded
Hi!
I've made an Access 2.0 application that generates a Word document. In Access 2.0 it didn't matter whether Word was loaded or not, but in Access97 it does. I have this code:
Dim WordObj As Object
Set WordObj = CreateObject("Word.Basic")
When generating the Word document (up to 100 pages), in Access97, I get a message after a while that the object is too complex and that I should make a full save. This wasn't a problem in Access 2.0.
What should I do?
Putting in statements as "WordObj.FileSave" isn't a good solution as it is very time consuming and it isn't suitable in my application.
Another problem with Word.Basic-objects is that I can't make Word97 jump to a bookmark the way I could in Word6.0.
With other words, the statement "WordObj.EditGoTo 'Final'" doesn't work the way it used to. In this case the bookmark 'Final' resides about 5 pages earlier than the current page the cursor is on, and the statement above just moves the cursor to the top of the current page, not to the bookmark 5 pages back.
/Henrik
I've made an Access 2.0 application that generates a Word document. In Access 2.0 it didn't matter whether Word was loaded or not, but in Access97 it does. I have this code:
Dim WordObj As Object
Set WordObj = CreateObject("Word.Basic")
When generating the Word document (up to 100 pages), in Access97, I get a message after a while that the object is too complex and that I should make a full save. This wasn't a problem in Access 2.0.
What should I do?
Putting in statements as "WordObj.FileSave" isn't a good solution as it is very time consuming and it isn't suitable in my application.
Another problem with Word.Basic-objects is that I can't make Word97 jump to a bookmark the way I could in Word6.0.
With other words, the statement "WordObj.EditGoTo 'Final'" doesn't work the way it used to. In this case the bookmark 'Final' resides about 5 pages earlier than the current page the cursor is on, and the statement above just moves the cursor to the top of the current page, not to the bookmark 5 pages back.
/Henrik
You may try dividing the document.
ASKER
Unfortunately it must be ONE document...
I mean first printing say 50 pages and then the rest.
ASKER
It must be saved in ONE document before printing it.
Another thing, there is no easy way of telling how often to put in statements like "WordObj.FileSave" to correct the problem, and to be sure that the error doesn't occur the statements must occur too often in the code, leading to time consuming actions.
Another thing, there is no easy way of telling how often to put in statements like "WordObj.FileSave" to correct the problem, and to be sure that the error doesn't occur the statements must occur too often in the code, leading to time consuming actions.
ASKER
Edited text of question
ASKER
Adjusted points to 125
ASKER
Adjusted points to 200
ASKER
Adjusted points to 300
Hello!
1. have you noticed that the syntax varies in some statements
in word95 version and a word6.0 version? word97 understands the word95 basic version.
2. if you are using a word97, why not refference a word8.0 object library instead of word.basic?
1. have you noticed that the syntax varies in some statements
in word95 version and a word6.0 version? word97 understands the word95 basic version.
2. if you are using a word97, why not refference a word8.0 object library instead of word.basic?
ASKER
Hi lina10!
1. I don't think that the syntax is the problem here, because I can compile the module.
2. How would I do that? What would the corresponding code for "WordObj.EditGoTo 'Final'" look like with a Word8.0 object. 'Final' is a bookmark in the document that I'm working on in Word.
1. I don't think that the syntax is the problem here, because I can compile the module.
2. How would I do that? What would the corresponding code for "WordObj.EditGoTo 'Final'" look like with a Word8.0 object. 'Final' is a bookmark in the document that I'm working on in Word.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.