+ Reply to Thread
Results 1 to 5 of 5

Word 2010 VBA save to specific folder as PDF

  1. #1
    Registered User
    Join Date
    01-21-2016
    Location
    Bristol
    MS-Off Ver
    2010
    Posts
    2

    Word 2010 VBA save to specific folder as PDF

    Hi All

    Firstly I am a complete beginner when it comes to VBA!

    I have found the code below to save a word document as a PDF that opens the save dialog box, automatically gives the filename and set to save as PDF is it possible to add a code to automatically specifiy the save folder location using the dialog box method? I need to use the dialog box method so that the person saving it can check the date is correct as they may sometimes save the file a day late and need to manually change the date hope this makes sense?

    Sub SaveMe()

    Msg = "Before saving ensure the correct date is entered In the Header?"
    Ans = MsgBox(Msg, vbYesNo + vbQuestion)
    If Ans = vbNo Then Exit Sub

    With Dialogs(wdDialogFileSaveAs)

    .Name = "Minutes_" & Format(Now(), "DD-MM-YY") & ".PDF"
    .Format = wdFormatPDF
    .Show

    End With

    End Sub

    Thanks
    Stuart

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Word 2010 VBA save to specific folder as PDF

    Sure - simply add the path to the .Name variable. For example:
    Please Login or Register  to view this content.
    points it to the User's Desktop.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Word 2010 VBA save to specific folder as PDF

    Hi there,

    See if the following code does what you need:

    Please Login or Register  to view this content.
    The highlighted value may be altered to suit your own requirements.


    Incidentally, if you format your filenames using:

    Please Login or Register  to view this content.
    you'll find that a File Manager application will display the files in chronological sequence - this can be useful.



    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  4. #4
    Registered User
    Join Date
    01-21-2016
    Location
    Bristol
    MS-Off Ver
    2010
    Posts
    2

    Re: Word 2010 VBA save to specific folder as PDF

    Hi Paul, Greg

    Thanks for the replies I have finally got round to trying both codes but neither do what I was after when you run both the save as dialog box is set to the default save location which is my Documents folder on the C drive where as I would like it to automatically select a folder saved on a network drive.

    Thanks
    Stuart

  5. #5
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Word 2010 VBA save to specific folder as PDF

    The code I posted was only a demo of what's possible; and it most certainly would not simply point to the user's Documents folder - it points to the user's Desktop folder. Obviously, you'd have to edit the code to point to the relevant network folder.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Save as xlsm file with specific name & specific folder
    By namialus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-07-2015, 03:32 AM
  2. Replies: 1
    Last Post: 10-18-2014, 05:04 PM
  3. Excel 2010 VBA: save to same folder?
    By sambo24 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-01-2014, 10:30 AM
  4. Button to save workbook, with value in specific cell (H5), in a specific folder
    By markeeny in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2014, 01:15 PM
  5. Save to specific folder
    By PJenkins in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-19-2014, 10:23 PM
  6. Trying to save a Mail Merge word Document to a specific folder
    By jtemp57 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-19-2014, 06:56 PM
  7. [SOLVED] Macro to save workbook to specific folder with a specific name, then kill/disable itself.
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-18-2012, 03:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1