Set refWMIService = GetObject("winMgmts:") 'Create a WMI object to be used in the EnumerateFiles function RetVal = Wsh.RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Office\" & OLKVer & ".0\Outlook\Setup\ImportPRF","h:\Exchange\Outlook.prf") RetVal = Wsh.RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Office\" & OLKVer & ".0\Outlook\Setup\First-Run") If CheckRegKey("HKEY_CURRENT_USER\Software\Microsoft\Office\" & OLKVer & ".0\Outlook\Setup\First-Run") = TRUE Then 'If Outlook version is later than 2000 then make this registry change so that Outlook imports the PRF on first run OLKVer = left(objOLK.Version,inStr(1,objOLK.Version,".")-1) 'Extract the first digit from the version number (this is the major version number) Set objOLK = CreateObject("Outlook.Application") 'Create an instance of Outlook so that it can be queried for it's version Contains an array of PABsĭim RetVal 'Generic holder for return values
Contains an array of PSTsĭim PABs 'Variable used in function. '**** before trying to delete it - uses routine by Mike Bouchardĭim objOLK 'Object to hold instance of Outlookĭim OLKVer 'First digit of Outlook Version numberĭim strDirName 'The path to search for PSTs and PABsĭim pCurrentDir 'Directory name passed to the EnumerateFiles functionĭim PSTs 'Variable used in function. Checks to make sure registry value exists '**** a registry entry is changed that causes Outlook to import the PRF the '**** PABs is invalid for Outlook and causes profile generation to fail. '**** and creates the profile using the correct method for each '**** V1.0.1 - 28.02.05 Checks for different versions of Outlook '**** Creates MAPI profiles for Outlook 2000, XP and 2003 Borrowed from Mick Mason - sorry I would post a link but I can't for the life of me find it now! but all rights/kudos/royalties! to him