A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Problem with ItemSend



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 7th 07, 08:47 PM posted to microsoft.public.outlook.program_addins
aj
external usenet poster
 
Posts: 1
Default Problem with ItemSend

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
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 07:05 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.