BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delphi and MS Word

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
bodomalo@gmx.net
Guest





PostPosted: Tue Sep 06, 2005 9:27 am    Post subject: Delphi and MS Word Reply with quote



Hello

I have a delphi programm which fill's out some Word Documents and
print's them.

I use the TWordApplication and TWordDocument Objects like
the following way:

msword.connect;
msword.visible := False;
msword.Documents.OpenOld(file, EmptyParam, readonly, EmptyParam,
EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
EmptyParam);
doc.ConnectTo(msword.ActiveDocument);

.... Write something

doc.PrintOut;
doc.close(savechanges,Emptyparam,Emptyparam);
msword.Disconnect;


I have the following problems.

1) When Word has already been started before and a Document is opened,
then after that this Document is not accessible anymore. I have a plain
Word application with no Documents - BUT I can see this old Document in
the 'Window' menu of Word, it is greyed-out (not active/clickable).
When I exit Word it ask's me if I want to save this document.
Why Is it not possible to 'activate' it anymore?

2) When Word was not started before, then after the nsword.Disconnect
it is still active. It wont exit. Why? Even when I finish the
application Word is still active.

How can I solve these problems? What is the best solution?
Should I quit Word when starting?

Thanks
Bodo Malo

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.