PC Review


Reply
Thread Tools Rate Thread

Outllok Automation

 
 
=?Utf-8?B?SkNQ?=
Guest
Posts: n/a
 
      1st Sep 2007
I created a function to attach file.
The function attaches the file and displays the outlook for the user. He can
add address or write something in the body text. When he finishes, click send
button and the email is gone and outlook window is closed.
Apparently it works well.

However, yesterday I received a message showing, the memory is low.
I open task manager and I saw many outlook instances open.

I verify the outlook still running. I set objOutlookMsg = Nothing and
Set objOutlook = Nothing

Is it possible somebody tell me what is wrong in my function?
Thanks a lot.
jcp
-----------------------
Here you are the function to attach files.

Function EmailAttachFile()
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim AttachFile As String

AttachFile = "C:\Test.doc"

Set objOutlook = CreateObject("Outlook.Application") ' Create the
Outlook session.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem) ' Create
the message.

With objOutlookMsg
.To = "jose perdigao"
.CC = ""
.BCC = ""
.Subject = "This is a test"
.Body = "Tell me if it works"
End With

If Dir(AttachFile) <> "" Then objOutlookMsg.Attachments.add AttachFile

objOutlookMsg.Display

Set objOutlookMsg = Nothing
Set objOutlook = Nothing

End Function

--
Jose
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Supressing the ctrl-c and other keys during word automation in automation apondu Microsoft VB .NET 1 23rd Jul 2007 10:45 PM
Supressing the ctrl-c and other keys during word automation in automation apondu Microsoft C# .NET 0 19th Jul 2007 10:15 PM
Supressing the ctrl-c and other keys during word automation in automation apondu Microsoft Word Document Management 0 19th Jul 2007 10:15 PM
Supressing the ctrl-c and other keys during word automation in automation apondu Microsoft ASP .NET 0 19th Jul 2007 10:10 PM
Supressing the ctrl-c and other keys during word automation in automation apondu Microsoft Excel Programming 0 19th Jul 2007 10:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:46 AM.