Hi,
We are implementing a default stationery following company colors, font types and all that stuff in Outlook. Stationery and all the settings are working fine.
I need to copy the default stationery from the logon server to the client at every logon.
Copying the file seems to go OK but the script copies the file to the folder it is running from and not to the folder I specify. I replaced the destination path with c:\test and it works fine. Only one little problem, outlook can't open stationery from any other folder then its default folders.
Been trying for two days, ready to destroy my computer now.
Does anybody have an idea?
The code that's troubling me starts at the start her line and stops at the stop here line. All other lines work fine.
code:
;===============================================================================================
;**** Created with KiXscripts Editor | http://KiXscripts.com ****
;**** Last Modified on 22-05-2003 at 11:50:19 ****
;===============================================================================================
;
;Sets default stationery for outlook XP (10.0)
;
;Check if outlook is installed
$Outlookexist = Exist ("c:\program files\microsoft office\office10\outlook.exe")
If ($Outlookexist = 1) Goto copy_stationery
Goto End
;
:copy_stationery
$userprofile = %userprofile%
$USerprofile1 = $Userprofile + "\Application Data\Microsoft\Stationery\"
;
; start here
If Exist ("$Userprofile1" + "CorpStationery.htm") = 0
Shell "%COMSPEC% /E:1024 /C COPY " + @LDRIVE + "\Stationery\CorpStationery.htm" $Userprofile1
Else
$LOCAL = GetFileTime ("$Userprofile1" + "CorpStationery.htm")
$LOGON = GetFileTime (@LDRIVE + "\Stationery\" + "CorpStationery.htm")
If ($LOCAL <> $LOGON)
Shell "%COMSPEC% /E:1024 /C COPY " + @LDRIVE + "\Stationery\CorpStationery.htm" $Userprofile1
EndIf
EndIf
; stop here
;
;Set stationery
;
;Find User ID
$User = EnumKey("HKEY_USERS", 1)
;
;set mail format to HTML (65536 for plain text, 196610 for rich text, 131072 for HTML)
$rc = WriteValue("HKEY_USERS\$User\Software\Microsoft\Office\10.0\Outlook\Options\Mail", "EditorPreference", "131072", "REG_DWORD")
;
;Set Company stationery
;
;Add the key
$rc = AddKey("HKEY_USERS\$User\Software\Microsoft\Office\10.0\Common\MailSettings\NewStationery")
; Write value to the key
$rc = WriteValue("HKEY_USERS\$User\software\Microsoft\Office\10.0\Common\MailSettings", "NewStationery", "CorpStationery", "REG_EXPAND_SZ")
;
:End
_________________________
Mart
- Chuck Norris once sold ebay to ebay on ebay.