outlook-vba

Forwarding Outlook Item as attachment and adding it to a category in the same VBA macro

ⅰ亾dé卋堺 提交于 2019-12-12 05:12:42
问题 I have a macro that works for forwarding multiple Outlook items as attachments. I've pasted that below, but I want it to also add the forwarded message(s) to a category in outlook. So, not only would it forward the items that are in my inbox to the recipient, but it would also mark those items in a certain category. This way I could track which items I have forwarded using the macro. As it is now, it will show me the item has been forwarded on such and such date, but that may have been just a

Outlook VBA losing formatting with replace function and .HTMLBody won't work

浪子不回头ぞ 提交于 2019-12-12 04:55:17
问题 I took the liberty of scouring the Outlook VBA stack overflow section of the site, and could not find anything related to this question. I have a template I created. When I open the template the formatting is already as I want it and the signature auto-populates at the end of the message. I have created a macro that prompts for the following information and then replaces my tags in the message with the information I entered in Input Boxes. After using Google (a LOT) I tried using myItem.Body

Extract Zipped file from Outlook mail

时光毁灭记忆、已成空白 提交于 2019-12-12 04:35:02
问题 I'm trying to extract an zip file from my Outlook mail. Below is my script but its throwing an error object variable or with block variable not set. On oApp.NameSpace((FileNameFolder)).CopyHere oApp.NameSpace((Atchmt.FileName)).Items How I fix it. Sub Unzip() Dim ns As NameSpace Dim Inbox As MAPIFolder Dim SubFolder As MAPIFolder Dim Atchmt As Attachment Dim FileName As String Dim msg As Outlook.MailItem Dim FileNameFolder As String Dim FSO As Object 'variables for unzipping Dim oApp As

Code ignores incoming Meeting request

大兔子大兔子 提交于 2019-12-12 04:15:19
问题 I have a code for Outlook that processes any incoming item and if given criteria are passed a new appointment is to be created in Outlook calendar from mail items only. The code does not differentiate between mail item and meeting request item. This results in the system creating a new meeting in year 1899 from the meeting item instead ignoring this. Private Sub Application_NewMailEx(ByVal EntryIDCollection As String) On Error Resume Next Set ns = Application.Session arr = Split

Want to trigger Automate reply after click on a link in Outlook mail

╄→尐↘猪︶ㄣ 提交于 2019-12-12 04:14:52
问题 I am doing an Automation on outlook where End user will receive a mail where their will be a link by clicking on which an auto reply mail will be trigger and go to respective person. The code i Tried So far is mentioned below. Sub MailURL() Dim OutApp As Object Dim OutMail As Object Dim strbody As String Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) strbody = "<HTML><BODY>" strbody = strbody & "xxx@xxx.com" strbody = strbody & "</BODY></HTML>" On Error

run a macro when creating new appointment in outlook

邮差的信 提交于 2019-12-12 04:08:17
问题 I'm new to outlook vba. I'd like to run a macro when I create a new appointment in mycalendar in Outlook 2016 32bit I tried with Private WithEvents appt As Outlook.AppointmentItem Private Sub appt_Write(Cancel As Boolean) MsgBox ("test ok") End Sub in the ThisOutlookSession module but nothing happens when I edit anda save a new appointment. What I have to do? 回答1: You apt variable is never initialized and remains null. Try to use Application.Inspectors.MewInspector event to check when a new

Change an Outlook reply/forward message when composing using vba

大憨熊 提交于 2019-12-12 04:00:55
问题 When replying, forwarding (or basically doing any sort of response to an email item), I would like to change the body of the email. I know how to do this on the "send" event, but I would rather do this before composing so I can see change. Using send: Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) On Error Resume Next Set RegX = CreateObject("VBScript.RegExp") With RegX .pattern = "[a regular expression that I want to fix in the email body]" .Global = True

Move incoming email to folders with RegEx in a rule

て烟熏妆下的殇ゞ 提交于 2019-12-12 03:51:54
问题 I am trying to use a regular expression to filter incoming messages by looking at the subject line and if it contains 6 consecutive digits, move it to a particular folder. I found a script online which I have been trying to modify. I want to place these emails in a folder called ' AMEX ' which is a subfolder of the main Inbox. Sub filter(Item As Outlook.MailItem) Dim ns As Outlook.NameSpace Dim MailDest As Outlook.Folder Set ns = Application.GetNamespace("MAPI") Set Reg1 = CreateObject(

Send mail with specific mailbox defaults from Outlook with POP3 or Exchange

走远了吗. 提交于 2019-12-12 03:44:17
问题 With multiple email account Mailboxes attached to one Outlook client, how can I choose one of the Mailboxes (in code) and generate and send a MailItem that has all the default characteristics of that Mailbox, such as the default signature, reply-to address, priority etc. etc. Is there a way to do that easily using VBA? By easily, I mean how can it be done without explicitly identifying and copying all the required properties from one place to another. There are probably many more of them than

Programmatically change font properties in email body

倾然丶 夕夏残阳落幕 提交于 2019-12-12 03:38:49
问题 I have been successfully programming this in PowerPoint VBA but haven't been able to make it work on Outlook. I have an email ready to be sent in Outlook 2013 I want to scan the body of the email for bold text (i.e., bold characters) and change its color to red (nice to have) Exclude from the macro the signature I tried several attempts with "Substitute", "if"-loop but no success. Thanks a lot for putting me on the right track. The following code converts the color of the body but does not