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 » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Send Message on Behalf Question



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old June 30th 08, 11:53 AM posted to microsoft.public.outlook.program_vba
Eka1618
external usenet poster
 
Posts: 3
Default Send Message on Behalf Question

Hello,

I am programming a DB in Access and I am getting the Error message "A
Program is trying to send an e-mail message on your bealf..." This only
occurs when I send a message without editing it first. I am sending messages
using: DoCmd.sendobject. Many of the resolustion I've seen is for another
method. Is there anyway I can get rid of this message using the style I have
chosen? Below is a sample of my VB. If anyone know what I can do, please let
me know. Thank you!

~Erica~

Public Sub SendRequest(frm As Form)
Dim emName, emName2 As String, varItem As Variant
Dim emailBody As String
Dim emailSubject As String

emailSubject = "Product Test Request (Tech. Team Leader next action)"

On Error GoTo btnSend_Click_error

frm.REQUEST_NO.SetFocus
emailBody = "Hello, " & vbCrLf & vbCrLf & _
"A product test request has been issued for Request Number: " &
frm.REQUEST_NO.Text & "." & _
vbCrLf & vbCrLf & "Please log into the Product Engineering Test Database
to review this request to continue the process, Thank You!"

For Each varItem In frm!lboRequestee.ItemsSelected
emName = emName & Chr(34) & frm!lboRequestee.Column(2, varItem) &
Chr(34) & ","
Next varItem

For Each varItem In frm!lboRequestor.ItemsSelected
emName2 = emName2 & Chr(34) & frm!lboRequestor.Column(2, varItem) &
Chr(34) & ","
Next varItem

'remove the extra comma at the end
'add the requestor to the e-mail list recipients
emName2 = Left$(emName2, Len(emName2) - 1)
emName = Left$(emName, Len(emName) - 1)

'send message
frm.Visible = False
DoCmd.SendObject acSendNoObject, , , emName, emName2, , emailSubject,
emailBody, True, False

btnSend_Click_error:
If Err.Number = 2501 Then
MsgBox "You just canceled the e-mail", vbCritical, "Alert"
End If
End Sub
 




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
Message sent on behalf KeithMeister Outlook - Installation 3 October 16th 07 04:04 PM
Rules Question: Mail sent on behalf of a recognized sender. John Bigelow Outlook - Installation 2 August 9th 07 02:16 PM
how use SEND BEHALF France Outlook - Installation 2 July 9th 07 09:46 PM
How to send on behalf of using VBA Bob Fishel Outlook and VBA 2 June 14th 07 08:02 PM
Send on Behalf of and More Joe Outlook - General Queries 1 April 25th 07 02:52 PM


All times are GMT +1. The time now is 03:27 AM.


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