1

Is there any kind of option, plugin or third-party tool that can cause a Word or Powerpoint document to be automatically exported in PDF (or other format), to a specific pâth, upon save?

I'm asking because I have several CVs in .docx that I update regularly. Every time I change them, I have to re-export them in PDF and place the PDF file in a specific folder.

I would rather just press "save" and have the PDF file be updated automatically.

Is there something out there that can achieve that?

3 Answers 3

3

This macro is a bit of a hack in its current state but works fine, especially if you're editing the same very few files over and over again.

Basically, you need to run the AddKeyBinding() which will register the key presses. Or, add this to the load in VBa.

Within the AddKeyBinding you can see the bindings and where it exports too... As you can see, it waits for ALT + 1 and then it exports to SaveDaveCv...

I've also added ALT+2 but didn't complete the macro...

Sub AddKeyBinding()
    With Application
         ' \\ Do customization in THIS document
        .CustomizationContext = ThisDocument

         ' \\ Add keybinding to this document Shorcut: Alt+1
        .KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyAlt, wdKey1), _
        KeyCategory:=wdKeyCategoryCommand, _
        Command:="SaveDaveCv"

         ' \\ Add keybinding to this document Shorcut: Alt+2
        .KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyAlt, wdKey2), _
        KeyCategory:=wdKeyCategoryCommand, _
        Command:="SaveOtherCv" 'You need to do this
    End With
End Sub


 ' \\ Test sub for keybinding
Sub SaveDaveCv()

    ActiveDocument.ExportAsFixedFormat OutputFileName:="C:\Users\DRook\Desktop\MyCv.pdf", ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:=wdExportOptimizeForPrint, Range:=wdExportAllDocument, Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, BitmapMissingFonts:=True, UseISO19005_1:=False


    MsgBox "Saved", vbInformation, "Succes"

End Sub

Your question I guess was left quite open on purpose, as such, I've left the answer in the same manner - have fun, hack it up, make it work for what you need it to do!!

1
  • 1
    Ah yeah, this works well. In my case the alt+F1 function was unbindable (I used ctrl+1 instead), and I believe that this can be made extendable by generating the PDF name according to this file name (ThisDocument.name doesn't quite do what I want, but it's just a matter of tweaking). I'm going to play around with it and I'm sure I'll eventually end up with something that fits me perfectly. Thanks a lot for the base code!
    – Timst
    Jun 5, 2014 at 23:00
1

As of Office 2007 saving as PDF is supported. Thus it should be possible to create a Macro, which for example triggered on Save does exactly what you want.

0

I doubt that there is anything like this. And the reason is that hardly anyone would find it useful. MSWord and MSPowerPoint are editors and have their own default format for documents. There is a way to export / print documents from MSWord and MSPowerPoint to PDF but this is just an option and it is not default for the reason. And exporting to particular folder is out of question too.

Your best bet is to create a batch file that will do the job for you. However you would need the command line PDF-converter that would handle .doc and .ppt formats

Not the answer you're looking for? Browse other questions tagged .