WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> How to... >> Print Word DOC then move files/directory
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1349364773

Message started by El Credito on Oct 4th, 2012 at 5:32pm

Title: Print Word DOC then move files/directory
Post by El Credito on Oct 4th, 2012 at 5:32pm
Hello. I'm checking out the trial currently. I'm trying to implement a way for a remote transcriptionist to sync Word .docs to a system in my office and have them automatically print. After printing is complete I'd like to have these files moved to an archive directory. I've got the printing set up but am wondering if I need to write a simple .bat file to move these over or if the best idea would be have files of a certain age moved to the archive.
I'm wondering also if there is any way to print to a printer that is not the default printer.
Additionally is there a DDE wordparm that I may use to make Word run/print in the background almost as a service?
This is a wonderful program! Just need a little help perfectly implementing what I'm trying to do.

Thanks in advance!

Title: Re: Print Word DOC then move files/directory
Post by Gert on Oct 4th, 2012 at 5:54pm
Yes, File Age monitoring would do the trick (create a 2nd task).

However, if you know a little batch scripting you have complete control of the "Print Word" task. Just change the bat file started by WD.

This is explained for "Print PDF" in this blog, should be easy to do the same for "Print Word".
http://blog-en.gdpsoftware.com/2011/10/after-printing-pdf-i-want-to.html

Title: Re: Print Word DOC then move files/directory
Post by El Credito on Oct 4th, 2012 at 8:14pm
Thanks so much for your quick response. I've created the 2nd task and used file ages monitoring to move files and sub directories to my archive and it's working wonderfully. I don't have the knowledge to append to the bat file after printing is done unless I can add a simple move command to the end. Do you think that may work?
I know WD uses the default printer but is there any way to use scripting to force printing on a network printer? Also is there anyway to hide Word while it prints so this process doesn't disturb the user of the PC? If not I'll just set up a schedule for after-hour printing.

Thanks again!

Chris

Title: Re: Print Word DOC then move files/directory
Post by Dirk on Oct 5th, 2012 at 8:53am
Word 2010 should be able to print some kind of "silenty".
Take a look here:
http://www.christowles.com/2011/04/microsoft-word-printing-from-command.html

You need some macro-code like described in the link above to switch the printer inside Word and than use the "run any .bat file" plugin in WatchDirectoryto start Word with that makro.

Another tipp you can find here:
http://www.robvanderwoude.com/commandlineswitches.php#Word


I have not tested it, but maybe it helps.


To move your file after printing just add
MOVE /Y "%WDFILE%" c:\archive
at the end of your .bat file.

Title: Re: Print Word DOC then move files/directory
Post by El Credito on Oct 5th, 2012 at 8:29pm
Thanks again for helping me out. I've gotten everything working except the move command in the bat file. Placed the command right at the bottom of the wd.bat located in my task's directory between the annotate & final goto eof. Looks like Word is still using the file by the time the bat gets to moving it because the move process fails giving the typical statement of file is being used by another process. I haven't written a bat in a while but will look into a way to delay the eof so I can move the file rather than using the file age method. I plan on posting next week on how all this worked out for me so it may help some others.

Thanks!!

Title: Re: Print Word DOC then move files/directory
Post by Gert on Oct 6th, 2012 at 11:53am
Perhaps, just before you do the move enter this:

"%WD_INSTDIR%\GdPUtil.exe" -sleep 30

This will introduce a 30 second pause in your script.

WD_INSTDIR contains the directory where WD is installed (see http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBatEnv.html for other variables).

Title: Re: Print Word DOC then move files/directory
Post by El Credito on Oct 8th, 2012 at 3:38pm
Perfect! That looks like a great utility you got there. Lots of functionality. That did the trick without having to create a second task. Thanks so much for all your help. I will get back here this week to post for other users to learn from this process. Thanks again!

Chris

Title: Re: Print Word DOC then move files/directory
Post by Dirk on Oct 8th, 2012 at 3:43pm
Thanks for letting us know. Word was blocking that file a few seconds longer, and the script allready want to move it.....

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.