LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Word Automation - Print using a dialog box

First, I'm using LV 8.0.1 and MS Office 2003.
 
I'm generating a Word document using ActiveX automation, and I have a Word_Print VI, which is shown below.  It works fine, however I don't want the user to see the Word application window.  They should not be allowed to edit this document.  I can simply set Show Dialog to false and it will just run the Execute method, but that will use whatever printer is selected, I want the user to be able to choose.  If the Word window is not visible, as soon as you click a button on the dialog box, it becomes visible.
 
Is there any way to show a Word dialog while keeping the application window hidden?
 

Message Edited by Marc A on 09-15-2006 10:15 AM

0 Kudos
Message 1 of 5
(3,250 Views)

Hi Marc A,

Have you try to use the ""WindowState" Property from the Word._Application reference?

Tania Lozoya

0 Kudos
Message 2 of 5
(3,228 Views)
I tried that as well.  If I start Word with the window hidden and set WindowState to minimized, it will still bring it up when I close the dialog box.  Right now I made it so the document is saved and locked, that way the user can't edit it when it's shown.  Although I would still like to keep it completely in the background.  Thanks for the idea though.
0 Kudos
Message 3 of 5
(3,208 Views)

Have you tried Application.ScreenUpdating = False ?

I use it to prevent Excel from updating the screen while creating a document for the user to preview.

Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.1, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 4 of 5
(3,200 Views)
Hm, I didn't see that property before.  It didn't work though.  I set it to false before I called the print dialog, but it still showed up when I closed the dialog.  I've looked through all of these properties, maybe I missed another one that could do what I need.  Thanks for the input so far.
0 Kudos
Message 5 of 5
(3,194 Views)