• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

PDF printing errors

matt shaw

New Member
Hi all!
I'm new :P

Ok so I have a problem.
I am trying to create a little macro that will print off a copy (or 10) of a PDF file, this file is stored on a local intranet.
The code I am using is as below:

Code:
Sub PrintFromIntranet(Full_Form_Name As String)

    Dim FullLink As String
    FullLink = "http://cbhsyd06//bho/Documents/" & Full_Form_Name & ".pdf"
    sPath = "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"     '-- these don't print the document for some reason... 
     Shell (sPath & " /n /h /t " & FullLink)                                    '-- ... .... they should!

    'ThisWorkbook.FollowHyperlink (FullLink)    '--- this opens the document.

End Sub

I'm using this sub by way of summoning it with the variable of the document name (so that I can use the same coe for multiple docs stored in the same place)

When I just use the FollowHyperlink function, it works. It pops up with:
upload_2015-10-16_16-11-33.png

But if you click ok it opens fine.
However when I try and use Adobe reader to open and print the file I get a strange error I've never seen before:

upload_2015-10-16_16-8-37.png

Anyone have any Idea what is happening?

The reason I'm not just pulling them out of a drive is that they get updated on the intranet regularly (retaining their name).

Thanks in advance!
Matt
 
Back
Top