Link to home
Start Free TrialLog in
Avatar of RBertora
RBertoraFlag for United Kingdom of Great Britain and Northern Ireland

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(LoadFileName);
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)





ASKER CERTIFIED SOLUTION
Avatar of florisb
florisb

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RBertora

ASKER

OriginalDocumentFormat;
is not declared..
Rob ;-)
Avatar of florisb
florisb

{ 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(Background, Append, Range, OutputFileName, From, To_, Item, Copies, Pages, PageType, PrintToFile, Collate, FileName, ActivePrinterMacGX, ManualDuplexPrint);


:-)


Greetings,
Floris.
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 ;-)
Thanks for the points...:-)

And good luck,
Floris
Pleasure,
g'luck to you too
:-)