Page 1 of 1 1
Topic Options
#74357 - 2003-04-09 09:06 AM Read receipts setting for OE and Outlook
onlinrgames Offline
Fresh Scripter

Registered: 2002-07-23
Posts: 27
Hi,

We would like to set the "Read receipts" setting in Microsoft Outlook and Outlook Express to a default "Notify me for each read receipt request".

I have written a script which works fine if there is only one identity configured in OE or Outlook. But, if there is more than one, the script does not set for all identities.

Would greatly appreciate if somebody could shed some light on how to achieve it for all users. My code is given below for your reference.
code:
 
Break On
$var_name = ReadValue("HKEY_CURRENT_USER\Identities","Default User ID")
$reg_value_OE = ReadValue ("HKEY_CURRENT_USER\Identities\$var_name\Software\Microsoft\Outlook Express\5.0","SendMDN")
$Outlook_exist = KeyExist ("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Options\Mail")
$reg_value_MO = 3 ; Dummy value for Microsoft Outlook registry value
If $Outlook_exist = 1
$reg_value_MO = ReadValue ("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Options\Mail","Receipt Response")
EndIf

Select
Case ($reg_value_OE = 1) OR ($reg_value_MO = 0)
$Mail_App_Setting = 1
Case ($reg_value_OE = 2) OR ($reg_value_MO = 1)
$Mail_App_Setting = 2
Case ($reg_value_OE = 4) OR ($reg_value_MO = 2)
$Mail_App_Setting = 3
EndSelect

If ($Mail_App_Setting = 1) OR ($Mail_App_Setting = 2)
$mod_reg_OE = WriteValue ("HKEY_CURRENT_USER\Identities\$var_name\Software\Microsoft\Outlook Express\5.0","SendMDN","4","REG_DWORD")
If $Outlook_exist = 1
$mod_reg_MO = WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Options\Mail","Receipt Response","2","REG_DWORD")
EndIf
EndIf
Exit

Regards

Onlinegames

Top
#74358 - 2003-04-09 09:24 AM Re: Read receipts setting for OE and Outlook
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
mm...
easiest might be to enumerate all identities...

so, your script would look something like:


$index=0
$var_name = enumkey("HKEY_CURRENT_USER\Identities",$index)
while @error=0 and len($var_name)
 $reg_value_OE = ReadValue ("HKEY_CURRENT_USER\Identities\$var_name\Software\Microsoft\Outlook Express\5.0","SendMDN")
 $Outlook_exist = KeyExist ("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Options\Mail")
 $reg_value_MO = 3 ; Dummy value for Microsoft Outlook registry value
 If $Outlook_exist = 1
  $reg_value_MO = ReadValue ("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Options\Mail","Receipt Response")
 EndIf

 Select
 Case ($reg_value_OE = 1) OR ($reg_value_MO = 0)
  $Mail_App_Setting = 1
 Case ($reg_value_OE = 2) OR ($reg_value_MO = 1)
  $Mail_App_Setting = 2
 Case ($reg_value_OE = 4) OR ($reg_value_MO = 2)
  $Mail_App_Setting = 3
 EndSelect

 If ($Mail_App_Setting = 1) OR ($Mail_App_Setting = 2)
  $mod_reg_OE = WriteValue ("HKEY_CURRENT_USER\Identities\$var_name\Software\Microsoft\Outlook Express\5.0","SendMDN","4","REG_DWORD"
  If $Outlook_exist = 1
   $mod_reg_MO = WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Options\Mail","Receipt Response","2","REG_DWORD")
  EndIf
 EndIf
 $index=$index+1
 $var_name = enumkey("HKEY_CURRENT_USER\Identities",$index)
loop

_________________________
!

download KiXnet

Top
#74359 - 2003-04-09 10:42 AM Re: Read receipts setting for OE and Outlook
onlinrgames Offline
Fresh Scripter

Registered: 2002-07-23
Posts: 27
Hi Lonkero,

Thanks a lot for the suggestion. Worked like a charm .. [Smile]

But, I guess, I should have checked the manual to see if there is any command which would have helped me.. [Frown]

Regards

Onlinegames

Top
#74360 - 2003-04-09 03:40 PM Re: Read receipts setting for OE and Outlook
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You could also use ArrayEnumKey() from the UDF Forum to retrieve all identities first before looping through them.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (mole) and 1300 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.05 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org