Hi
I have been using the VB code below to send custom email messages from a button control. Using IP2003, Office 2003 and IE6 this has worked fine for the last 5 years or so.
Sub Respond_OnClick(eventObj)
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
'Set the recipient
.To = "person@address"
'Set the recipient for a copy
'.CC = "[email protected]"
'Set the subject
.Subject = "New subject"
'The content of the document is used as the body for the email
.Body = "Info"
'Add the document as an attachment, you can use the .displayname property
'to set the description that's used in the message
'.Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue, _
' DisplayName:="Document as attachment"
.Send
End With
If bStarted Then
oOutlookApp.Quit
End If
Recently some users have updated IE6 to IE7 or IE8 and the email buttons have stopped working. Outlook does not fire up and there are no error messages and no emails. I am guessing it is one of the settings in IE that needs to be changed.
Any ideas
Gary