adext
1
Hello
I am looking for the easiest way to print a document
I would prefer to avoid nonfficial packages/components and printing through click
The easiest and quickest way when I do it manually is via cmd
However i don’t see any activity to use cmd directly
The invoke powershell activity opens the windows explorer which i do not want
do you have any suggestions
it’s a word document
thanks
rikulsilva
(Henrique Lima da Silva)
2
Hi @adext
You can use Start Process Activity
Give the Word executable Path and in argument field add
“/p full_file_path”
Cheers
adext
3
Hi @rikulsilva , how do i specify the printer server and name ?
pikorpa
(Piotr Kołakowski)
4
Hey @adext
here you can find solution to printing word document on default printer:
BlankProcess96.zip (2.4 KB)
I used VBScript and start process activity.
Set wordApp = CreateObject("Word.Application")
wordApp.Documents.Open "C:\path\to\your\document.docx"
wordApp.ActiveDocument.PrintOut
wordApp.ActiveDocument.Close
wordApp.Quit
1 Like
adext
5
hello @pikorpa
thanks!
what about pdf ? does this work for it as well or is there an easier way?
pikorpa
(Piotr Kołakowski)
6
Printing PDF files can be a bit different from handling Word documents,because PDF files are usually opened with a PDF reader (like Adobe Reader)
You can try use PowerShell:
Start-Process -FilePath "path\to\your\file.pdf" -Verb Print -Wait
rikulsilva
(Henrique Lima da Silva)
7
Hi @adext
If you want to print whatever file type
you can use this in argument field
"/c echo off & print \\servername\printname full_file_path"
adext
8
@rikulsilva it doesn’t work it just opens the word app
rikulsilva
(Henrique Lima da Silva)
9
In the process field to start, add full path of cmd instead word application. I forgotten to mention
adext
10
hi @rikulsilva it doesnt open the file anymore but doesn’t send anything to printer