;Set a registry key to trigger Outlook to import the PRF file when Outlook starts up
;
; By Andrew Barnes
;
; Tested on OutlookXP, Windows2000 - Easy to modify for others
;
; Beginners : HOW TO: Create a PRF File (Q308300)
;The Custom Installation Wizard:
; Download orktools.exe from:
; The Custom Installation Wizard can be found in:
; "Start\Programs\Microsoft Office Tools\Microsoft Office XP Resource Kit Tools\Custom Installation Wizard"
; once Office XP Resource Kit (orktools.exe) is installed.
; orktools.exe can be found @ ;...
; Create a PRF File by Using the Custom Installation Wizard:
; The PRF file is a text file with syntax that Microsoft Outlook uses to generate a profile. By
; using a PRF file, you can Set up new profiles For users OR modify existing profiles without
; affecting other aspects of your Outlook (OR Microsoft Office) installation. You can also
; manually edit a PRF file to customize Outlook to include services that are NOT included
; In the Custom Installation Wizard user interface.
;Note: The most straightforward way to create a PRF file with Outlook 2002 profile settings is to
; customize the settings In the Custom Installation Wizard, AND then to export the settings to
; a PRF file.
;To create a PRF file In the Custom Installation Wizard:
;1. On the Outlook: Customize Default User Profile page of the wizard, Select how you want to
; customize profiles For your users. To specify settings to be included In a PRF file, Select
; Modify Profile OR New Profile, AND then click Next.
;
;2. On the Next three pages, customize the profile information, For example, configure Exchange
; server connections AND add accounts.
;
;3. On the Outlook: Remove Accounts AND Export Settings page, click Export Profile Settings.
; When you are prompted, type (OR browse to) a file name AND location.
$PrfFile = "C:\somewhere\on a\server\outlook.prf" ;This Variable = "full path and name of the source .prf file"
Function OutlookProfileConfiguration($PrfFile)
; Check for existing Outlook user profile
$def_profile = ReadValue ("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\", "DefaultProfile")
If @ERROR = 0
;A profile already exists! No need to Configure Outlook.
Exit 1
EndIf
; Check if OfficeXP has never run
$def_outlook = KeyExist("HKEY_CURRENT_USER\Software\Microsoft\Office\")
If Not($def_outlook) ; Key doesn't exist
;****************************************
;***if you use Office XP use this line***
;****************************************
$nul = AddKey("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Setup")
;******************************************
;***if you use Office 2003 use this line***
;******************************************
;$nul = AddKey("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Setup")
EndIf
; Check for existing Outlook user profile
$def_profile = ReadValue ("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\", "DefaultProfile")
If @ERROR = 0
;A profile already exists! No need to Configure Outlook.
Exit 1
EndIf
; Set Outlook to First Run State
;****************************************
;***if you use Office XP use this line***
;****************************************
$Firstrun = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Setup", "First-Run", "00,00,00,00,00,00,00,00", "REG_BINARY")
;******************************************
;***if you use Office 2003 use this line***
;******************************************
;$Firstrun = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Setup", "First-Run", "00,00,00,00,00,00,00,00", "REG_BINARY")
;This section needs to be modified to reflect the name and path of the PRF file
;****************************************
;***if you use Office XP use this line***
;****************************************
$ImportPRF = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Setup", "ImportPrf", $PrfFile, "REG_SZ")
;******************************************
;***if you use Office 2003 use this line***
;******************************************
;$ImportPRF = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Setup", "ImportPrf", $PrfFile, "REG_SZ")
;OutlookXP successfully configured.
EndFunction