Back again
Used radimus' script to register Kixtart...with some changes for my editor
code:
$kix="HKEY_CLASSES_ROOT\.KIX"
$kixautofile="HKEY_CLASSES_ROOT\KIX_auto_file"
AddKey("$kix")
WriteValue("$kix","","KIX_auto_file",REG_SZ)
AddKey("$kixautofile")
WriteValue("$kixautofile","","KiXtart Script",REG_SZ)
WriteValue("$kixautofile","EditFlags","0",REG_SZ)
AddKey("$kixautofile\DefaultIcon")
WriteValue("$kixautofile\DefaultIcon","","%windir%\system32\SHELL32.dll,21",REG_EXPAND_SZ)
AddKey("$kixautofile\shell")
WriteValue("$kixautofile\shell","","Run",REG_SZ)
AddKey("$kixautofile\shell\Edit")
AddKey("$kixautofile\shell\Edit\command")
WriteValue("$kixautofile\shell\Edit\command","","C:\Program Files\RWK Systems\KiXscripts Editor\KiXscriptEditor.exe %1",REG_EXPAND_SZ)
AddKey("$kixautofile\shell\Run")
AddKey("$kixautofile\shell\Run\command")
WriteValue("$kixautofile\shell\Run\command","","%windir%\kix32.exe %1",REG_EXPAND_SZ)
This should be OK, right? I made allowances for my Kixtart editor.
Now running Shawn's OLE e-mail.
code:
Break on
CLS
$recipient = "kirk@@volvotruckcentre.com" ; use double @@'s
$subject = "This is the subject"
$message = "This is the message body"
$outlook = OLECreateObject("outlook.application")
$namespace = Val("&" + OLECallFunc($outlook, "getnamespace", "s", "MAPI"))
$= OLECallFunc($namespace, "logon")
$mailitem = Val("&" + OLECallFunc($outlook, "createitem", "s", "0"))
$recipients = Val("&" + OLEGetProperty($mailitem, "recipients"))
$ = OLECallFunc($recipients, "add", "s", "$recipient")
$ = OLEPutProperty($mailitem, "subject", "s", "$subject")
$ = OLEPutProperty($mailitem, "body", "s", "$message")
$ = OLECallFunc($mailitem, "send")
$ = OLECallFunc($namespace, "logoff" )
$ = OLEReleaseObject($recipients)
$ = OLEReleaseObject($mailitem)
$ = OLEReleaseObject($outlook)
Exit
The Code errors on this line:
code:
$namespace = Val("&" + OLECallFunc($outlook, "getnamespace", "s", "MAPI"))
It's strange because running throught the debugger it displays this line:
$outlook = OLECreateObject("outlook.application")
and then repeats this part:
("outlook.application")
It's almost like it doesn't recognize the OLE reference. This may be a matter of it not allowing Outlook to be used by Kixtart in spite of the registration.
Kirk
P.S. I'm doing it in OLE first to see if I can get it working and then I'll translate it into COM.