Results 1 to 3 of 3
  1. #1
    mrmims is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Posts
    53

    Print PDFs from Sharepoint

    Hello,

    I have a table for Equipment, and each piece of Equipment has a unique serial number (ST011402 for example). Associated with the Equipment are Load Tests. The completed Load Test forms are scanned and stored in Sharepoint. In tbl_Load_Tests, I have a field for a hyperlink linking to each complete form in Sharpoint, and the file name is similar to ST011402_2015_12_12.pdf. Some pieces of Equipment have had 25 Load Tests performs, others have had 1.



    I want to click a button on a specific Equipment page which will then print all pdfs in Sharepoint with begin with ST011402. I have a piece of code I have found online, but it isn't working exactly right. Am I close or REALLY far off?

    Code:
    Option Compare Database
    
    
    Private Sub Command0_Click()
    
    
    Dim strOnePdfFile As String
    Dim strWild       As String
       
    strWild = "https://sharepoint.connect ... /Load Testing Forms/ST011402*.pdf"
                                        
    strOnePdfFile = Dir(strWild)
    Do While strOnePdfFile <> ""
       
    Call PrintOnePdf(strOnePdfFile)
    strOnePdfFile = Dir()
        
    Loop
       
    MsgBox "done printing files"
       
    End Sub
    
    
    Sub PrintOnePdf(strF As String)
       
       CreateObject("Shell.Application").Namespace(0).ParseName(strF).InvokeVerb ("Print")
       
    End Sub
    On line "strOnePdfFile = Dir(strWild)" I am getting:
    Code:
    Run-Time Error '52':
    
    Bad File Name or number
    Thank you for any and all help!

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    not too familiar with access sharepoint this way but looks like the .... in https://sharepoint.connect ... /Load.../ST011402*.pdf
    should be complete text - you have copied an abbreviation

  3. #3
    mrmims is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Posts
    53
    Sorry about that, I should have been clearer.

    I abbreviated the link so as not give out too much information about my company.
    Last edited by mrmims; 12-19-2015 at 10:24 PM. Reason: words

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 07-29-2014, 01:05 PM
  2. Replies: 0
    Last Post: 03-24-2014, 09:35 AM
  3. Print linked pdfs with their associated reports
    By HoopaWildlife in forum Access
    Replies: 1
    Last Post: 09-08-2011, 06:40 PM
  4. Print linked pdfs within an Access Report II
    By cjwagner in forum Reports
    Replies: 3
    Last Post: 05-30-2011, 04:25 PM
  5. Print linked pdfs within an Access Report
    By alpruett in forum Reports
    Replies: 6
    Last Post: 05-20-2011, 05:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums