Const
FOLDER_PATH
As
String
=
"C:\Users\NKNlFE\Desktop\Ticketsystem"
Dim
objFSO
As
Object
Dim
objFolder
As
Object
Dim
OutlookMail
As
Object
Dim
i
As
Long
Dim
strFullName
As
String
Set
objFSO = CreateObject(
Class
:=
"Scripting.FileSystemObject"
)
Set
objFolder = objFSO.GetFolder(FOLDER_PATH)
i = 1
For
Each
OutlookMail
In
Folder.Items
strFullName = FOLDER_PATH & "\" & objFolder.Files.Item(i).Name
With
Range(
"Email_Attachment"
).Offset(i, 0).Hyperlinks
Call
.Delete
Call
.Add(Anchor:=Range(
"Email_Attachment"
).Offset(i, 0), Address:=strFullName, _
ScreenTip:=strFullName, TextToDisplay:=strFullName)
End
With
i = i + 1
Next
Set
objFSO =
Nothing
Set
objFolder =
Nothing
Set
OutlookMail =
Nothing