Click here to Skip to main content
15,921,660 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Visual Basic Codes 6.0 Pin
Dave Kreskowiak6-Jul-18 13:48
mveDave Kreskowiak6-Jul-18 13:48 
Questioncan't connect to finger print scanning device from windows server 2003 Pin
Meax5-Jul-18 0:36
Meax5-Jul-18 0:36 
AnswerRe: can't connect to finger print scanning device from windows server 2003 Pin
Richard Deeming5-Jul-18 1:38
mveRichard Deeming5-Jul-18 1:38 
GeneralRe: can't connect to finger print scanning device from windows server 2003 Pin
Meax5-Jul-18 8:06
Meax5-Jul-18 8:06 
Questionhow to highlight dates of Month Calendar from database windows form Pin
Meax2-Jul-18 20:01
Meax2-Jul-18 20:01 
AnswerRe: how to highlight dates of Month Calendar from database windows form Pin
Richard MacCutchan2-Jul-18 21:08
mveRichard MacCutchan2-Jul-18 21:08 
GeneralRe: how to highlight dates of Month Calendar from database windows form Pin
Meax2-Jul-18 22:19
Meax2-Jul-18 22:19 
GeneralRe: how to highlight dates of Month Calendar from database windows form Pin
Richard MacCutchan2-Jul-18 22:20
mveRichard MacCutchan2-Jul-18 22:20 
AnswerRe: how to highlight dates of Month Calendar from database windows form Pin
Richard Deeming3-Jul-18 0:48
mveRichard Deeming3-Jul-18 0:48 
GeneralRe: how to highlight dates of Month Calendar from database windows form Pin
Meax5-Jul-18 0:25
Meax5-Jul-18 0:25 
GeneralRe: how to highlight dates of Month Calendar from database windows form Pin
Mycroft Holmes5-Jul-18 13:00
professionalMycroft Holmes5-Jul-18 13:00 
GeneralRe: how to highlight dates of Month Calendar from database windows form Pin
Meax15-Jul-18 18:18
Meax15-Jul-18 18:18 
Questionhow to create a VB ActiveX interface Pin
Sakthiu1-Jul-18 23:50
Sakthiu1-Jul-18 23:50 
AnswerRe: how to create a VB ActiveX interface Pin
Richard MacCutchan2-Jul-18 0:27
mveRichard MacCutchan2-Jul-18 0:27 
Questionvb.net parsing of string data Pin
dcof26-Jun-18 6:23
dcof26-Jun-18 6:23 
AnswerRe: vb.net parsing of string data Pin
Richard MacCutchan26-Jun-18 6:30
mveRichard MacCutchan26-Jun-18 6:30 
GeneralRe: vb.net parsing of string data Pin
dcof26-Jun-18 7:41
dcof26-Jun-18 7:41 
GeneralRe: vb.net parsing of string data Pin
Richard MacCutchan26-Jun-18 8:40
mveRichard MacCutchan26-Jun-18 8:40 
AnswerRe: vb.net parsing of string data Pin
Richard Deeming26-Jun-18 12:14
mveRichard Deeming26-Jun-18 12:14 
GeneralRe: vb.net parsing of string data Pin
dcof27-Jun-18 10:52
dcof27-Jun-18 10:52 
QuestionHow to call a 'C' program function from VB code ? Pin
Sakthiu26-Jun-18 3:45
Sakthiu26-Jun-18 3:45 
AnswerRe: How to call a 'C' program function from VB code ? Pin
Richard MacCutchan26-Jun-18 6:25
mveRichard MacCutchan26-Jun-18 6:25 
QuestionHow to run .vba program from specific mail box Pin
Member 1388671525-Jun-18 13:02
Member 1388671525-Jun-18 13:02 
I have written a .VBA program with the help of few forums, this help me to notify if I send email to different domain.

I have three accounts in my mailbox, when I run the above .VBA program, it applies on all three accounts. What I need is, I need this program to be executed when I send email only from two accounts.

For example, I have three accounts "@acc-1", "@acc-2" & "@acc-3", I need to get notified only when I send email from "@acc-2" & "@acc-3". So that I can send email from "@acc-1" to other domains.

Here is my code, please help me with this concern.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim recips As Outlook.Recipients
Dim recip As Outlook.Recipient
Dim pa As Outlook.PropertyAccessor
Dim prompt As String
Dim strMsg As String

Const PR_SMTP_ADDRESS As String = "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"

Set recips = Item.Recipients
For Each recip In recips
Set pa = recip.PropertyAccessor
If InStr(LCase(pa.GetProperty(PR_SMTP_ADDRESS)), "@ex1.com") = 0 Then
If InStr(LCase(pa.GetProperty(PR_SMTP_ADDRESS)), "@ex2.com") = 0 Then
If InStr(LCase(pa.GetProperty(PR_SMTP_ADDRESS)), "@ex3.com") = 0 Then
strMsg = strMsg & " " & pa.GetProperty(PR_SMTP_ADDRESS) & vbNewLine
End If
End If
End If
Next

If strMsg <> "" Then
prompt = "This email will be sent outside of your company to:" & vbNewLine & strMsg & "Do you want to proceed?"
If MsgBox(prompt, vbYesNo + vbExclamation + vbMsgBoxSetForeground, "Check Address") = vbNo Then
Cancel = True
End If
End If
End Sub
AnswerRe: How to run .vba program from specific mail box Pin
Dave Kreskowiak25-Jun-18 17:26
mveDave Kreskowiak25-Jun-18 17:26 
QuestionHow to pass pre-processor directive to sub-projects Pin
mo149225-Jun-18 3:29
mo149225-Jun-18 3:29 

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.