Consulting

Results 1 to 5 of 5

Thread: Error while sending mail

  1. #1

    Error while sending mail

    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.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    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.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3

    Still in error

    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.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It would be a function in Outlook I think, not Excel.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Thanks. I was missing an Outlook function..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •