outlook-vba

How do I use ItemAdd on the Sent Items folder?

◇◆丶佛笑我妖孽 提交于 2019-12-20 04:38:13
问题 This question looks like it should have been answered here: Outlook VBA Save Copy Sent Item I am unable to find the referenced "Items.ItemAdd" event amongst the list of events in the VB Editor for Outlook 2016. Application.ItemSend is located in "ThisOutLookSession". The script I came up with looks 90% similar to the one posted in the original question and I have the same problem. The mail item is saved in it's pre-send condition. I can't use "MailItem.SaveSentMessageFolder" as I am trying to

VBA to select mailbox if an account has multiple mailbox's

十年热恋 提交于 2019-12-20 02:39:07
问题 Here is my requirement. I have multiple accounts in my OUTLOOK configured. 1) 1@email.com (only one mailbox) 2) 2@email.com (Multiple mailbox's are there. ex: Unix box, Windows Box, Mac box) Here my 2nd email account has its own mailbox and linked to multiple mailbox's like UNIX, Windows etc. Each Mailbox has its own inbox and sub folders. Now i need to select a folder in Unix box (inbox) and run the code to do something in side the folder. Here's what i have For Each oAccount In Application

Outlook Application_NewMailEx not working on startup

喜欢而已 提交于 2019-12-20 02:32:05
问题 I am using a Application_NewMailEx to treat all emails received. It works fine on emails received while Outlook is open. However on startup, the Application_NewMailEx does not get called by received emails. I tried using a Application_Startup but it is called before emails are received ==> does not work. There is no application.ontime to delay the startup macro... Application_NewMail does the same. How can it be done? Private Sub Application_NewMailEx(ByVal EntryIDCollection As String) INIT

Outlook 2010 - VBA - Set bcc in ItemSend

眉间皱痕 提交于 2019-12-20 02:28:57
问题 Program: Outlook 2010 OS: Win8 VBA Skill: Novice Notes: This works perfectly if I remove the following option Private Sub Application Item_Send '[3] If Item.SendUsingAccount = "Account Name here" Then If I do not remove it (keeping my BCC exception) the email on startup Private Sub Application _Startup runs however it BCCs only the email listed in item [3] = "special@domain.com". When part [3] is removed both run as coded. 1) 1 email on startup, BCCing all accounts listed to check the Macro,

VBA Issues converting string to date using format() or CDate()

房东的猫 提交于 2019-12-19 11:52:35
问题 If this has been asked before, please point me in the right direction. I can't seem to find anything useful with my google-ing skills. I have the following code, which reads in a string like this; Outage StartDate: 05/10/11 23:59 EST And pulls out the date information, i.e. 05/10/11 23:59 sStartTime = Mid(objItem.Body, 18, 15) ' Extract the start time Debug.Print "sStartTime after reading: " & sStartTime sStartTime = Format(sStartTime, "dd/mm/yy hh:mm") ' Format date correctly Debug.Print

How do I make the application.reminder event work?

北战南征 提交于 2019-12-19 11:37:12
问题 I have this code in a class module - as stated to on msdn and on this stackoverflow thread Public WithEvents objReminders As Outlook.Reminders Private Sub Application_Startup() Set objReminders = Application.Reminders End Sub Private Sub Application_Reminder(ByVal Item As Object) Call Send_Email_Using_VBA MsgBox ("Litigate!") End Sub I have tried using the code at the bottom of this thread and that won't launch either. All I can get is outlook's reminders popup. No breakpoints are ever hit,

VBA script for outlook to automatically open URLs from message body in a web browser, for all incoming mails

风格不统一 提交于 2019-12-19 10:17:26
问题 I'm pretty new to writing VBA scripts. Actually, I'm trying to write a small VBA script which will go through the newly received email, scan the body of the message and open all the urls(I'm targetting this script for a message which always contains a single URL) in a web browser like IE or FF or Chrome. I tried looking for similar Qs in SO and on Google. I found one here: How to launch a URL when an email arrives which is about how to open a URL when an email arrives. But it is always

Getting messageID from email in Outlook VBA 2003

我们两清 提交于 2019-12-19 09:24:31
问题 Is there a easy way to get the current shown (preferably selected) message-ID via VBA ? without having to buy Redemption or some other package.. I need to message ID so I can make a link to a web-application that reads the mail and does some other stuff with it Can't seem to use MAPI or PropertyAccessor in outlook 2003.. 回答1: Do you mean the unique ID for the message? Try the EntryID Property: ActiveExplorer.Selection.Item(1).EntryID FYI PropertyAccessor was added in Outlook 2007, you wouldn

VBA/IE How to get past file save prompt?

独自空忆成欢 提交于 2019-12-19 04:51:35
问题 We receive emails with links to documents, or more precisely, links to webpages that contain buttons we click to download documents. I want to automate this under Office 2016, IE 11, and Windows 7 Enterprise. I've gotten this far. In VBA, I set references to Microsoft HTML Object and Internet Controls libraries. I load the page, locate the button control on the page, and issue the button's click method. Then I get the prompt you see above. I want to save as... that is, each downloaded file

How to move all messages in a conversation?

为君一笑 提交于 2019-12-19 04:35:43
问题 I need to know how to move all of the messages in a conversation at once. My macro currently reads Sub Archive() Set ArchiveFolder = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Parent.Folders("Archive") For Each Msg In ActiveExplorer.Selection Msg.UnRead = False Msg.Move ArchiveFolder Next Msg End Sub But that only moves the latest message... and only when the conversation is fully collapsed! I can't Archive when the conversation is expanded. 回答1: If you want to handle