J
Jack
Hi,
I need to maintain an Access application written by somebody else. We got a
form where there is a dropdown that has a list of user name. By the side of
this dropdown there is a send button. When a users chooses a dropdown contact
list and clicks send outlook form opens up with the corresponding fields
filled up in accordance with the following code:
Private Sub cmdCoOrdinator_Click()
On Error GoTo Err_cmdCoOrdinator_Click
If IsNull(txtcoordinator) Then GoTo Err_cmdCoOrdinator_email
Dim appOL As Outlook.Application
Dim testEmail As Outlook.MailItem
Set appOL = Outlook.Application
Set testEmail = appOL.CreateItem(olMailItem)
testEmail.Subject = "CAR-PAR# " & txtIDNum.Value
testEmail.To = txtcoordinator.Value
testEmail.body = cboCoOrdinator.Column(1) & ", a CAR-PAR has been issued for
" & cboPlants.Value & " that needs your attention."
'Display the email so you can amend details.
testEmail.Display
' this works, it causes a message box to pop up in Outlook saying an outside
program may be sending a virus
'testEmail.Send
'Clear the reference to the objects as we no longer need them.
Set testEmail = Nothing
Set appOL = Nothing
Exit_cmdCoOrdinator_Click:
Exit Sub
Err_cmdCoOrdinator_Click:
MsgBox Err.Description
Resume Exit_cmdCoOrdinator_Click
Err_cmdCoOrdinator_email:
If IsNull(txtcoordinator) Then MsgBox "You must select a name first!"
End Sub
Now I need to change the dropdown and instead with some trick get the
outlook address book to display and have the user choose the address from the
address book and then send the email.
I have not much of idea about how Access utilized Outlook email. Any help is
highly appreciate. Thanks in advance.
I need to maintain an Access application written by somebody else. We got a
form where there is a dropdown that has a list of user name. By the side of
this dropdown there is a send button. When a users chooses a dropdown contact
list and clicks send outlook form opens up with the corresponding fields
filled up in accordance with the following code:
Private Sub cmdCoOrdinator_Click()
On Error GoTo Err_cmdCoOrdinator_Click
If IsNull(txtcoordinator) Then GoTo Err_cmdCoOrdinator_email
Dim appOL As Outlook.Application
Dim testEmail As Outlook.MailItem
Set appOL = Outlook.Application
Set testEmail = appOL.CreateItem(olMailItem)
testEmail.Subject = "CAR-PAR# " & txtIDNum.Value
testEmail.To = txtcoordinator.Value
testEmail.body = cboCoOrdinator.Column(1) & ", a CAR-PAR has been issued for
" & cboPlants.Value & " that needs your attention."
'Display the email so you can amend details.
testEmail.Display
' this works, it causes a message box to pop up in Outlook saying an outside
program may be sending a virus
'testEmail.Send
'Clear the reference to the objects as we no longer need them.
Set testEmail = Nothing
Set appOL = Nothing
Exit_cmdCoOrdinator_Click:
Exit Sub
Err_cmdCoOrdinator_Click:
MsgBox Err.Description
Resume Exit_cmdCoOrdinator_Click
Err_cmdCoOrdinator_email:
If IsNull(txtcoordinator) Then MsgBox "You must select a name first!"
End Sub
Now I need to change the dropdown and instead with some trick get the
outlook address book to display and have the user choose the address from the
address book and then send the email.
I have not much of idea about how Access utilized Outlook email. Any help is
highly appreciate. Thanks in advance.