|
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
|
|
|
|
|
The VBA code doesn't run for a specific account. There's no way to make that happen. Instead, what you have to do is check the FROM address on the email and determine if it's from the account you want.
|
|
|
|
|
Hello,
I've searched around and cannot find an answer for this; maybe it can't be done.
I need to pass a conditional directive (TEST = 1) to a sub-project.
I've defined the directive in the Advanced Compile Options as shown 'TEST = 1'
without single quotes and it works in the primary project but the sub-project does not detect it.
In sub-project I test just like the primary project:
#if TEST = 1 then
' do something
#end if
If this can be done, could someone tell me how?
Thank you
|
|
|
|
|
Each projects stands on it's own. Compiler directives don't "trickle down" from one project to another.
You have to define the directive in each project where you want it to apply.
|
|
|
|
|
Thanks for the info
|
|
|
|
|
Add reference to Microsoft visual C Versions 7.0.5000
error was due to CustomVertex.TransformedColored.Format
|
|
|
|
|
It's not "our" example.
Articles are supported by the people who wrote them, all volunteers.
Post your question at the bottom of the article you're referring to.
|
|
|
|
|
Hello friends
I have a MONTANA 680 GPS device and I want to extract NMEA sentences from the device by VB.Net. My GPS radio has the option "NMEA IN/OUT" among other settings. My ASUS laptop has no COM port. It has only usb ports. I use SERIALPORT object to read the NMEA sentences. But the code gives the error COM port,say, com3, does not exist. Do I need to make some special setting on my GPS radio? How do I code to access and get NMEA sentences? I use Visual Basic programming language.
Thank you very much for your help.
modified 24-Jun-18 10:14am.
|
|
|
|
|
Check which COM port the device actually shows up on when you connect it.
|
|
|
|
|
Hi Friend,
Thank you for your response. When I connect Montana 680 to the USB port, it is shown as a mass storage device in Device Manager (Serial Bus). I need to get NMEA sentences from the gps device. However I do not know how to do it. My VB.net code works well with the Etrex Vista gps device that uses COM port.
But I really do not know how to resolve the problem with MONTANA 680.
Thank you for any help of you.
|
|
|
|
|
|
Hi friend
My gps device is connected to my ASUS laptop through usb (cable) and has no COM ends.
|
|
|
|
|
You need to do what I suggested before and study the documentation for the device.
|
|
|
|
|
Hi,
I want to implement the FFT spectrum analysis in VB.net.Can anyone provide me the example code in vb.net
Regards
Teja
|
|
|
|
|
|
what is the formula of excel to calculate several numbers and mem temp compare if the sum is equal or not, if the sum is equal then it is variate if not to increase to the next number
|
|
|
|
|
|
thank you
I said as following
789944 45416 664545 6654646 666666 6464664 6668 12369
835360 = 789944+45416 or 789944+664545 or 6654646+12369 or ..........
|
|
|
|
|
Message Closed
modified 3-Jun-20 9:16am.
|
|
|
|
|
Well I already suggested that two years ago, so why are you telling me?
|
|
|
|
|
Well, where else is he supposed to push his spam links?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
Hello everyone, my program works when running(.exe file) and viewing my report on the location where the project is initially created. But when I copy and paste the whole project folder to a USB device..it fails to view the report. (I hope I was clear enough )
Here is the error I'm having
************** Exception Text **************
System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex
at System.String.Remove(Int32 startIndex, Int32 count)
at docutracker.frmReportView1.fillreport1() in C:\Users\josephkikoy\source\repos\DocumentTracker\docutracker\frmReportView1.vb:line 14
at docutracker.frmReportView1.frmReportView1_Load(Object sender, EventArgs e) in C:\Users\josephdegorio\source\repos\DocumentTracker\docutracker\frmReportView1.vb:line 59
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2671.0 built by: NET471REL1LAST
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
docutracker
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Release/docutracker.exe
Can you help me how to resolve this issue?
Best regards,
tacbanon
modified 17-Jun-18 7:08am.
|
|
|
|
|
tacbanon wrote: System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex
You have an index to an array or list that is too large or too small. Check the code at the line mentioned in the error message. If necessary use your debugger to see exactly which variable is causing the problem.
|
|
|
|
|
Hi,
I need someone who uses/used Visual Basic to answer a few questions as an "interview" for a class. Respond if willing.
Thanks!
|
|
|
|