AlphaLolz
asked on
automating MS Word 2010 -> PDF
I understand that it is possible to have a PowerShell script automate MS Word to read an MS Word document from a folder and save it out as a PDF document (same name, different extension) without bringing up a user GUI (in order to run on a server).
We have a need to run a script like this via the scheduler (once / minute or in a loop) to convert MS Word documents (*.doc, *.docx) to PDF (any relatively current version) on a Windows 2008 R2 (64-bit) server image.
Does anyone have the time to provide a script that can do this? The goal is something that we can have going unattended and is reasonably immune to "hanging".
We have a need to run a script like this via the scheduler (once / minute or in a loop) to convert MS Word documents (*.doc, *.docx) to PDF (any relatively current version) on a Windows 2008 R2 (64-bit) server image.
Does anyone have the time to provide a script that can do this? The goal is something that we can have going unattended and is reasonably immune to "hanging".
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Function to convert PPT files to PDF
http://pshscripts.blogspot .co.uk/201 2/11/conve rt-pptxtop dfps1.html
Script to perform function from Thomas Lee's blog
http://tfl09.blogspot.com/ 2012/11/sa ving-power point-slid es-to-pdf- with.html
http://pshscripts.blogspot
Script to perform function from Thomas Lee's blog
http://tfl09.blogspot.com/
$ipath = "E:\SkyDrive\PowerShell V3 Geek Week\"
Foreach ($ifile in $(ls $ipath -Filter "*.pptx")) {
# Build name of output file
$pathname = split-path $ifile
$filename = split-path $ifile -leaf
$file = $filename.split(".")[0]
$ofile = $pathname + $file + ".pdf"
# Convert _this_ file to PDF
Convert-PptxToPDF -ifile $ifile -OFile $ofile
}
ASKER
Now I have to move on and get PPT to work. Then onto getting these to run on a server.