![]() ![]() Objreg. Until here, the code runs just fine, it's the correct reg-path, the version is retrieved like it should.īut for some reason, the code won't enter the 'for each' loop in the next part, it doesn't find any 'subkeys' (but when I check in the reg, they are there.) For Each subkey In arrProfileKeys Objreg.EnumKey HKEY_CURRENT_USER, strKeyPath, _ ' strKeyPath, "DefaultProfile", strProfile ' objreg.GetStringValue HKEY_CURRENT_USER, _ "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\" _ "Software\Microsoft\Office\" & strOutlookVersion & ".0\Outlook\Profiles\" _ "Please contact your system administrator." Msgbox "The location of OUTLOOK.EXE couldn not be verified." & vbNewLine & _ HKEY_LOCAL_MACHINE,strKeyOutlookAppPath,strOutlookPath,strOutlookPathValue This is my entire code, Call SetDefaultSignature("Test3", "") Objreg.SetStringValue HKEY_CURRENT_USER, strsubkeypath, "Reply-Forward Signature", "(None)" Objreg.SetStringValue HKEY_CURRENT_USER, strsubkeypath, "New Signature", strSigName Strsubkeypath = strKeyPath & "\" & subkey Objreg.EnumKey HKEY_CURRENT_USER, strKeyPath, arrProfileKeys In the followings, we share you 3 methods. In such a case, the first step is to delete all of them. If you think that most of them are useless and not satisfying, you may desire to reset them, namely recreating the signatures. This feature works the same in all modern versions of Microsoft Outlook: 2010, 2013, and 2016. Perhaps you’ve created email signatures in your Outlook. StrKeyPath = strKeyPath & strProfile & "\9375CFF0413111d3B88A00104B2A6676" Select File > Options > Mail (under Outlook Options) > Signatures (under Compose messages).From the Message Ribbon, select the Insert tab, and from the Include group, select Signature. MyArray = StringToByteArray(strSigName, True) Objreg.GetStringValue HKEY_CURRENT_USER, _ StrKeyPath = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\" StrDisableKeyPath = "Software\Microsoft\Office\" & strOutlookVersion & ".0\Common\MailSettings\" StrKeyPath = "Software\Microsoft\Office\" & strOutlookVersion & ".0\Outlook\Profiles\" 'Set profile Registry path based on Outlook version StrOutlookVersion = Left(strOutlookVersionNumber, inStr(strOutlookVersionNumber, ".0") - 1) StrOutlookVersionNumber = objFSO.GetFileVersion(strOutlookPathValue & "outlook.exe") If objFSO.FileExists(strOutlookPathValue & "outlook.exe") Then Set objFSO = CreateObject("Scripting.FileSystemObject") 'Verify that the outlook.exe exist and get version information Objreg.GetStringValue HKEY_LOCAL_MACHINE,strKeyOutlookAppPath,strOutlookPath,strOutlookPathValue StrKeyOutlookAppPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE" StrComputer & "\root\default:StdRegProv") Sub SetDefaultSignature(strSigName, strProfile) This is the code i used: Call SetDefaultSignature("MYSIGNATURE","") But now some users have office 2016 and the script does add the signature in outlook, but i can't seem te get it set as default (or the reply-default). I've written a vbscript that gets the user-info from the Active Directory, generates a signature based on html and sets the signature in outlook as a default.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |