PDA

View Full Version : Error while sending mail



callimaco008
04-30-2008, 05:00 AM
Hi all;

my problem is the following:
I'm using an Excel document with a macro which send automatically an e-mail message when an action is preformed.

The code of the macro is:

Set objOutlook = GetObject(, "Outlook.Application")
On Error GoTo 0

If objOutlook Is Nothing Then

'Outlook isn't already running - create a new instance...
Set objOutlook = CreateObject("Outlook.Application")
blnNewInstance = True

'We need to instantiate the Visual Basic environment... (messy)
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objExplorer = objOutlook.Explorers.Add(objNameSpace.Folders(1), 0)
objExplorer.CommandBars.FindControl(, 1695).Execute

objExplorer.Close

Set objNameSpace = Nothing
Set objExplorer = Nothing

End If
blnSuccessful = objOutlook.FnSendMailSafe(sTo, sCC, sBCC, sSubject, sBody, sAttachment)

When the macro is executed an error is generated. The error says that FnSendMailSafe is not a function supported by objOutlook.

I can't modify the code...I nedd only to now if I miss some libraries or modules in my Excel.

Any idea?

Thanks to all will help.

Bob Phillips
04-30-2008, 05:13 AM
That sounds like a local function that you don't have on your machine. Contact the person who provided the code and ask them about it.

callimaco008
04-30-2008, 06:09 AM
Hi.

I checked with a person who is using my same document on a different machine.
We have same libraries and same modules.
Looking with Object Browser, both of us don't find the function...but on his computer the application works.

What's missing?

Please help.

Bob Phillips
04-30-2008, 06:15 AM
It would be a function in Outlook I think, not Excel.

callimaco008
04-30-2008, 06:32 AM
Thanks. I was missing an Outlook function..