ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,731
- Office Version
- 2007
- Platform
- Windows
Hi,
I am using this code on a command button but when i hyperlink the text it becomes font size 16
I tried to add a line of code, shown in red below but a compile error.
What is the issue, do you see Thanks
I am using this code on a command button but when i hyperlink the text it becomes font size 16
I tried to add a line of code, shown in red below but a compile error.
What is the issue, do you see Thanks
VBA Code:
Private Sub HyperlinkDisco_Click()
Dim file As String
Const FILE_PATH As String = "C:\Users\Ian\Desktop\REMOTES ETC\DISCO II CODE\DISCO II PDF\"
If ActiveCell.Column = Columns("B").Column Then
Dim customerName As String
customerName = Left(ActiveCell.Value, InStrRev(ActiveCell.Value, " ") - 1)
file = Dir(FILE_PATH & customerName & "*.pdf")
If Len(file) Then
ActiveCell.Hyperlinks.Add Anchor:=ActiveCell, Address:=FILE_PATH & file
[COLOR=rgb(184, 49, 47)].Font.Size = 12[/COLOR]
MsgBox "HYPERLINK WAS SUCCESSFUL.", vbInformation, "POSTAGE SHEET HYPERLINK MESSAGE"
End If
Else
MsgBox "PLEASE SELECT A CUSTOMER FIRST TO HYPERLINK THE FILE.", vbCritical, "POSTAGE SHEET DISCO II HYPERLINK MESSAGE"
Exit Sub
End If
If Dir(FILE_PATH & customerName & "*.pdf") = "" Then
If MsgBox("THERE IS NO FILE FOR THIS CUSTOMER" & vbNewLine & "WOULD YOU LIKE TO OPEN THE DISCO II FOLDER ?", vbYesNo + vbCritical, "HYPERLINK CUSTOMER DISCO II MESSAGE.") = vbYes Then
CreateObject("Shell.Application").Open ("C:\Users\Ian\Desktop\REMOTES ETC\DISCO II CODE\DISCO II PDF\")
End If
End If
End Sub