The target is to run after Outlook started right away, addition to that when its run when a new item added.
Understood, so there is no proper way to call the already existing one, but better to create a separate one.
Al clear, BIG THANK YOU!
My problem is, that I don't know how to do it concretely. In details:
My code is in: Private Sub objItemsUNDELIVERED_itemAdd(ByVal Item As Object)
I tried to add this line to the Application_Startup() :
(null, because the Item is irrelevant for me in this case)...
May I ask if there is any way to call/trigger an _itemadd event manually from Application Startup() ?
I know it is called when new item added to the given folder, but e.g. when outlook starts, it does not get called, so I would like to call it manually. Important to say, that the...
I ran into a very strange issue. When Outlook is running, and a MailItem or Report item arrives, _itemAdd event for the folder in ThisOutlookSession triggers properly. But when the message arrives e.g. over the night and I turn on outlook in the morning, rules are executed, BUT the _itemAdd...
Seems it was usefull for some
Seems, it was useful for somebody else too. LOL!
BIG THANK YOU from me too!!
I was able to make it work both this solution and the other one you sent earlier. Hard to tell which one is more easier, but this one is definitively faster.
I also realized, that...
I was surprised too, when I realized, that addition to the body, it also has it in outlook To column. I even tried a "dirty trick" to execute a reply (objVariant.Actions.Item(1).Execute) and trying pick the address up from the to Address field (.Recipients.Item(1).Address), but it only gave me...
The email address is indeed in the message body (left bottom arrow), BUT the reason why I was looking for to catch the original sender TO address, as I was surprised to see, that the original address is available in outlook view pane TO column (top right arrow). So, if outlook has it, I am...
THANK YOU! I was able to work it out based on your help as follows:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Const ForAppending = 8
Set objTextFile = objFSO.OpenTextFile("D:\emails.txt", ForAppending, True)
It is working, BUT I had to realize...
Yeah, you right! :)
May I ask your help on an another question:
I am trying to check each email in a folder, and when it has a specific subject, I need to write the TO recipient to a txt file with append to the first line, and not whole file overwrite.
I was able to get to this point:
Brilliant! Again, you were right, I am an idiot. I assumed, that in case it isn't an exchange address, than SMTPaddress will be Null, but instead, it just kept the last value, without having any error. So, I just added SMTPaddress = "" before Next and the problem solved.
BIG BIG BIG Thank you!!!
While I was searching, I realized, that I could use the "AddressEntry.GetExchangeUser.PrimarySmtpAddress" property, to extract the real email address "masked" by the x500 GAL address. So i was able to make this working code below:
Dim SMTPRecipients As Outlook.Recipients
Dim SMTPaddress As...