outlook-vba

VBA: Send mail via Outlook in Excel for Mac 2011

丶灬走出姿态 提交于 2019-12-11 16:48:17
问题 On a Mac, Office 2011 (latest patches) I want to send a mail via Outlook Set mailer = CreateObject("Outlook.Application") which gives the error ActiveX component can't create object which seems believable since there is no ActiveX on the Mac. I tried to find alternative solutions, but they are quite dated (2011) the macro has to work on both Mac and Windows What is currently the best VBA way to send a mail via Outlook in Office Mac 2011? 回答1: cf/ http://msdn.microsoft.com/en-us/library

Error while Looping Through conditions for Outlook VBA Code

亡梦爱人 提交于 2019-12-11 15:54:36
问题 My original Question is here Looping through Arrays with VBA, to Move outlook emails from one folder to another? but i figured that the code i created was too complex. I simplified it as below, now it only has one array. Looping through Arrays with VBA, to Move outlook emails from one folder to another? - original question Sub MovingEmails_Invoices() 'Declare your Variables Dim NS As Outlook.Namespace Dim rootfol As Outlook.Folder Dim Fol As Outlook.Folder Dim subfolder As Outlook.Folder 'Set

Create Outlook Event using VBA (Not an appointment!)

倾然丶 夕夏残阳落幕 提交于 2019-12-11 15:48:45
问题 So there is a thread SO Link Here that links how to make an outlook "event" but in reality it creates an appointment, not an event. The differences can be read about HERE. My question is simple... How do I create an actual event, not an appointment using VBA? Thanks! 回答1: The different between Appointment and Event is Events lasts 24 hours or longer, as you know Events do not appear as occupied blocks of time in the user’s calendar. Instead, they appear as banners To create an all-day event

Extracting Attachments from *.msg files stored in many subfolders

余生长醉 提交于 2019-12-11 15:25:55
问题 The below code extracts attachments from *.msg files stored in one folder. I'm seeking to extract attachments from *.msg files stored in many subfolders within a folder. The path for the main Folder is: U:\XXXXX\XXXXX\Main Folder The paths for the subfolders are: U:\XXXXX\XXXXX\Main Folder\Folder1 U:\XXXXX\XXXXX\Main Folder\Folder2 U:\XXXXX\XXXXX\Main Folder\Folder3 etc. Sub SaveOlAttachments() Dim msg As Outlook.MailItem Dim att As Outlook.Attachment Dim strFilePath As String Dim strAttPath

VBA: how can I get a list of the SMTP email addresses for the current outlook user?

烂漫一生 提交于 2019-12-11 15:17:03
问题 I know how to get the primary email address of the current user, but how can I get a full list of all their SMTP email addresses? I'm looking for the information you can get when you right-click on a recipient in an email and go to "open outlook properties" and go to the "E-mail Addresses" tab thanks! 回答1: Read the PR_EMS_AB_PROXY_ADDRESSES MAPI property (DASL name http://schemas.microsoft.com/mapi/proptag/0x800F101F ) using Namespace.CurrentUser.AddressEntry.PropertyAccessor.GetProperty .

Exclude Signature images when Exporting attachments to a folder

♀尐吖头ヾ 提交于 2019-12-11 13:54:27
问题 I have code to export Outlook attachments to a local folder. I noticed the little images in the signature are also saved as attachments. I think excluding the signature images could be done with an If then along the lines of: For i = lngCount To 1 Step -1 If objAttachments.Item(i).Size > 6000 Then I don't know where to place in my code, especially the End If (after or before the Next). Here is my code: Public Sub Renamefileandexcludesignature(Item As Outlook.MailItem) Dim Atmt As Outlook

Open attachment in excel window and copy to open workbook

六眼飞鱼酱① 提交于 2019-12-11 12:12:21
问题 Using outlook VBA - I would like to open an attachment in a particular instance of excel, and then copy the sheets from that attachment into an open workbook. I've used a couple of code snippets from (Saving Outlook attachment with date in the filename and Check to see if Excel is open (from another Office 2010 App) to save an attachment from an email and then find the excel window I need to open it in - both work in isolated outlook test macros. Trouble is, I can't seem to link the two parts

How to add a signature in Excel VBA email?

做~自己de王妃 提交于 2019-12-11 12:10:29
问题 I use this VBA code to send an email when a user clicks a cell in a row. I want to add a signature, with an image, to my email body. How could I amend my code to put this in? Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Column = Range("BL1").Column Then If Target.Row > 7 And Target.Value = "Take Action" Then Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) strbody = "<p style='font-family:calibri;font-size:16'>" & "Dear Sirs," & "

Outlook .Restrict method does not work with Date

試著忘記壹切 提交于 2019-12-11 12:01:51
问题 Restrict() does not seem to accept a date value when it is specified outside. Public Sub EBS() Dim oMail As MailItem Dim sPath As String Dim dtDate As Date Dim dtRecDate As Date Dim sName As String Dim oNameSpace As Outlook.NameSpace Dim oInboxFolder As Outlook.Folder Dim oSentFolder As Outlook.Folder Dim i As Long Set oNameSpace = Application.GetNamespace("MAPI") Set oInboxFolder = oNameSpace.GetDefaultFolder(olFolderInbox) Set oSentFolder = oNameSpace.GetDefaultFolder(olFolderSentMail)

Disable Outlook Reply to All in Excel VBA

馋奶兔 提交于 2019-12-11 11:48:24
问题 i have a Excel VBA Macro that sends an email to multiple people. i don't want to hide who it has been sent to, i just want to disable the Reply to All function on outlook. I have tried the below, from outlook VBA, and it had no effect ActiveInspector.CurrentItem.Actions("Reply to All").Enabled = False ActiveInspector.CurrentItem.Actions("Forward").Enabled = False Here it is in the code. Set OutlMail = OutlApp.CreateItem(0) On Error Resume Next With OutlMail .To = sendto .Subject = "Update for