![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
I am using VS2005 and wish to record details of an e-mail send from
my app but I can't seem to update my form when the message is sent. I have a simple form with one text box (txtMessage) and a button (btnMail). Clicking btnMail fires up Outlook and when the message is sent the ItemSend and Send events do fire but the do not allow me to update my text box. The MsgBox do not display either but the do when i comment out the txtMessage lines. What am I doing wrong??? It is as if my form is not accessible programatically in the outlook event code. I am using the following code: Imports Microsoft.Practices.EnterpriseLibrary.Data Imports System.Data Imports System.Data.Common Imports Microsoft.Office.Interop.Outlook Imports Microsoft.Office.Interop Public Class frmMailTest Dim WithEvents oApp As New Outlook.Application Dim WithEvents oMsg As Outlook.MailItem Private Sub btnMail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMail.Click oMsg = oApp.CreateItem(OlItemType.olMailItem) With oMsg .To = " .Subject = "Subject" .BodyFormat = OlBodyFormat.olFormatPlain .Body = "Type your message here" .Display() End With End Sub Private Sub oApp_ItemSend(ByVal Item As Object, ByRef Cancel As Boolean) Handles oApp.ItemSend txtMessage.Text = Item.body.ToString MsgBox("Mail Sent") End Sub Private Sub oMsg_Send(ByRef Cancel As Boolean) Handles oMsg.Send txtMessage.Text = oMsg.Body.ToString MsgBox("Mail Sent") End Sub End Class |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
ItemSend not firing | Luke | Outlook and VBA | 0 | August 23rd 07 09:20 PM |
Cancelling and closing a mailitem in itemsend event | bstrum | Add-ins for Outlook | 1 | June 19th 07 06:53 AM |
Write RTF-Body on ItemSend event | Thomas | Add-ins for Outlook | 2 | February 12th 07 12:22 PM |
ItemSend event differences betweek W2K & WXP | Lionel H | Outlook and VBA | 4 | October 20th 06 04:16 PM |
Is ItemSend really too late to set SentOnBehalfOfName ? | Oliver Giesen | Add-ins for Outlook | 5 | August 8th 06 07:19 PM |