Click here to Skip to main content
15,889,651 members
Home / Discussions / Visual Basic
   

Visual Basic

 
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 
AnswerRe: How to pass pre-processor directive to sub-projects Pin
Dave Kreskowiak25-Jun-18 4:14
mveDave Kreskowiak25-Jun-18 4:14 
GeneralRe: How to pass pre-processor directive to sub-projects Pin
mo149225-Jun-18 10:44
mo149225-Jun-18 10:44 
QuestionI tried to run your DirectX 9 example in vb.net but received an error Pin
Member 1128712325-Jun-18 3:15
Member 1128712325-Jun-18 3:15 
AnswerRe: I tried to run your DirectX 9 example in vb.net but received an error Pin
Dave Kreskowiak25-Jun-18 4:12
mveDave Kreskowiak25-Jun-18 4:12 
QuestionAccess to and capture NMEA sentences Pin
Member 1352644624-Jun-18 4:06
Member 1352644624-Jun-18 4:06 
AnswerRe: Access to and capture NMEA sentences Pin
Richard MacCutchan24-Jun-18 4:39
mveRichard MacCutchan24-Jun-18 4:39 
GeneralRe: Access to and capture NMEA sentences Pin
Member 1352644626-Jun-18 0:22
Member 1352644626-Jun-18 0:22 
GeneralRe: Access to and capture NMEA sentences Pin
Richard MacCutchan26-Jun-18 0:26
mveRichard MacCutchan26-Jun-18 0:26 
GeneralRe: Access to and capture NMEA sentences Pin
Member 135264463-Jul-18 0:44
Member 135264463-Jul-18 0:44 
GeneralRe: Access to and capture NMEA sentences Pin
Richard MacCutchan3-Jul-18 0:49
mveRichard MacCutchan3-Jul-18 0:49 
QuestionFFT example code in VB.net Pin
Member 1387059319-Jun-18 20:15
Member 1387059319-Jun-18 20:15 
AnswerRe: FFT example code in VB.net Pin
Richard MacCutchan19-Jun-18 21:29
mveRichard MacCutchan19-Jun-18 21:29 
Questionthe formula of excel Pin
أبوعبد الله عبد الله19-Jun-18 0:18
أبوعبد الله عبد الله19-Jun-18 0:18 
AnswerRe: the formula of excel Pin
Richard MacCutchan19-Jun-18 0:23
mveRichard MacCutchan19-Jun-18 0:23 
GeneralRe: the formula of excel Pin
أبوعبد الله عبد الله19-Jun-18 2:13
أبوعبد الله عبد الله19-Jun-18 2:13 

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.