[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1365
  • Last Modified:

print word document from olecontainer

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
forger
Asked:
forger
  • 2
  • 2
1 Solution
 
mivCommented:
Have you tried: FOleWordContainer.OleObject.Application.ActiveDocument.PrintOut;

or is there a Printing property you can use ?
0
 
RBertoraCommented:
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
 
forgerAuthor Commented:
Rob : "I can do almost anything I want with word without making use of an ole container... " 

Can you elaborate on that?
0
 
RBertoraCommented:
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
 
mivCommented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now