Results 1 to 3 of 3

Thread: Outlook has to be running to send mail.

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Location
    flipside of MI
    Posts
    3

    Angry Outlook has to be running to send mail. HELP!!!

    Im trying to send an email automatically with the push of a button. The only problem is that Outlook has to be running in order for the program to work. If outlook is not running, I get an error message (see mvberror.jpg below).

    My code is;

    Dim response
    response = MsgBox("Do you want to send a message to Bev telling her you made a copy of " & lstfiles.FileName, vbYesNo, "STOP")
    If response = vbYes Then 'User chose yes.


    Dim objOutlook As New Outlook.Application
    Dim ObjOutlookMsg As Outlook.MailItem
    Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
    With objOutlookMsg
    .To = "email address"
    .Subject = "test"
    .Body = "Bev, " & vbNewLine
    .Body = .Body & "I made a copy of drawing number: ** " & lstfiles.FileName
    .Body = .Body & " **, from the Bravo folder. " & vbNewLine & vbNewLine
    .Body = .Body & "Thanks"
    .Send
    End With

    Set objOutlookMsg = Nothing
    Set objOutlook = Nothing
    End If


    When I press debug on the error, it returns me to

    "Set objOutlookMsg = objOutlook.CreateItem(olMailItem)"

    I dont want to have Outlook running in order to send the file. If anyone can help I would truely appreciate it.

    Thanks in advance,
    el guapo
    Attached Images Attached Images  
    Last edited by el guapo; May 18th, 2001 at 09:26 AM.
    "The cheese is old and moldy, where's the bathroom?"

Posting Permissions

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



Click Here to Expand Forum to Full Width