Hi!
I've been using the code below to send the results of a form on our intranet
using the users Outlook installation. I've recently learned that it's not
working on all machines. Normally, the user would complete the form, click
SUBMIT, and there would be a security popup warning that another application
was trying to use Outlook. The uesr would click YES and the message would be
sent.
The error is "ActiveX component can't create object: 'Outlook.Application'
I believe that one of two things might be causing this (please correct me if
I'm wrong)...
1) The security settings in IE or an IE security update is preventing the
VBScript to work. I've set the Intranet and Internet settings as low as
possible and still get the error. My development machine may not have all
the updates that the problem machine has.
2) The machine with the error is running Outlook 2003. My development
machine runs Outlook 2002 and has no issues. Do I need to use a different
object to make this 2003 compatible? Is there a setting in Outlook 2003 that
would allow this to work?
3) ... Any other ideas???
All machines are running WinXP Pro with SP1.
Any help is appreciated.
'*************************************************
'*
'* Send an HTML email message using users Outlook
'*
'* strTo = List of addresses to send to
'* strFrom = Senders name/address
'* strSubject = Subject line of message
'* strMsg = Message content - HTML formatted
'*
'*************************************************
sub OutlookHTMLSend( strTo, strFrom, strSubject, strMsg )
Set objOlApp = CreateObject("Outlook.Application")
Set objMsg = objOlApp.CreateItem(olMailItem)
objMsg.To = strTo
objMsg.Subject = strSubject
objMsg.HTMLBody = strMsg
objMsg.Save
'Show message and let user edit and send manually.
' !! Formatting is messed up if user has Word set as their email editor. !!
'objMsg.Display
'Just send message. User may get security warning
objMsg.Send
'Destroy object
set objMsg = Nothing
set objOlApp = Nothing
'Send user to index page
document.location ="default.asp"
end sub