Sonic007 Posted June 24, 2020 Posted June 24, 2020 Hi everyone, I was wondering if anyone knew of a way of combining several word documents together to then generate one PDF file. Ideally I'm thinking something where you select your files and pick an order and then click Go and it creates a PDF. Does such a thing exist? many thanks.
mavhc Posted June 24, 2020 Posted June 24, 2020 Set default printer to a pdf printer that can either a) autosave, or b) append. Select all files, named alphabetically, right click, print. If a) then use pdf split and merge or similar tool to merge them. 1
DGardiner Posted June 24, 2020 Posted June 24, 2020 Hi everyone, I was wondering if anyone knew of a way of combining several word documents together to then generate one PDF file. Ideally I'm thinking something where you select your files and pick an order and then click Go and it creates a PDF. Does such a thing exist? many thanks. https://pdfsam.org/ 1
RyanT001 Posted June 24, 2020 Posted June 24, 2020 This has worked well for us in the past. https://www.pdfforge.org/pdfcreator 1
dhicks Posted June 24, 2020 Posted June 24, 2020 I was wondering if anyone knew of a way of combining several word documents together to then generate one PDF file. As a one-off thing, or something that will be done reguarly? I'm doing something similar today for our printable school diary, combining a couple of DOCX files and an existing PDF into one PDF document. This is something that will be updated nightly (using up-to-date calendar data from an iCal file), so this is something I'll be running as a schedualed task of some kind from a command line. I plan to use Pandoc: https://pandoc.org/ 1
GaryPad Posted June 26, 2020 Posted June 26, 2020 Copy the following code into NotePad and then save it as a file with a .VBS extension (VBScript). As long as you have Word installed you can just drag and drop a folder onto this file and it should 1) Open Word, 2) Add each .DOC and .DOCX file from that folder into it - in alphabetical order - and then 3) Prompt you for the name of the PDF to save it as; in the same folder. It's pretty simplistic but does the job. The only issue I've noticed is it doesn't cope if the first page it adds is landscape, but if subsequent ones have landscape content then it sets the orientation fine for those. Set Args = WScript.Arguments strStartFolder = Args.Item(0) Const wdFormatPDF = 17 Const wdDoNotSaveChanges = 0 Const wdPageBreak = 7 Set objWord = CreateObject("Word.Application") objWord.Visible = True Set objDoc = objWord.Documents.Add() Set objSelection = objWord.Selection Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder(strStartFolder) Set colFiles = objFolder.Files For Each objFile in colFiles Set objFSOFile = objFSO.GetFile(objFile.Path) strExtension = UCase( objFSO.GetExtensionName(objFSOFile) ) If strExtension = "DOCX" Or strExtension = "DOC" Then objSelection.InsertFile(objFile.Path) objSelection.InsertBreak(wdPageBreak) End If Next strOutputFile = InputBox("What name do you want to save the PDF as?","PDF NAME",objFolder.Name & ".pdf") If strOutputFile <> "" Then strSaveAs = strStartFolder & "" & strOutputFile If objFSO.FileExists( strSaveAs ) Then objFSO.DeleteFile strSaveAs,True objDoc.SaveAs2 strSaveAs, wdFormatPDF , , , False , , False , True End If objWord.Application.Quit wdDoNotSaveChanges 1
Sonic007 Posted June 26, 2020 Author Posted June 26, 2020 Copy the following code into NotePad and then save it as a file with a .VBS extension (VBScript). As long as you have Word installed you can just drag and drop a folder onto this file and it should 1) Open Word, 2) Add each .DOC and .DOCX file from that folder into it - in alphabetical order - and then 3) Prompt you for the name of the PDF to save it as; in the same folder. It's pretty simplistic but does the job. The only issue I've noticed is it doesn't cope if the first page it adds is landscape, but if subsequent ones have landscape content then it sets the orientation fine for those. Hi Gary, This looks ideal for what I need to do. Just tried it and getting this error. Any ideas? Thanks again.
GaryPad Posted June 26, 2020 Posted June 26, 2020 Looks like your file has been saved incorrectly. I've uploaded it to here: http://www.filedropper.com/word2pdf just remember to turn on popup blocker as this site is quite annoying! Right click and choose Edit once you've downloaded it to check it's the same content as I posted above. I would recommend looking at a decent text editor like NotePad Plus Plus as sometime NotePad can save text files as an incorrect type (annoyingly not all text is the same!).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now