outlook-2010

How to retrieve the Outlook folder of a mail item (Outlook.MailItem)?

筅森魡賤 提交于 2019-12-12 13:28:18
问题 I am getting my default inbox folder via inboxFolder = Globals.ThisAddIn.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox Elsewhere in my code, I begin doing a foreach loop to extract specific information I want from these MailItems foreach (var item in this.inboxFolder.Items) { Outlook.MailItem mailItem = (Outlook.MailItem)item; //.... doing stuff here string SenderEmail = mailItem.SenderEmailAddress; string SenderName = mailItem.SenderName; string FolderLocation =

Filter Outlook appointments by category

谁说我不能喝 提交于 2019-12-12 11:16:29
问题 I have written this code to find the total duration of all appointments of a specified category within a specified time range: private readonly MAPIFolder _timing; private int CalculateTotalDuration(DateTime start, DateTime end, string category) { string filter = String.Format( "([Start] >= '{0:g}') AND ([End] <= '{1:g}') AND ([Categories] = '{2}')", start, end, category); return _timing.Items.Restrict(filter).Cast<AppointmentItem>(). Sum(appt => appt.Duration); } This code results in the

Keep Outlook mailItem property (internet header) from being removed when forwarded/replied

最后都变了- 提交于 2019-12-12 09:25:32
问题 I'm trying to start up a thread of mails defined by the same ID (ID needs to be a specific value equal to the one in our database). I can assign a custom internet header just fine like this: sendMail.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/DCPID", taskId); Where the sendMail is an olMailItem and taskId is the id needed. When this mail is sent and recieved I can get my ID with the GetProperty method but when forwarded or

How to open Outlook's new mail window with prepopulated attachment

↘锁芯ラ 提交于 2019-12-12 07:29:50
问题 I need to open a new email window with a prepopulated attachment when a user clicks some button or link in my application. 回答1: Old question, but I also ran in to this so here's a copy and paste solution: Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application(); Microsoft.Office.Interop.Outlook.MailItem oMsg = (Microsoft.Office.Interop.Outlook.MailItem)oApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem); oMsg.Subject = "subject

Break long words in html email in outlook 2010

亡梦爱人 提交于 2019-12-12 07:18:39
问题 I'm taking end user input and inserting it into an HTML email. But if the end user enters a long URL or really long word, it breaks my HTML layout in Outlook 2010 by extending the column or div beyond the width specified. In Chrome, Firefox, IE7+, and Safari, I can use style="table-layout:fixed" in order to force the table columns to certain widths. But Outlook 2010 ignores this, and the long word pushes the table width out beyond the fixed width. With Divs, In Chrome, Firefox, IE7+, and

Attaching access form and subform data in mail body

痴心易碎 提交于 2019-12-12 03:54:49
问题 Thanks in advance :), I am trying to attach the data of subform also in mail body. Current Status: I am able to attach Main forms data and generate mail but unable to attach subform's data as it only includes the first row, Tryied doing it through Subform and query both but no success. I will prefer to do it by subform itself. Subform's Name is : "subUpdateOrder". VB Code: Private Sub InformCustomer_Click() On Error GoTo Err_InformCustomer_Click Dim CustName As String ' Customer Name Dim

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

is it possible to add a button to the right-click context menu for a user in Outlook 2010 using VBA?

喜你入骨 提交于 2019-12-12 03:16:53
问题 I've tried many things and read up quite a bit but I cannot figure this out. I cannot create an add-in so I have to use VBA. I want to add a a button to the right-click context menu when I right-click on a user. Is this possible? 回答1: Yes, it is possible to customize the context menu in Outlook. See Customizing Context Menus in Office 2010 for more information. But VBA doesn't allow to customize the Fluent UI in Outlook, you need to develop an add-in instead. 来源: https://stackoverflow.com

CreateObject on Outlook.Application fails on Outlook 2010 when Outlook is running under a different account

微笑、不失礼 提交于 2019-12-12 03:07:54
问题 The problem I'm running into is already described at Getting/Creating an Outlook Application in Windows 7 but I had a very hard time identifying the source of the problem because I happen to be maintaining an old VB6 application at the moment, and the errors that are reported from VB6 applications are not mentioned in that article. Furthermore, I'm looking for better solutions. The problem is that CreateObject("Outlook.Application") and GetObject(,"Outlook.Application") are failing with Error

Sending Automated Email from Access VBA through Outlook

夙愿已清 提交于 2019-12-12 03:05:26
问题 Ok, so I've been putting band aids on top of band aids on a simple snippet of code to get an email to send. What I've been trying to do is get an email to send through outlook. My first issue was runtime object define 287 at the following line: Set appOutlookRec = appOutlookMsg.Recipients.Add so to counter that I added: Set objNS = appOutlook.GetNamespace("MAPI") Set olFolder = objNS.GetDefaultFolder(olFolderInbox) And that stopped that. Now the email will form and I can use .display to see