outlook-vba

Updating email subject in Outlook VBA

╄→尐↘猪︶ㄣ 提交于 2019-12-22 08:26:08
问题 I am trying to create a button-controlled macro that would change the topic of an email message. Following this thread I've managed to came up with this: Public Sub Confidential() Dim Item As Outlook.MailItem Dim oInspector As Inspector Dim strSubject As String Set oInspector = Application.ActiveInspector If oInspector Is Nothing Then Set Item = Application.ActiveExplorer.Selection.Item(1) Else Set Item = oInspector.CurrentItem End If strSubject = Item.Subject ' Remove previous Confidential

Outlook Wait a few seconds then execute

杀马特。学长 韩版系。学妹 提交于 2019-12-22 05:00:31
问题 I have a simple VBA code in Outlook 2010 which prints any incoming emails automatically. This script is set to run each time an email comes in through a rule. Here is the code: Sub printradu(Item As Outlook.MailItem) MessageAndAttachmentProcessor Item, True End Sub How can i make this script wait 10 seconds and then execute it. I need something like this: Sub printradu(Item As Outlook.MailItem) 'Wait 10 seconds then execute the code below: MessageAndAttachmentProcessor Item, True End Sub 回答1:

Outlook Object Library Does Not Switch Between Versions 12 And 14

做~自己de王妃 提交于 2019-12-22 04:45:17
问题 I have a .dotm template file on a network share. There are macros with references to the Word, Office, and Outlook object libraries. We use two different platforms, Windows XP and Windows 7, along with Microsoft Office 2007 and Office 2010. When users open the template file the references for Word and Office adjust automatic and accordingly (that is, they’re set to Microsoft Word 12 Object Library or Microsoft Word 14 Object Library as needed), and the macros run without a problem. Microsoft

Copy data in a structured text block from Outlook message to Excel sheet

家住魔仙堡 提交于 2019-12-22 01:33:01
问题 An integer number follows "Purchase Order:" in the email body. All emails follow this format. http://i.stack.imgur.com/1Ck9Q.jpg The number is to be pasted into the next empty row of the Excel spreadsheet. I have a spreadsheet on my desktop named "test" to try this with. I've tried about 4 or 5 different VBA codes I found using Google with no luck. 回答1: A method to address this frequently asked question is shown here. http://social.msdn.microsoft.com/Forums/en-US/f1ab97d9-8fef-46cc-bbe0

Outlook Download Files from Hyperlink

六眼飞鱼酱① 提交于 2019-12-22 01:18:41
问题 I'm looking for some assistance with automating a task I do several times per day. I receive emails from a certain address which I automatically sort (using Rules) into a dedicated folder. These emails contain hyperlinks to documents to download from the web; however the links are not written as a URL, rather there is a link saying "Download all Documents". I click on this link, it opens the URL which is a zip file of all the documents. I then save this zip file in a certain naming format

Fire an Outlook 2003 macro when the user creates a new blank message

夙愿已清 提交于 2019-12-21 05:27:35
问题 I found events that fire when the user receives a message, or hits the send button, but nothing that fire when the user creates a blank, new email. 回答1: You should be able to use the NewInspector event. Example: Public WithEvents myOlInspectors As Outlook.Inspectors Private Sub Application_Startup() Initialize_handler End Sub Public Sub Initialize_handler() Set myOlInspectors = Application.Inspectors End Sub Private Sub myOlInspectors_NewInspector(ByVal Inspector As Outlook.Inspector) Dim msg

VBA to loop through email attachments and save based on given criteria

时光总嘲笑我的痴心妄想 提交于 2019-12-21 02:47:31
问题 This is a follow up from a previous question (VBA to save attachments (based on defined criteria) from an email with multiple accounts) Scenario: I have a code that loops through all e-mails in a certain outlook account, and saves the attachments to a selected folder. Previously, my problem was selecting which folder (and account) from where to extract the attachments (this was solved with a suggestion from the previous question). Issue 1: The code is presenting a "Type Mismatch" error at the

Open Outlook Mail .msg file using VBA from Excel

霸气de小男生 提交于 2019-12-20 20:43:08
问题 I'm trying to open .msg files from a specified directory using VBA but I keep getting a runtime error. The code i have: Sub bla() Dim objOL As Object Dim Msg As Object Set objOL = CreateObject("Outlook.Application") inPath = "C:\Users\SiliconPlus\Desktop\Si+ Contact Lists\Contact_Si+" thisFile = Dir(inPath & "\*.msg") Set Msg = objOL.CreateItemFromTemplate(thisFile) ' now use msg to get at the email parts MsgBox Msg.Subject Set objOL = Nothing Set Msg = Nothing End Sub Here is the runtime

extract email address from outlook

强颜欢笑 提交于 2019-12-20 06:33:58
问题 I am trying to extract email addresses of all emails in my Outlook inbox. I found this code on the Internet. Sub GetALLEmailAddresses() Dim objFolder As MAPIFolder Dim strEmail As String Dim strEmails As String ''' Requires reference to Microsoft Scripting Runtime Dim dic As New Dictionary Dim objItem As Object ''Set objFolder = Application.ActiveExplorer.Selection Set objFolder = Application.GetNamespace("Mapi").PickFolder For Each objItem In objFolder.Items If objItem.Class = olMail Then

Alert user when the user manually moves an email to an Archive folder

安稳与你 提交于 2019-12-20 06:28:22
问题 I have found myself accidentally moving email items to an Archive folder instead of the standard folder in MS Outlook. For example, for an email address of Example@Email.Com, I open the Archive to locate an old email in folder "KeepThis" but then I forget to collapse the Archive folder and so I inadvertently move some other email message later on into the Archive/KeepThis folder when I really wanted to move it to the Example@Email.Com/KeepThis folder. Is there a way to use VBA code to alert