Hi
I've got two main VBA code written on Outlook for Profile-A, which sending reports by using two VBA function and working fine now those functions are as follows :-
Now we have some new recerds/reports using DAO recordset which have to use "Profile-2" for particular email address i.e. @xx. The profile has been setup and its working/open manually. but the problem is that when I opened the profile-1 its trying to send email of profile 2, its mentioned the profile-2 email can't be sent and I want avoid this message but don't know how.
I'm not its make sense to you or as English is not my first language.
Is there any way I can more interactive i.e chat/live online to convey my message as I have to do asap
Many thanks
Farhan
I've got two main VBA code written on Outlook for Profile-A, which sending reports by using two VBA function and working fine now those functions are as follows :-
Code:
-----------------------------
(1)
CheckQueue()
'Recordset
What it does is "RecordCout of 'rs'
If Found then
call the other function i.e.
'Cycle through records
For iCount = 1 To iMax
'Create new Email from data returned from DB
If GenerateEmail(rs!EmailTo & "", rs!EmailToCC & "", rs!Document & "", _
rs!BodyText & "", IIf(rs!AttachReport, rs!Attachment & "", "")) Then
rs.Edit
rs!SentTime = Now()
rs!Processed = True
rs.Update
End If
---------------------------------
Code:
(2)
Function GenerateEmail(sTo As String, sCC As String, sSubject As String, sBodyText As String, Optional sAttachment As String = "") As Boolean
Dim NewMessage As MailItem
On Error GoTo Err_Handler
Set NewMessage = Application.CreateItem(olMailItem)
With NewMessage
.SentOnBehalfOfName = "FarhanSyed@xxx.net"
.To = sTo
.CC = sCC
.Subject = sSubject
.BodyFormat = olFormatHTML
.Body = sBodyText
If sAttachment <> "" Then
.Attachments.Add Source:=sAttachment
End If
.DeleteAfterSubmit = True
.Send
DoEvents
End With
Set NewMessage = Nothing
GenerateEmail = True
Exit Function
--------
I'm not its make sense to you or as English is not my first language.
Is there any way I can more interactive i.e chat/live online to convey my message as I have to do asap
Many thanks
Farhan