#1
|
|||
|
|||
Auto Hyperlink PDF files
Hi everyone,
I found a VBA code to make pdf auto hyperlink but my problem is I want the filename that will display is data in my excel not the filename of the PDF. Example: Column A aaa1 aaa2 aaa3 the hyperlink you should insert in column a. here is the code: Sub AddHyperlink() Dim objFSO As Object Dim objFolder As Object Dim objFile As Object Dim i As Integer 'Create an instance of the FileSystemObject Set objFSO = CreateObject("Scripting.FileSystemObject") 'Get the folder object Set objFolder = objFSO.GetFolder("\\server\folder\") i = 2 'loops through each file in the directory For Each objFile In objFolder.Files 'select cell Range(Cells(i + 1, 1), Cells(i + 1, 1)).Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _ objFile.Path, _ TextToDisplay:=objFile.Name i = i + 1 Next objFile End Sub thank you in advance! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
auto populate fields for multiple files w/in folder | jbyrd | Word | 0 | 07-21-2014 07:35 AM |
Auto Backup/Restore ALL OL files? | markg2 | Outlook | 0 | 12-16-2012 07:23 AM |
Convert word files to html including hyperlink file types | MikS | Word | 3 | 06-12-2012 05:39 AM |
Animation and Auto Playing of Sound Files in Email | MJS | Outlook | 0 | 02-10-2010 03:23 PM |
auto click hyperlink | malemodel_75@yahoo.com | Outlook | 0 | 02-05-2010 12:05 PM |