mailitem

Looping through mailitems in Outlook macro freezes Outlook in large sets of mailItems

穿精又带淫゛_ 提交于 2020-06-29 03:33:29
问题 I am trying to loop through the mailItems of different subfolders looking for a comment (with PropertyAccessor) in different stores. My code works perfectly when given 1-3 stores and around 2000 mailItems, however as the number increases in the live testing it crashed Outlook not responding anymore. Do you have any idea how I could do it more efficient? I have implemented: Date filtering MailItem release And I am trying parallely the Application.AdvancedSearch method, however not managing yet

MailItem.HtmlBody throws a Not Implemented exception

只谈情不闲聊 提交于 2020-05-15 08:03:09
问题 I have a ribbon button that inserts text into an outlook Inspector by modifying the MailItem object based on the recipients in it. The method that gets called on click looks like this: public async void OnTemplateClick(Office.IRibbonControl control) { var templateId = control.Tag; var template = templates.GetTemplateById(templateId); await templateUi.SetTemplate(control.Context, template); } the SetTemplate method looks like this: public async Task SetTemplate(object window, Template template

Identify MS Excel or MS Access attachments and warn to check contents

。_饼干妹妹 提交于 2020-01-25 17:35:27
问题 Personal identifying information (PII) is often inadvertently transmitted through non-encrypted emails. Most of the times these data are stored in Excel or Access spreadsheets. I'd like to identify Access or Excel attachments after hitting send and ask "There are Access or Excel files attached to this email, are you sure these do not contain PII?" The criteria for identifying "xlsx" or "accdb" in the attachment name I just don't get. Private Sub Application_ItemSend(ByVal Item As Object,

Identify MS Excel or MS Access attachments and warn to check contents

白昼怎懂夜的黑 提交于 2020-01-25 17:35:11
问题 Personal identifying information (PII) is often inadvertently transmitted through non-encrypted emails. Most of the times these data are stored in Excel or Access spreadsheets. I'd like to identify Access or Excel attachments after hitting send and ask "There are Access or Excel files attached to this email, are you sure these do not contain PII?" The criteria for identifying "xlsx" or "accdb" in the attachment name I just don't get. Private Sub Application_ItemSend(ByVal Item As Object,

Outlook.MailItem.HTMLBody doesn't refresh when updated under inline response

梦想的初衷 提交于 2020-01-06 07:11:55
问题 When setting MailItem.HTMLBody for a inline response, sometimes the updated body never gets displayed. If I make a call to MailItem.Save() , sometimes it shows up but only under saved draft preview. Does anyone know of a way to force the updated HTMLBody to render? Some addition findings: For emails with only plain text (but MailItem.BodyFormat is OlBodyFormat.olFormatHTML ), this always happens. For emails with HTML content and images, this happens if user chooses to download external

Outlook.MailItem.HTMLBody doesn't refresh when updated under inline response

泄露秘密 提交于 2020-01-06 07:11:15
问题 When setting MailItem.HTMLBody for a inline response, sometimes the updated body never gets displayed. If I make a call to MailItem.Save() , sometimes it shows up but only under saved draft preview. Does anyone know of a way to force the updated HTMLBody to render? Some addition findings: For emails with only plain text (but MailItem.BodyFormat is OlBodyFormat.olFormatHTML ), this always happens. For emails with HTML content and images, this happens if user chooses to download external

Type Mismatch in mailitem loop

那年仲夏 提交于 2019-12-31 07:01:47
问题 Outlook 2010 VBA. Trying to search for flagged messages in all my folders. Created this: Private Sub flagrecurse(fold As Variant) Dim olItem As MailItem Dim nxtfold As Folder Dim olFoldVar As Variant 'Test for which folder is being checked MsgBox (fold.Name) If fold.Folders.Count > 0 Then For Each nxtfold In fold.Folders Set olFoldVar = nxtfold flagrecurse olFoldVar Next nxtfold Else For Each olItem In fold.Items 'Test for which item is being checked If TypeName(olItem) = "MailItem" Then

Shared Inbox - Skipping non-mail items in Outlook VBA

不想你离开。 提交于 2019-12-24 12:26:41
问题 I am not an expert in Outlook VBA but I have managed to create a few macros that work quite well. I have worked on the below code for some time and am now left with a minor problem. The macro imports information on every email from a sub-folder of a shared inbox into an excel file. The problem I have is when the for next loop encounters a non-mail item (e.g. a meeting invite or delivery failure notification). The code stops on the "Next" line and gives a "type mismatch" error when it

Resize a pasted JPEG in a MailItem

随声附和 提交于 2019-12-23 18:15:00
问题 I am trying to send a picture from an Excel sheet, but the size is very small. How could I get a decent size (basically the whole screen)? Here is the code: Sub send_as_a_pic() 'Copy range of interest Dim r As Range Set r = Range("B2:O23") r.Copy 'Open a new mail item Dim outlookApp As Outlook.Application Set outlookApp = CreateObject("Outlook.Application") Dim outMail As Outlook.MailItem Set outMail = outlookApp.CreateItem(olMailItem) With outMail .To = "fernando.grespan@fernando.com" .CC =

When is a MailItem not a MailItem? [closed]

为君一笑 提交于 2019-12-17 16:44:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I have written a message handler function in Outlook's Visual Basic (we're using Outlook 2003 and Exchange Server) to help me sort out incoming email. It is working for me, except sometimes the rule fails and Outlook deactivates it. Then I turn the rule back on and manually run it on my Inbox to catch up. The rule