View Single Post
  #3  
Old May 3rd 06, 05:19 PM posted to microsoft.public.windows.inetexplorer.ie6_outlookexpress
Miyahn
external usenet poster
 
Posts: 39
Default send to mail recipient

"Alby" wrote in message
hi folks operating OE as default mail but when using send to (to take
advantage of photo insertion sizes) outlook opens.


Try this HTA(Html Application).

!-- FileName : MyMailerEn.hta --
htmlhead
meta http-equiv=Content-Type content="text/html; charset=us-ascii"
titleSelection of Mail Client/title
hta:application scroll="no"/
script language=vbs
Option Explicit
Const ClientKey = "Software\clients\mail\"
Const W = 300, H = 200: Dim Form
With window
.resizeTo W, H
.moveTo (screen.availWidth - W) \ 2, (screen.availHeight - H) \ 2
End With
'
Sub Initialize()
Dim Client, SubKeys, aSubKey, aOption
Set Form = document.all
With CreateObject("WScript.Shell")
On Error Resume Next
Client = .RegRead("HKCU\" & ClientKey)
If Err Then Client = .RegRead("HKLM\" & ClientKey)
On Error GoTo 0
End With
If EnumKey("HKLM\" & ClientKey, SubKeys) 0 Then Me.Close
For Each aSubKey In SubKeys
Set aOption = document.createElement("option")
Form.Clients.options.add(aOption)
aOption.innertext = aSubKey: aOption.value = aSubKey
If aSubKey = Client Then aOption.selected = True
Next
End Sub
'
Sub SetClient
With CreateObject("WScript.Shell")
.RegWrite "HKCU\" & ClientKey, Form.Clients.value
If Form.CB1.Checked Then _
.RegWrite "HKLM\" & ClientKey, Form.Clients.value
End With
End Sub
'
Function EnumKey(ByVal MainKey, SubKeys)
Const HKCR = "HKEY_CLASSES_ROOT", HKCU = "HKEY_CURRENT_USER"
Const HKLM = "HKEY_LOCAL_MACHINE", Tmp = "Temp.reg"
Dim Buf, Pat, cRes, aRes, aKey
Select Case Left(MainKey, 4)
Case "HKCR": MainKey = HKCR & Mid(Mainkey, 5)
Case "HKCU": MainKey = HKCU & Mid(Mainkey, 5)
Case "HKLM": MainKey = HKLM & Mid(Mainkey, 5)
End Select
With CreateObject("WScript.Shell")
.Run "Regedit /e " & Tmp & " """ & MainKey & """", 0, True
End With
With CreateObject("Scripting.FileSystemObject")
If Not .FileExists(Tmp) Then EnumKey = 1: Exit Function
With .OpenTextFile(Tmp, 1, False, -2)
Buf = .ReadAll: .Close
End With
.DeleteFile Tmp
End With
Pat = "\[" & Replace(MainKey, "\", "\\") & "\\([^\]\\]+)"
With New RegExp
.IgnoreCase = True: .Global = True
.Pattern = Pat: Set cRes = .Execute(Buf)
End With
If cRes.Count = 0 Then EnumKey = 1: Exit Function
With CreateObject("Scripting.Dictionary")
For Each aRes In cRes
aKey = aRes.SubMatches(0)
If Not .Exists(aKey) Then .Add aKey, ""
Next
SubKeys = .Keys(): EnumKey = 0
End With
End Function
'
/script/headbody onload=Initializeform
pChange Mail Client invoked by br
   'SendTo - MailRecipient'br/p
pClient : select id=Clients/selectbr
input type=checkbox id=CB1Change also Default Client/p
p align=centerinput type=button value=Set onclick=SetClient
    input type=button value=Quit onclick=close/p
/form/body/html

--
Miyahn (Masataka Miya****a) JPN
Microsoft MVP for Microsoft Office - Excel(Jan 2006 - Dec 2006)


Ads