• 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.

Hyperlinks through VBA within the PDF

Shailender

Member
Hello,

I have a question, I want to attach a hyperlink to the text in PDF so that, as soon as when I click on the link it takes me to the information pertaining to the existence of it on any of the page within the PDF.

This is just a sample report; In order to do this manually it will take couple of minutes for me.

I have many categories like this, so it takes hour’s to do this manually. So is it possible through VBA…? If so how can we do it.

I really appreciate if I would get a right answer for this query.
 

Attachments

Then this is not the right forum for you. Ask in the "other tool's" forum. Of course you can ask in Adobe Acrobat's forum if you have Adobe Acrobat Pro.

Adobe Acrobat Pro software or some others can save the PDF as a Word file. You can then add the links. I don't much care for that sort of round robin deal myself.

There may be other 3rd party applications to do it but it is kind of like shutting the barn door after the horse got out.
 
Kenneth, thank you for the prompt reply. What if we have the same data in excel sheet how to hyperlink through VBA then it should convert to PDF..?
 
Yes, do it as I showed in post #3.

You will point it to a sheet and cell. Be sure to set your print areas to not exceed the page limits. Post a short example file if you like.
 
Kenneth, I tried as you suggested in post#3. Then i saved the excel sheet into PDF format. The question over here is hyperlink is not working when i click on the hyperlink in the PDF....
 
My file works. Your file does not. So, post your file so I can see what is wrong.

I can also show you how to make the PDF from Excel. I would need to know which sheets to include. The links should already be there.
 
Because I have Adobe Acrobat Pro, I can do a File > SaveAs to retain them. The Excel export method does not. e.g.
Code:
Sub MakePDF()
  Dim fn$
  fn = Environ("temp") & "\MakePDF.pdf"
  Sheet2.ExportAsFixedFormat xlTypePDF, fn
  Shell "cmd /c " & """" & fn & """", vbHide
End Sub
Since you don't have Acrobat, try some other application with a pdf printer so you can do a File > Save As, pdf type.
 
Kenneth, I am also using Adobe Acrobat Pro. I ran the code which you have provided @#9, with that code I am able to generate the PDF but hyperlinks are not working. Could you please me out what could be the issue..?
 
Back
Top