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 

How to Print MS Word Document from Delphi

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Prabhat
Guest





PostPosted: Wed Jun 22, 2005 2:28 pm    Post subject: How to Print MS Word Document from Delphi Reply with quote



Hi All,

In Delphi 5 :
How can I open a MS WORD Document (MS WORD should not be visible) and send /
print the document to Specific Printer? (not the default printer)

Thanks
Prabhat



Back to top
Prabhat
Guest





PostPosted: Wed Jun 22, 2005 3:39 pm    Post subject: Re: How to Print MS Word Document from Delphi Reply with quote



Hi,

The Question in More Detail:

I have opened one WORD Document from Delphi using "Word.Application". But
the WORD Application visible is FALSE.

1) How can I print the opened Document from Delphi using the Default
Printer?
2) How can I print the opened Document from Delphi using the User Given /
Selected Printer ?

Thanks
Prabhat


Back to top
Alfred ten Hoeve
Guest





PostPosted: Thu Jun 23, 2005 12:16 am    Post subject: Re: How to Print MS Word Document from Delphi Reply with quote



"Prabhat" <not_a_mail (AT) hotmail (DOT) com> schreef in bericht
news:42b986f4 (AT) newsgroups (DOT) borland.com...
Quote:
Hi,

The Question in More Detail:

I have opened one WORD Document from Delphi using "Word.Application". But
the WORD Application visible is FALSE.

1) How can I print the opened Document from Delphi using the Default
Printer?

No Word-oleobject needed
uses ShellApi;

procedure PrintMyDoc(DocName : string);
// be sure to give DocName the standard MicrosoftWord .doc extention.
begin
ShellExecute(Handle, 'print', PChar(DocName), nil, nil, SW_HIDE);
end;

Quote:
2) How can I print the opened Document from Delphi using the User Given /
Selected Printer ?

You can get the list of available printers using the Printers property from
the TPrinter Object.
Save the index of default printer; Set the new printer to default; use
ShellExecute; set the defautlt printer back.

Alfred.




Back to top
Prabhat
Guest





PostPosted: Thu Jun 23, 2005 12:57 pm    Post subject: Re: How to Print MS Word Document from Delphi Reply with quote

Hi Alfred,

Thanks for your reply.

Can U give small example for the Changing the default printer using the
TPrinter Object?

Thanks
Prabhat


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation 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.