Click here to Skip to main content
15,881,600 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionCrystal reports [modified] Pin
Ghost_80723-Jul-09 10:24
Ghost_80723-Jul-09 10:24 
QuestionHow to access the textbox data embedded in a datalist Pin
MacIntyre23-Jul-09 9:01
MacIntyre23-Jul-09 9:01 
QuestionHi there. Looking for help on a vb project. Pin
malcomhfc23-Jul-09 3:27
malcomhfc23-Jul-09 3:27 
AnswerRe: Hi there. Looking for help on a vb project. Pin
David Mujica23-Jul-09 3:38
David Mujica23-Jul-09 3:38 
GeneralRe: Hi there. Looking for help on a vb project. Pin
DoctorMick23-Jul-09 5:36
DoctorMick23-Jul-09 5:36 
AnswerRe: Hi there. Looking for help on a vb project. Pin
Jabbar_espania2-Aug-09 11:03
Jabbar_espania2-Aug-09 11:03 
GeneralRe: Hi there. Looking for help on a vb project. Pin
malcomhfc8-Aug-09 8:12
malcomhfc8-Aug-09 8:12 
QuestionMicrosoft Outlook: VBA Syntax Errors in Trying to Search for Recipients in E-Mail Message Body Pin
axla22-Jul-09 19:59
axla22-Jul-09 19:59 
I've looked at several examples (not the database piece yet for capturing the "Yes" instances) and put together the code listed below. In a prior version of code also in the ItemSend Object the user is presented with the message box like I want and if they select "No" the E-Mail message is not sent.

However, when I tried to modify the code (see below) I get the Microsoft VB error:
"Run-time error '424' Object Required

Can someone help me correct my code statement and also let me know if I have the correct syntax for searching the body of the E-Mail message. I created a test E-Mail message with "Joe" in the body of the message. If I can't figure out the database piece, is the only option I have hard coding the names of all the restricted employees?


Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim olMail As Outlook.MailItem
Set olMail = olapp.CreateItem(olMailItem)
Dim blnExecute As Boolean

If InStr(olMail.Body, "Joe") <> 0 Then

blnExecute = CBool(MsgBox("You are sending " & _
"or forwarding an E-Mail message from a " & _
"restricted employee, do you wish to " & _
"continue?", vbYesNo, "Rule Execution") = vbYes)

If blnExecute = True Then

'Eventually want some code to capture that
'the end-user chose to send the E-Mail
'message.

ElseIf blnExecute = False Then

Cancel = True 'this will cancel the send

End If

End If

Thanks for your help as always.


axla
Questioncode for automatic select value from ms-excel column Pin
muhammadataulhaqsultani22-Jul-09 17:57
muhammadataulhaqsultani22-Jul-09 17:57 
AnswerRe: code for automatic select value from ms-excel column Pin
Sumit Prakash Sharma22-Jul-09 21:26
professionalSumit Prakash Sharma22-Jul-09 21:26 
GeneralRe: code for automatic select value from ms-excel column Pin
muhammadataulhaqsultani23-Jul-09 16:08
muhammadataulhaqsultani23-Jul-09 16:08 
QuestionMulti-D Array comparisons Pin
Member 437454222-Jul-09 15:18
Member 437454222-Jul-09 15:18 
AnswerRe: Multi-D Array comparisons Pin
Luc Pattyn22-Jul-09 15:47
sitebuilderLuc Pattyn22-Jul-09 15:47 
GeneralRe: Multi-D Array comparisons Pin
Member 437454222-Jul-09 16:09
Member 437454222-Jul-09 16:09 
GeneralRe: Multi-D Array comparisons Pin
Luc Pattyn22-Jul-09 16:10
sitebuilderLuc Pattyn22-Jul-09 16:10 
QuestionHow do I modify a class so you can convert a String to it? Pin
i_kant_spel22-Jul-09 9:48
i_kant_spel22-Jul-09 9:48 
AnswerRe: How do I modify a class so you can convert a String to it? Pin
Luc Pattyn22-Jul-09 10:36
sitebuilderLuc Pattyn22-Jul-09 10:36 
GeneralRe: How do I modify a class so you can convert a String to it? Pin
Gideon Engelberth22-Jul-09 12:36
Gideon Engelberth22-Jul-09 12:36 
GeneralRe: How do I modify a class so you can convert a String to it? Pin
Luc Pattyn22-Jul-09 12:49
sitebuilderLuc Pattyn22-Jul-09 12:49 
GeneralRe: How do I modify a class so you can convert a String to it? Pin
i_kant_spel22-Jul-09 15:37
i_kant_spel22-Jul-09 15:37 
GeneralRe: How do I modify a class so you can convert a String to it? Pin
Gideon Engelberth22-Jul-09 16:02
Gideon Engelberth22-Jul-09 16:02 
GeneralRe: How do I modify a class so you can convert a String to it? Pin
Gideon Engelberth22-Jul-09 15:50
Gideon Engelberth22-Jul-09 15:50 
GeneralRe: How do I modify a class so you can convert a String to it? Pin
i_kant_spel22-Jul-09 17:42
i_kant_spel22-Jul-09 17:42 
AnswerRe: How do I modify a class so you can convert a String to it? Pin
Steven J Jowett23-Jul-09 1:48
Steven J Jowett23-Jul-09 1:48 
GeneralRe: How do I modify a class so you can convert a String to it? Pin
i_kant_spel23-Jul-09 5:48
i_kant_spel23-Jul-09 5:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.