HI
I currently have a code that will currently attach my signature on outlook together with the image. The issue i'm facing is that the image is specifically reading the image from my username directory. Please see below code under row signImage = "Lennie_files". If another user uses this button it will no longer pick up the image. Is there a generic username i can use in vba or can someone please share what i can put in here to pick up the different usernames? Many thanks for all help given. Part of the code below for reference:
sPath = Environ("appdata") & "\Microsoft\Signatures"
If Dir(sPath, vbDirectory) <> vbNullString Then
sPath = sPath & Dir$(sPath & "*.htm")
Else:
sPath = ""
End If
signImage = "username_files"
completeFolderPath = Environ("appdata") & "\Microsoft\Signatures" & signImage
If Dir(sPath) <> "" Then
StrSignature = GetSignature(sPath)
StrSignature = VBA.Replace(StrSignature, signImage, completeFolderPath)
Else
StrSignature = ""
End If
On Error Resume Next
With NewMail
.To = "lennie email"
.CC = "lennie email"
.Subject = "Test"
' Here at the end of the Email Body
' HTML Signature is inserted.
.htmlBody = EmailBody & "<br><br>" & StrSignature
.display
I currently have a code that will currently attach my signature on outlook together with the image. The issue i'm facing is that the image is specifically reading the image from my username directory. Please see below code under row signImage = "Lennie_files". If another user uses this button it will no longer pick up the image. Is there a generic username i can use in vba or can someone please share what i can put in here to pick up the different usernames? Many thanks for all help given. Part of the code below for reference:
sPath = Environ("appdata") & "\Microsoft\Signatures"
If Dir(sPath, vbDirectory) <> vbNullString Then
sPath = sPath & Dir$(sPath & "*.htm")
Else:
sPath = ""
End If
signImage = "username_files"
completeFolderPath = Environ("appdata") & "\Microsoft\Signatures" & signImage
If Dir(sPath) <> "" Then
StrSignature = GetSignature(sPath)
StrSignature = VBA.Replace(StrSignature, signImage, completeFolderPath)
Else
StrSignature = ""
End If
On Error Resume Next
With NewMail
.To = "lennie email"
.CC = "lennie email"
.Subject = "Test"
' Here at the end of the Email Body
' HTML Signature is inserted.
.htmlBody = EmailBody & "<br><br>" & StrSignature
.display