#1
|
|||
|
|||
open custon files, convert to Word, print/save to PDF
Hi. I have a software program that creates custom files, let's say BBB. I have a Word 2016 add-in which opens these BBB files in Word. I have 1,500 of these files and am looking for the best way to save these files as PDF.
I've tried opening Word and selecting the files, which opens them for viewing in Word but in Compatibility mode. To save from there, it seems like I have to save one at a time. Is there a way to open/convert to Word/save in one fell swoop? From there, I could convert to PDF. Thank you for any and all advice! |
#2
|
||||
|
||||
Each file would have to be opened and saved individually, though this could be automated with a macro.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Acrobat Pro provides bulk conversion, though this will of course depend on whether it recognises the format of your .bbb files … and on your having Acrobat Pro ;-} There may well be other tools that will do the same job, but I'm lucky enough not to have needed to find out.
|
#4
|
|||
|
|||
thanks
I will have to find someone who knows macros - which would not be me!
|
#5
|
||||
|
||||
A macro is easy enough to write, but you'll need to at least tell us what the extension is for the filenames concerned.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
macros
I wasn't even expecting that kind of help here! They are .BIL (and .TXT) files.
|
#7
|
||||
|
||||
Try the following macro:
Code:
Sub GeneratePDFs() Application.ScreenUpdating = False Dim strFolder As String, strFile As String, strDocNm As String, wdDoc As Document, i As Long, ArrExt, StrExt As String ArrExt = Array(".bil", ".txt") strDocNm = ActiveDocument.FullName strFolder = GetFolder If strFolder = "" Then Exit Sub strFolder = strFolder & "\" For i = 0 To 1 StrExt = ArrExt(i) strFile = Dir(strFolder & "*" & StrExt, vbNormal) While strFile <> "" Set wdDoc = Documents.Open(FileName:=strFolder & strFile, ConfirmConversions:=False, _ ReadOnly:=True, AddToRecentFiles:=False, Visible:=False) With wdDoc .SaveAs FileName:=strFolder & Split(strFile, StrExt, , vbTextCompare)(0) & ".pdf", _ FileFormat:=wdFormatPDF, AddToRecentFiles:=False .Close SaveChanges:=False End With strFile = Dir() Wend Next Set wdDoc = Nothing Application.ScreenUpdating = True End Sub Function GetFolder() As String Dim oFolder As Object GetFolder = "" Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0) If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path Set oFolder = Nothing End Function
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
After Windows 10 Creator update I cant open or save files from within Office programs | papapaul | Office | 1 | 06-05-2017 07:07 AM |
Convert handwriting to text and save to word | tigris | OneNote | 1 | 10-30-2014 01:14 PM |
Cannot open Outlook but want to save Outlook files | timm@bicyclegermany.com | Outlook | 1 | 08-03-2014 10:59 AM |
Open and save Word files | mbesspiata | Word VBA | 3 | 05-23-2014 07:15 PM |
Convert old PowerPC file to Intel-based files in Word? | walmar | Word | 0 | 06-12-2013 07:07 AM |