outlook

Looping through specific subfolders in outlook containing a specific string

被刻印的时光 ゝ 提交于 2020-08-10 19:16:55
问题 I want to look for specific items inside specific subfolders in Outlook (macro VBA) that can be in first or second level subfolder, however I cannot make it to work. I have found other questions that loop through all the items in all folders, but not that go through all items in specific subfolders. fldrname = "Clearing" Set objNS = GetNamespace("MAPI") Set ClearingFolders = Outlook.Folders("Clearing", objNS.Folders) For Each ClearingFolders In objParentFolderCollection For Each folder In

Runtime error “-2147024809” Moving Sent Mails To SentMail-Folder of secondary account

余生颓废 提交于 2020-08-09 12:41:54
问题 I have two accounts open in Outlook. When I send a Mail via the secondary account it appears in the sent folder of the primary account. I want to move the sent mail to the sent folder of the secondary account whenever I send mail. Option Explicit Private WithEvents inboxItems As Outlook.Items Private Sub Application_Startup() Dim outlookApp As Outlook.Application Dim objectNS As Outlook.NameSpace Set outlookApp = Outlook.Application Set objectNS = outlookApp.GetNamespace("MAPI") Set

Runtime error “-2147024809” Moving Sent Mails To SentMail-Folder of secondary account

瘦欲@ 提交于 2020-08-09 12:41:49
问题 I have two accounts open in Outlook. When I send a Mail via the secondary account it appears in the sent folder of the primary account. I want to move the sent mail to the sent folder of the secondary account whenever I send mail. Option Explicit Private WithEvents inboxItems As Outlook.Items Private Sub Application_Startup() Dim outlookApp As Outlook.Application Dim objectNS As Outlook.NameSpace Set outlookApp = Outlook.Application Set objectNS = outlookApp.GetNamespace("MAPI") Set

Outlook - programmatically modify email currently being composed/edited

Deadly 提交于 2020-08-09 09:13:35
问题 For valid personal reasons** I am trying to construct a macro that clears out the To, CC, Subject and Body of the email being replied to (in compose mode?). What I have below works on an email being READ, but it does not work on an email being MODIFIED/COMPOSED. What must be changed for the macro to work on an email being composed/edited? Sub ClearEmail() Dim olExplorer As Explorer Dim olSelection As Selection Dim email As MailItem Dim strSig As String, Sig As String Set olExplorer =

VBA Excel Outlook Email Body Formatting

混江龙づ霸主 提交于 2020-08-09 07:03:24
问题 I have useform that sends emails automatically. I want to change the body of the email - some of it will be based on a cell with text so it could be dynamic and some will be fixed in the code. for now - in runs me an error of object required, i'll be thankful for help. I want every line in the body of the email to be separate. Sub sendMail(ByVal mail As String, name As String, Msht As Worksheet, CCmail As Integer, CCperson As String) Dim applOL As Outlook.Application Dim miOL As Outlook

Sending multiple attachments from excel sheet with VBA

浪尽此生 提交于 2020-08-07 21:27:38
问题 I have the existing code to send a mail from a Sheet in my Excel file - Sub CreateMail() Dim objOutlook As Object Dim objMail As Object Dim rngTo As Range Dim rngSubject As Range Dim rngBody As Range Dim rngAttach As Range Set objOutlook = CreateObject("Outlook.Application") Set objMail = objOutlook.CreateItem(0) Application.ScreenUpdating = False Worksheets("Mail List").Activate With ActiveSheet Set rngTo = .Range("B1") Set rngSubject = .Range("B2") Set rngBody = .Range("B3") Set rngAttach =

Sending multiple attachments from excel sheet with VBA

荒凉一梦 提交于 2020-08-07 21:26:42
问题 I have the existing code to send a mail from a Sheet in my Excel file - Sub CreateMail() Dim objOutlook As Object Dim objMail As Object Dim rngTo As Range Dim rngSubject As Range Dim rngBody As Range Dim rngAttach As Range Set objOutlook = CreateObject("Outlook.Application") Set objMail = objOutlook.CreateItem(0) Application.ScreenUpdating = False Worksheets("Mail List").Activate With ActiveSheet Set rngTo = .Range("B1") Set rngSubject = .Range("B2") Set rngBody = .Range("B3") Set rngAttach =

Outlook adding destination URL in square brackets after hyperlink in HTML e-mail

亡梦爱人 提交于 2020-08-07 03:52:11
问题 Bit of a head scratcher here, and I'm still waiting on some details. The client reported that in Outlook, they are seeing the link in square brackets after the A tag. This apparently just started with the most recent round of e-mails I did for them, but the link code has not changed. Here is an example of a link : <p style='margin-bottom:20px !important;' > <a href="https://www.fepblue.org/pilot/login" style="color:#005172; text-decoration:none; font-weight: bold; font-size:18px;">Visit