RBertora
asked on
Word 2000 COM Close Document
Hi,
I have a stable application for word97.
Recently the company changed to word2000. And a specific pain has crept into my application:
WordApp.Documents.Open(Loa dFileName) ;
cool no problems
WordApp.Documents.Item(0). Close(0);
Wordapp.quit;
here word2000 prompts this message:
"This file is in use by another application or user. \blahblah\Normal.dot"
How can I exit cleanly without having to go through this message?
Rob ;-)
P.S.
(I think this is vladika territory)
I have a stable application for word97.
Recently the company changed to word2000. And a specific pain has crept into my application:
WordApp.Documents.Open(Loa
cool no problems
WordApp.Documents.Item(0).
Wordapp.quit;
here word2000 prompts this message:
"This file is in use by another application or user. \blahblah\Normal.dot"
How can I exit cleanly without having to go through this message?
Rob ;-)
P.S.
(I think this is vladika territory)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
{ WdOriginalFormat }
wdWordDocument = 0;
wdOriginalDocumentFormat = 1;
wdPromptUser = 2;
So just use 1...
....I copy pasted these constants from the imported Word8 type library, but the code above works for Word 97 and 2000.
Good luck and I'm looking forward for some points... ..did you manage to print yet...?
(all vars Olevariants):
Background := True;
Append := False;
Range := wdPrintAllDocument;
PrintToFile := False;
OutputFileName := '';
From := '1';
To_ := '32767';
Item := wdPrintDocumentContent;
Copies := 1;
Pages := '';
PageType := wdPrintAllPages;
Collate := True;
FileName := '';
ActivePrinterMacGX := '';
ManualDuplexPrint := False;
GWord80.PrintOut(Backgroun d, Append, Range, OutputFileName, From, To_, Item, Copies, Pages, PageType, PrintToFile, Collate, FileName, ActivePrinterMacGX, ManualDuplexPrint);
:-)
Greetings,
Floris.
wdWordDocument = 0;
wdOriginalDocumentFormat = 1;
wdPromptUser = 2;
So just use 1...
....I copy pasted these constants from the imported Word8 type library, but the code above works for Word 97 and 2000.
Good luck and I'm looking forward for some points... ..did you manage to print yet...?
(all vars Olevariants):
Background := True;
Append := False;
Range := wdPrintAllDocument;
PrintToFile := False;
OutputFileName := '';
From := '1';
To_ := '32767';
Item := wdPrintDocumentContent;
Copies := 1;
Pages := '';
PageType := wdPrintAllPages;
Collate := True;
FileName := '';
ActivePrinterMacGX := '';
ManualDuplexPrint := False;
GWord80.PrintOut(Backgroun
:-)
Greetings,
Floris.
ASKER
Thanks very much!
I'm sure I could have figured it out but right now didn't have the time, and
this is exaclty why EE is here!
Rob ;-)
I'm sure I could have figured it out but right now didn't have the time, and
this is exaclty why EE is here!
Rob ;-)
Thanks for the points...:-)
And good luck,
Floris
And good luck,
Floris
ASKER
Pleasure,
g'luck to you too
:-)
g'luck to you too
:-)
ASKER
is not declared..
Rob ;-)