+ Reply to Thread
Results 1 to 6 of 6

Save as pdf in current folder in Sharepoint

  1. #1
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Save as pdf in current folder in Sharepoint

    Good day all!

    Saving a Word document as a pdf is currently a 6 click operation (Word 2013). All our documents should always end up as pdf's when finished and those 5 extra clicks adds up during the day.

    I need help to write a macro that makes this a one click operation. I've seen similar posts on the internet and the Save as dialogue box may be difficult to get around but that's ok, a 3 click solution is still way better than a 6 click solution.

    Even a non sharepoint solution would be of interest since not all work I do is against sharepoint. Some of this I should be able to fix myself but I'm in a "low VBA activity" period now.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  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: Save as pdf in current folder in Sharepoint

    You could add a macro to the document template's 'This Document' code module, coded as:
    Please Login or Register  to view this content.
    This will intercept the SaveAs dialog for all documents based on that template and cause the dialog to default to the PDF format. If you'd prefer not to change the template's default SaveAs format, give the macro a different name and assign it to a keyboard shortcut.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Re: Save as pdf in current folder in Sharepoint

    Brilliant! 4 clicks less with just a tiny bit of code!
    Last edited by Jacc; 12-02-2015 at 06:11 PM. Reason: 4 clicks less, not 5

  4. #4
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Re: Save as pdf in current folder in Sharepoint

    Hi again
    My code looks like this now, it's working and I'm using it. I added the DoEvents cause it felt right, I'm sure it does something.

    However, I still get asked if I want to overwrite the existing pdf file. Can that dialogue be supressed?

    Please Login or Register  to view this content.

  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: Save as pdf in current folder in Sharepoint

    Quote Originally Posted by Jacc View Post
    I added the DoEvents cause it felt right, I'm sure it does something.
    Completely irrelevant in this context. I suggest you look at what DoEvents is for. Adding code just because "cause it felt right" and "I'm sure it does something" is silly.

    Likewise, adding:
    ActiveDocument.Save
    adds no functionality to the code I provided. Again, you really should try to understand what different bits of code do instead of just adding them willy-nilly.

    Since you're saving via a standard Word dialogue, you get the alerts that dialog provides.

  6. #6
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Re: Save as pdf in current folder in Sharepoint

    Quote Originally Posted by macropod View Post
    Completely irrelevant in this context. I suggest you look at what DoEvents is for. Adding code just because "cause it felt right" and "I'm sure it does something" is silly.
    Well that was a good reminder of the importance of smilies after a playful statement.
    Sharepoint is unreliable at best and I added the DoEvents to make sure the process of saving to Sharepoint finished properly before continuing the macro.
    I'm sure you're right but I got the impression it failed to save to Sharepoint every now and then before I added it.

    Quote Originally Posted by macropod View Post
    Likewise, adding:
    ActiveDocument.Save
    adds no functionality to the code I provided.
    Actually it does add functionality, it saves the Word document. The Word document will be edited every day and a pdf version of the latest revision will be sent in a mail.

    Quote Originally Posted by macropod View Post
    Again, you really should try to understand what different bits of code do instead of just adding them willy-nilly.
    I will work on that. Maybe one day I can also learn some Excel formulas.

    Quote Originally Posted by macropod View Post
    Since you're saving via a standard Word dialogue, you get the alerts that dialog provides.
    Ok, thanks.

+ 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. VBA to save file to sharepoint folder
    By rlsublime in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-20-2014, 04:56 PM
  2. How to save file in respective month folder as per current year vba modification
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2014, 05:26 PM
  3. Disable save prompt for all files in current folder?
    By GregTheSquarePeg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-09-2014, 09:37 AM
  4. How to use a macro to save worksheet as pdf to current folder
    By lriver2 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-13-2013, 05:03 PM
  5. [SOLVED] Save worksheets in current folder as .pdf
    By Birdster in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2013, 04:44 AM
  6. Save as CSV to specific folder on desktop and current date as filename
    By stokiejames09 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2013, 05:52 PM
  7. [closed - opening new thread] Save xlsm to Sharepoint/Web Folder
    By phi11yguy19 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-03-2011, 08:25 AM

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