Solved

print word document from olecontainer

Posted on 1997-08-17
5
1,296 Views
Last Modified: 2010-04-06
I need to print a winword document which is loaded in an olecontainer component (iconic := false). The command Print isn't supported whern iconic = false, so before printing i change iconic to True. then i send the command PRINT to the oleobject, and printing starts. The problem is that I need to go back right after the command PRINT is completted so i do OleContainer1.close which disactivate the WinWord server, but the print job is being spooling at that time and closing the server  stack the printing in spooling condition. what can i do to prevent that ? remember that i must use the close method because i want to change iconic back to False.
0
Comment
Question by:forger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 1

Expert Comment

by:miv
ID: 1341638
Have you tried: FOleWordContainer.OleObject.Application.ActiveDocument.PrintOut;

or is there a Printing property you can use ?
0
 
LVL 7

Expert Comment

by:RBertora
ID: 1341639
question: what are you trying to achieve and why
are you using the olecontainer...

I can do almost anything I want with word without
making use of an ole container...


Rob.

0
 

Author Comment

by:forger
ID: 1341640
Rob : "I can do almost anything I want with word without making use of an ole container... " 

Can you elaborate on that?
0
 
LVL 7

Expert Comment

by:RBertora
ID: 1341641
Am, well at the moment I am writing something
that will based on decision made in delphi code
generate a document, by writing in information
from Delphi,MSSQL database, generate graphs
in excell (using OLE) and import it into Word....

its very nice...

Cheers,
Rob.

0
 
LVL 1

Accepted Solution

by:
miv earned 200 total points
ID: 1341642
Forger: As RBertora writes, you don´t have to use an OleContainer.
Is there any problems doing like this:?

AVariant:=CreateOleObject('Word.Application');
AVariant.Application.ActiveDocument.PrintOut;
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

742 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question