Welcome, Guest. Please Login or Register.
watchDirectory Support Forum watchDirectory Home Page
Contact us
Blog (deutscher Blog)
Download
Sep 3rd, 2010, 4:30am
News: Current version 4.6.2 (March 14, 2010)
 


Pages: 1
Can you print to anything but lpt1: (Read 1102 times)
jeloca
YaBB Newbies
*




Posts: 3
Can you print to anything but lpt1:
Oct 13th, 2005, 1:47am
 
The following bat file seems to run OK, but nothing is printed. I am in a command window and am executing "WORDPRINT.BAT C:\TEMP\TEST.DOC".
I do not have a printer on LPT1:.
I am running "NET USE LPT1: \\Computer_Name\Shared_Printer_Name" to redirect it before the bat file. Anyone have an idea on how to make this work?  Huh
 
WORDPRINT.BAT
===========
@echo off
set GDPDDE C:\temp\gdpDDE.EXE
SET TMPDIR=C:\TEMP
SET WORD_CMD="C:\Program Files\Microsoft Office 2003\OFFICE11\WINWORD.EXE"  
SET WORD_PARAM=/x /n  
SET WORD_SERVICE=WinWord
SET WORD_TOPIC=System
SET WORD_VERBS=[REM _DDE_Minimize][FileOpen("%1%")][t=IsDocumentDirty()][FilePrint 0][SetDocumentDirty t][DocClose]
SET DDEFILE="%TMPDIR%\%1_B%.DDE"
ECHO [dde]>%DDEFILE%
ECHO cmd=%WORD_CMD%>>%DDEFILE%
ECHO param=%WORD_PARAM%>>%DDEFILE%
ECHO service=%WORD_SERVICE%>>%DDEFILE%
ECHO topic=%WORD_TOPIC%>>%DDEFILE%
ECHO verbs=%WORD_VERBS%>>%DDEFILE%
"%GDPDDE%" %DDEFILE%
DEL %DDEFILE%
:QUIT
Back to top
 
 
  IP Logged
Gert
YaBB Moderator
*****




Posts: 1351
Re: Can you print to anything but lpt1:
Reply #1 - Oct 13th, 2005, 4:06am
 
I am not sure, can you try again with the normal DDE verbs:
 
SET WORD_VERBS=[FileOpen("%1%")][FilePrint 0][FileExit 2]
 
and make sure Word is not running before you start?
 
Gert
Back to top
 
 

Gert Rijs
gert (at) gdpsoftware (dot) com
Did you see our blog with tips & tricks?
http://watchdirftp.blogspot.com/
WWW   IP Logged
jeloca
YaBB Newbies
*




Posts: 3
Re: Can you print to anything but lpt1:
Reply #2 - Oct 14th, 2005, 1:14am
 
The script is now working - not sure what the problem was. It works with my WORD_VERBS and with your WORD_VERBS. There was a problem somehow where gdpDDE was set to D:\temp\gdpDDE (bad drive) and it would not reset inside the script. It did a "SET" manually and it works now.
 
My only issues now are (1) that it will only print to my default printer (local or network), (2) Word does not run minimized and (3) Word does not close.
 
Any ideas on how to set these?
Back to top
 
 
  IP Logged
Gert
YaBB Moderator
*****




Posts: 1351
Re: Can you print to anything but lpt1:
Reply #3 - Oct 14th, 2005, 5:02am
 
Quote from jeloca on Oct 14th, 2005, 1:14am:
The script is now working - not sure what the problem was. It works with my WORD_VERBS and with your WORD_VERBS. There was a problem somehow where gdpDDE was set to D:\temp\gdpDDE (bad drive) and it would not reset inside the script. It did a "SET" manually and it works now.

Strange, the SET statement in the script should have the same effect as your manual SET.
Quote from jeloca on Oct 14th, 2005, 1:14am:
(1) that it will only print to my default printer (local or network)

You can try to use the DefPrint utility to change the default printer inside the script.
Quote from jeloca on Oct 14th, 2005, 1:14am:
(2) Word does not run minimized and

I guess I need to change the gdpDDE program to handle that, I'll see what I can do in the next few days.
Quote from jeloca on Oct 14th, 2005, 1:14am:
(3) Word does not close.

 
With "my" word_verbs, [FileExit 2] should close word.
 
Gert
Any ideas on how to set these? [/quote]
Back to top
 
 

Gert Rijs
gert (at) gdpsoftware (dot) com
Did you see our blog with tips & tricks?
http://watchdirftp.blogspot.com/
WWW   IP Logged
jeloca
YaBB Newbies
*




Posts: 3
Re: Can you print to anything but lpt1:
Reply #4 - Oct 14th, 2005, 1:46pm
 
I have managed to close Word by adding [AppClose] to the Word Verbs.
 
I tried [AppHide], but I was unable to function when Word was hidden.
 
I will try today to set to printer using either the DefPrint or ActivePrinter - will let you know.
 
Thanks for all the help so far.  Smiley
Back to top
 
 
  IP Logged
Pages: 1