Add a Signature to an Email Message - VBScript
''VBScript to add a signature to a mail message''Retrieve the Documents folder from the Registry
July 28, 2003
'*********************************************'VBScript to add a signature to a mail message'*********************************************'Retrieve the Documents folder from the RegistrySet objWord = Item.Application.CreateObject("Word.Application")strDocsDir = objWord.System.PrivateProfileString("",_"HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders", _"AppData") & "MicrosoftSignatures"objWord.QuitIf Item.UserProperties("rffolder name") "" ThenstrDocsDir = strDocsDir & Item.UserProperties("rffolder name") & ""End If Dim fso Dim fils Dim fil Dim fldr Dim filecount Dim filename 'Set the flder object to point to the folder that I am interested in set fso=createobject("Scripting.FileSystemObject") Set fldr = fso.GetFolder(strDocsDir) Set fils = fldr.Files 'Print the name of the file that file object fil is pointing to. filecount = 0 For Each fil In fils filecount = filecount + 1 If filecount = 1 Then Exit For Next filename = fil.NamestrAttPathName = strDocsDir'Add the signature attachment to the message item.Set attmts = item.Attachmentsattmts.Add strAttPathName & filename
Read more about:
MicrosoftAbout the Author
You May Also Like