WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Samples from Users
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Outlook Settings


Question:

We are trying to migrate users from Outlook97 to Outlook2000. Does anyone know where the settings are stored? Or has anyone developed a script to do this? I am trying to not re-develop the wheel.

We are migrating the OS on systems from win95/98/nt4/nt2000 to winXP. I am trying to get the setting for outlook and export them so that I can import them on the other side. They are using outlook 97 in the old environment and outlook 2000 in the new environment.

Answer:

You could also look into the newprof.exe tool that comes with Outlook.

Here's the code. Use newprof.exe or modprof.exe to import the settings.

ProfilePath = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
If !RegExistKey(@RegCurrent,ProfilePath)
	FileWrite(ExportLog,StrCat(@Tab,'There are no Outlook Profiles defined.'))
	Goto ExportOutlookConfig_Finish
EndIf
;`````
BoxTextColor(StageBox,AlphaNetBlue)
BoxDrawText (StageBox,StagePos_07,StageText_Outlook,@True,0)
BoxDrawText (StageBox,StageStatusPos_07,StageStatus_Pointer,@True,0)
BoxDrawText (StatusBox,'30,180,970,970',StrCat('Recording Outlook profile information'),@True,144)
;`````
CurrentStep = 0 
TotalSteps = 7.0
;`````
FileList = FileOpen(FileListFile,'append')
FileCopy(StrCat(ProgramFolder,'\outlook.prf'),UserMigrationFolder,@False)
;`````
ProfilesKey = RegOpenkey(@RegCurrent,ProfilePath)
ProfilesList = RegQueryKeys(ProfilesKey)
NumberOfProfiles = ItemCount(ProfilesList,@Tab)

; - - - Write profiles - - - - - - - - 
For X = 1 to NumberOfProfiles
	CurrentItem = ItemExtract(x,ProfilesList,@Tab)
	IniWritePvt(StrCat('OutlookProfile - ',CurrentItem), 'ProfileName',CurrentItem, CrossRefIni)
Next 

; - - - - - - Write Default Profile - - - - - - - 
DefaultProfile = ''
If RegExistValue(@RegCurrent,StrCat(ProfilePath,'\[defaultprofile]'))
	DefaultProfile = RegQueryValue(ProfilesKey,"[DefaultProfile]")
	IniWritePvt (StrCat('OutlookProfile - ',DefaultProfile), 'DefaultProfile', 'yes', CrossRefIni) 
EndIf

; - - - - - - Signatures - - - - - -
CurrentItem = '001e0361'
UFItemName = 'Signature'
for x = 1 to NumberOfProfiles
	CurrentProfileKey = ItemExtract(x,ProfilesList,@Tab)
	key = RegOpenkey(@RegCurrent, "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\%CurrentProfileKey%")
	SubKeyList = RegQueryKeys(key)
	NumberOfProfileSubKeys = ItemCount(SubKeyList,@Tab)
	for y = 1 to NumberOfProfileSubKeys
		CurrentSubKey = ItemExtract(y,SubKeyList,@Tab)
		QueryFile = StrCat(ProfilePath,"\",CurrentProfileKey,"\",CurrentSubKey,'[',CurrentItem,']')
		If RegExistValue(@RegCurrent,QueryFile)
			Value = StrLower(RegQueryValue(@RegCurrent,QueryFile))
			IniWritePvt (StrCat('OutlookProfile - ',CurrentProfileKey),UFItemName,Value, CrossRefIni)
		EndIf
	Next
Next

; - - - - - PAB - - - - - - - - - - 
CurrentItem = '001e6600'
UFItemName = 'PAB'
For x = 1 to NumberOfProfiles
	CurrentProfileKey = ItemExtract(x,ProfilesList,@Tab)
	key = RegOpenkey(@RegCurrent, "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\%CurrentProfileKey%")
	SubKeyList = RegQueryKeys(key)
	NumberOfProfileSubKeys = ItemCount(SubKeyList,@Tab)
	for y = 1 to NumberOfProfileSubKeys
		CurrentSubKey = ItemExtract(y,SubKeyList,@Tab)
		QueryFile = StrCat(ProfilePath,"\",CurrentProfileKey,"\",CurrentSubKey,'[',CurrentItem,']')
		If RegExistValue(@RegCurrent,QueryFile)
			Value = StrLower(RegQueryValue(@RegCurrent,QueryFile))
			IniWritePvt (StrCat('OutlookProfile - ',CurrentProfileKey),UFItemName,Value, CrossRefIni)
		EndIf
	Next
Next

; - - - - - PST - - - - - - - - - - 
CurrentItem = '001e6700'
UFItemName = 'PST'
For x = 1 to NumberOfProfiles
	CurrentProfileKey = ItemExtract(x,ProfilesList,@Tab)
	key = RegOpenkey(@RegCurrent, "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\%CurrentProfileKey%")
	SubKeyList = RegQueryKeys(key)
	NumberOfProfileSubKeys=ItemCount(SubKeyList,@Tab)
	z = 0
	for y = 1 to NumberOfProfileSubKeys
		CurrentSubKey = ItemExtract(y,SubKeyList,@Tab)
		QueryFile = StrCat(ProfilePath,"\",CurrentProfileKey,"\",CurrentSubKey,'[',CurrentItem,']')
		If RegExistValue(@RegCurrent,QueryFile)
			z = z + 1
			Value = StrLower(RegQueryValue(@RegCurrent,QueryFile))
			IniWritePvt (StrCat('OutlookProfile - ',CurrentProfileKey),StrCat(UFItemName,z),Value, CrossRefIni)
		EndIf
	Next
Next

; - - - - - - - - Write profiles to Log File - - - - - - - - - - 
CRISectionList = IniItemizePvt('',CrossRefIni)
NumberOfSections = ItemCount(CRISectionList,@Tab)
For x = 1 to NumberOfSections
	CurrentSection = ItemExtract(x,CRISectionList,@Tab)
	If StrIndexNc (CurrentSection,'OutlookProfile - ','1',@FwdScan)
		KeywordList = IniItemizePvt(CurrentSection,CrossRefIni)
		NumberOfKeywords = ItemCount(KeywordList,@Tab)
		For y = 1 to NumberOfKeywords
			CurrentKeyword = ItemExtract(y,KeywordList,@Tab)
			CurrentValue = IniReadPvt(CurrentSection,CurrentKeyword,'',CrossRefIni)
			FileWrite(ExportLog,StrCat(CurrentKeyword,@Tab,'= ',CurrentValue))
		Next
		FileWrite(ExportLog,LineFeed)
	EndIf
Next

; - - - - - - - Validate PAB & PSTs - - - - - - - - - - - - - - -
FileWrite(ExportLog,StrCat(LineFeed,'- OUTLOOK PROFILE ERRORS - - - - - - - - - - - -'))
CRISectionList = IniItemizePvt('',CrossRefIni)
NumberOfSections = ItemCount(CRISectionList,@Tab)
For x = 1 to NumberOfSections
	CurrentSection = ItemExtract(x,CRISectionList,@Tab)
	If StrIndexNc (CurrentSection,'OutlookProfile - ','1',@FwdScan)
		KeywordList = IniItemizePvt(CurrentSection,CrossRefIni)
		NumberOfKeywords = ItemCount(KeywordList,@Tab)
		For y = 1 to NumberOfKeywords
			CurrentKeyword = ItemExtract(y,KeywordList,@Tab)
			If StrIndexNC(CurrentKeyword,'PAB','1',@FwdScan) > 0 || StrIndexNC(CurrentKeyword,'PST','1',@FwdScan) > 0 
				CurrentValue = IniReadPvt(CurrentSection,CurrentKeyword,'',CrossRefIni)
				If !FileExist(CurrentValue)
					FileWrite(ExportLog,StrCat('ERROR!',@Tab,'File does not exist -->',@Tab,CurrentValue))
					Errors_Outlook = Errors_Outlook + 1
				EndIf
				FileWrite(FileList,CurrentValue)
			EndIf
		Next
	EndIf
Next 

Article ID:   W16195
File Created: 2004:03:30:15:43:14
Last Updated: 2004:03:30:15:43:14