Hiya all,
I've got everything working for this Macro except for one piece to this puzzle. I'm in the process of trying create an Email Attachment system that loads the "Signature" from Outlook. Our company uses multiple signatures for various types of emails (Default email Sig, Vendor sig, Overseas Sig, standard reply Sig). This macro will be used by multiple people so the Signature file naming convention is whatever the user decided to name their sig.
AKA, I can't just use Dir & "Default.htm" because it's not always named that.
The only consistency is the signature I want to use for this Macro happens to be the Largest file size.
I used Insert Outlook Signature in mail as a starting point where I grabbed these pieces of code.
The line SigString = Environ("appdata") & "\Microsoft\Signatures\Mysig.htm" won't work for me as this name is different for each user's computer.
So, I need a process that will search through all the *.htm files in
This gets me the first *.htm* file found but it's not always the one I need. I want to cycle through the directory to find the largest *.htm* file size and return back to me that file to use in my Email.
Any help past this point would be appreciated.
I've got everything working for this Macro except for one piece to this puzzle. I'm in the process of trying create an Email Attachment system that loads the "Signature" from Outlook. Our company uses multiple signatures for various types of emails (Default email Sig, Vendor sig, Overseas Sig, standard reply Sig). This macro will be used by multiple people so the Signature file naming convention is whatever the user decided to name their sig.
AKA, I can't just use Dir & "Default.htm" because it's not always named that.
The only consistency is the signature I want to use for this Macro happens to be the Largest file size.
I used Insert Outlook Signature in mail as a starting point where I grabbed these pieces of code.
Code:
[COLOR=#3366CC] Dim [U]SigString [/U]As String
[/COLOR][COLOR=#3366CC] Dim [U]Signature [/U]As String
[/COLOR] [COLOR=black]'Change only Mysig.htm to the name of your signature[/COLOR]
[U]SigString [/U]= Environ("appdata") & [FONT=Verdana]"\Microsoft\Signatures\[/FONT][COLOR=black][FONT=Verdana]Mysig[/FONT][/COLOR][FONT=Verdana].htm"
[/FONT]
[U]Signature [/U]= GetBoiler([U]SigString[/U]) On Error Resume Next
With OutMail
.To = "ron@debruin.nl"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.HTMLBody = strbody & "
" & [U][B]Signature[/B][/U]
.Send [COLOR=black]'or use .Display[/COLOR] [COLOR=#3366CC] End With[/COLOR]
The line SigString = Environ("appdata") & "\Microsoft\Signatures\Mysig.htm" won't work for me as this name is different for each user's computer.
So, I need a process that will search through all the *.htm files in
Code:
SignaturePath = Environ("appdata") & "\Microsoft\Signatures\"
SignatureFile = Dir$(SignaturePath& "*.htm*", vbNormal)
This gets me the first *.htm* file found but it's not always the one I need. I want to cycle through the directory to find the largest *.htm* file size and return back to me that file to use in my Email.
Any help past this point would be appreciated.
Last edited: