Hi Kent [Smile]

I'm really glad you like some of my mods. To answer your question regarding Instant messaging, I find that it gets disabled with the reg setting in its current place so I am happy to leave it. As for using the transforms, shame on you [Wink] I find that scripting will almost always give a finer degree of control.

We have been able to get the transforms working but they don't fulfil our requirements. By using the outlook code we setup archiving to the user's personal file server share. This gives good intellectual property management and enables the user to see their personal/archive folder if they logon to another machine.

I've changed the code slightly below. I have now added a a reg setting to switch on spell checking and have added a str2hex function.

Cheers,

Richard

code:
:Outlook

$Company='CSIRO'
; Do you want users to delete all deleted items on Exit from Outlook?
$DeleteItems = 'Yes'
; Is it Winnt or 2K?
If (@Inwin = 1)
; Windows NT Registry Locations
$ProfileLocation='HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\'
Else
; Windows 9x Registry Locations
$ProfileLocation='HKCU\Software\Microsoft\Windows Messaging Subsystem\Profiles\'
EndIf

$OutlookExe=ReadValue('HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\Outlook.EXE','')
; Get version of executable for MS-Outlook
$OutlookVersion=GetFileVersion($OutlookExe)
$Vers=SubStr($OutlookVersion,1,InStr($OutlookVersion,'.')+1)

$DefaultProfile=ReadValue($ProfileLocation,'DefaultProfile')

; If no default profile exists, the outlook profile is not the default or the default profile is incorrectly configured,
; setup a new profile for the user
If $DefaultProfile='' OR NOT KeyExist($ProfileLocation+$DefaultProfile) OR NOT InStr(ReadValue($ProfileLocation+$DefaultProfile+'\13dbb0c8aa05101a9bb000aa002fc45a','001e3001'),$LastName)

; Copy the default profile to the temporary directory
Copy $ExePath+'\Outlook\Custom.PRF' $temp
$CustomProfile = $temp+'\Custom.PRF'
If $HomeDrive='' $HomeDrive='U:' EndIf
; Profile name
$=WriteProfileString($CustomProfile,'General','ProfileName','@USERID')
; Auto archive file
$=WriteProfileString($CustomProfile,'General','AutoArchiveFile',$HomeDrive+'\@USERID.pst')
; Auto archive file
$=WriteProfileString($CustomProfile,'Service1','AutoArchiveFile',$HomeDrive+'\@USERID.pst')
; Mail box name
$=WriteProfileString($CustomProfile,'Service1','MailBoxName','@USERID')
; Mail box name
$=WriteProfileString($CustomProfile,'Service2','MailBoxName','@USERID')
; Exchange server
$=WriteProfileString($CustomProfile,'Service2','HomeServer',$ExchangeServer)
; Personal folder location
If $MapPref='Yes'
$=WriteProfileString($CustomProfile,'Service3','PathToPersonalFolders',$HomeDrive+'\@USERID.PST')
Else
$=WriteProfileString($CustomProfile,'Service3','PathToPersonalFolders',$Temp+'\@USERID.PST')
EndIf

$OfficeLM = 'HKLM\Software\Microsoft\Office'
$OfficeCU = 'HKCU\Software\Microsoft\Office'

; Process Company Name
$=WriteValue($OfficeCU+'\'+$Vers+'\Common\UserInfo','Company',Str2Hex($Company),'REG_BINARY')
; Process FullName
$=WriteValue($OfficeCU+'\'+$Vers+'\Common\UserInfo','UserName',Str2Hex(@FULLNAME),'REG_BINARY')
; Process Initials
$=WriteValue($OfficeCU+'\'+$Vers+'\Common\UserInfo','UserInitials',Str2Hex(SubStr($FirstName,1,1)),'REG_BINARY')

Select
; If it is Outlook 98 or Outlook 2000, configure the following keys and values (e.g. 9.0.0.2416)
Case $Vers='8.0' OR $Vers = '9.0'
; Generate the Inbox
; If you use RUN instead of SHELL, the script will pause and not complete properly
Shell $ExePath+'\Outlook\Profgen.exe '+$ExePath+'\Outlook\NEWPROF.EXE -P '+$CustomProfile+' -X -R'
; Create default profile
$=WriteValue($ProfileLocation,'DefaultProfile', @USERID, 'REG_SZ')
; Check the box to empty deleted items on leaving Outlook - Now the we have the Outlook Profile Generated
If $DeleteItems = 'Yes'
$=WriteValue($ProfileLocation+@USERID+'\0a0d020000000000c000000000000046','000b0115','0100','REG_BINARY')
EndIf
; Set the Machine Name
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook','Machine Name','@WKSta','REG_SZ')
; Check Internet E-Mail Accounts
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook','CheckInternetAccounts','1','REG_DWORD')
; Has Outlook been Setup?
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook','FirstRunDialog','False','REG_SZ')
; Primary Client?
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Setup','PrimaryClient','1','REG_DWORD')
; Corporate or POP3? - Needs to be a machine setting
$=WriteValue($OfficeLM+'\'+$Vers+'\Outlook\Setup','MailSupport','0','REG_DWORD')
; Corporate or POP3? - Needs to be a machine setting
$=WriteValue($OfficeLM+'\'+$Vers+'\Outlook\Setup','First-Run','df83b12adc9cd511b57c0002a57ce19c','REG_BINARY')
; Set the default mail preference as Rich Text format 196609 is Word, 199610 Rich Text Format
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Options\Mail','EditorPreference','131072','REG_DWORD')
$=WriteValue('HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\'+@USERID+'\0a0d020000000000c000000000000046','001e0360','','REG_SZ')
; Changes the view to get rid of the Outlook Bar and show the 'Explorer View'
$Expview = '010000002c0000000200000003000000ffffffffffffffffffffffffffffffff62000000270000003c030000ac02000001000000000000000100000000000000c00000006400000003000000'
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Office Explorer','Frame',$Expview,'REG_BINARY')
; Set the default Font to be Verdana 10 pt
$PlTextFont = '3c0000000f0000e800000040c80000000600000000000000002056657264616e61000200000000000000000000000000201a493a38e9070001000000'
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Preferences','PlainTextFont',$PlTextFont,'REG_BINARY')

; If it is Outlook 2002 or 2003, configure the following keys and values
Case $Vers = '10.0' OR $Vers='11.0'

; No extra EXEs or files other than the PRF needed for Outlook 2002 or 2003
; This is discussed at: http://www.slipstick.com/outlook/ol2002/prftips.htm
$=WriteProfileString($CustomProfile,'General','BackupProfile','NO')

; This is discussed at the bottom of - http://www.microsoft.com/office/ork/xp/four/outc03.htm
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Setup','ImportPRF',$CustomProfile,'REG_SZ')
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook','Machine Name','@WKSTA','REG_SZ')
$=DelValue($OfficeCU+'\'+$Vers+'\Outlook\Setup','First-run')
; Import the profile for outlook
Run $OutlookExe+' /importprf '+$CustomProfile
Sleep 1

; Set the default mail preference as Rich Text format 196609 is Word, 199610 Rich Text Format
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Options\Mail','EditorPreference','131072','REG_DWORD')
; Set the default mail editor to word
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Options\Mail','UseWordMail','0','REG_DWORD')
; Set the default Font to be Verdana 10 pt
$PlTextFont = '3c0000000f0000e800000040c80000000600000000000000002056657264616e61000200000000000000000000000000201a493a38e9070001000000'
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Preferences','TextFontSimple',$PlTextFont,'REG_BINARY')
; Changes the view to get rid of the Outlook Bar and show the 'Explorer View'
$Expview = '010000002c0000000200000003000000ffffffffffffffffffffffffffffffff2c0000002c00000084020000dc01000001000000000000000100000000000000c0000000640000001800000003000000'
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Office Explorer','Frame',$expview,'REG_BINARY')
; Check the box to empty deleted items on leaving Outlook - Now the we have the Outlook Profile Generated
If $DeleteItems = 'Yes' $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Preferences','EmptyTrash','1','REG_DWORD') EndIf
; Enable spell check before sending
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Options\Spelling','Check',1,'REG_DWORD')
; Disable Instant Messaging
$=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\IM','Enabled','0','REG_DWORD')

EndSelect
EndIf

Return


Function Str2Hex($InputString)
For $x = 1 to Len($InputString)
$Str2Hex=$Str2Hex+DecToHex(Asc(SubStr($InputString,$x,1)))+'00'
Next
$Str2Hex=$Str2Hex+'0000'
EndFunction