outlook-2010

Outlook 2010 VBA How to save message including attachment

左心房为你撑大大i 提交于 2019-12-25 02:24:05
问题 Hello am using the following code to save messages to a folder, however if a message has an attachment it does not work. I know if I manually move a message to the hard drive the attachment is still within the *.msg file. I think it is how I am saving the message in this particular section oMail.SaveAs sPath & sName, olMSG How can I alter the following code to do this through VBA. Sub SaveMessageAsMsg() Dim oMail As Outlook.MailItem Dim objItem As Object Dim sPath As String Dim dtDate As Date

Insert Hyperlink in Outlook body

北慕城南 提交于 2019-12-24 13:05:00
问题 So I am trying to create a code to expedite inserting a hyperlink in Outlook. I am trying to have it so that if I have already copied a path, I can just go in and type Ctrl W and it will insert the hyperlink for the word here. My attempt at the code is: Sub InsertHyperlink() ' ' ' On Error Resume Next ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _ "U:\plot.log", _ SubAddress:="", ScreenTip:="", TextToDisplay:="here" End Sub I am having issues on how to update my code so

Access MS Outlook from Windows service

瘦欲@ 提交于 2019-12-24 10:58:46
问题 I try to access MS Outlook from service this way: oApp = new Outlook.Application(); oNS = (Outlook._NameSpace)oApp.GetNamespace("MAPI"); oNS.Logon(Missing.Value, Missing.Value, false, true); oFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox); If run this code as Windows Application it is working properly. But if I try run in as service I get error Server is not available at the line oNS.Logon(Missing.Value, Missing.Value, false, true); What is the right way to access MS

How to move mail to a folder based on attachment filename?

感情迁移 提交于 2019-12-24 02:34:15
问题 I need a rule (or most probably a VBA macro) to sort my mails. In case I have per say "REPORT" in the filename of the attachment of a newly received mail than I would like to move that mail to a different folder, let say "REPORTS" folder. How can I achieve this? I already to set a rule on the mail header but that did not seem to solve the matter. Thanks in advance! 回答1: Used code from http://www.outlookcode.com/article.aspx?id=62 and http://blog.saieva.com/2010/03/27/move-messages-to-folders

How to move mail to a folder based on attachment filename?

穿精又带淫゛_ 提交于 2019-12-24 02:34:10
问题 I need a rule (or most probably a VBA macro) to sort my mails. In case I have per say "REPORT" in the filename of the attachment of a newly received mail than I would like to move that mail to a different folder, let say "REPORTS" folder. How can I achieve this? I already to set a rule on the mail header but that did not seem to solve the matter. Thanks in advance! 回答1: Used code from http://www.outlookcode.com/article.aspx?id=62 and http://blog.saieva.com/2010/03/27/move-messages-to-folders

How to sync e-mail outlook2010 and sharepoint2010

你离开我真会死。 提交于 2019-12-23 16:23:35
问题 I need to sync emails between outlook2010 and sharepoint 2010. I have been searching, but found syncing contacts, calendars and tasks. Links and examples will be appreciated. Question: What is the best way to achieve this? 回答1: Take a look at the Sharepoint webpart OWAInboxPart which will display email from Exchange without having to store the emails within Sharepoint. 回答2: The question is Why? Outlook is a communication tool not a storage facility. There is an outlook web parts in SharePoint

Ribbon button not firing event set by onAction when clicked

余生长醉 提交于 2019-12-23 08:58:11
问题 I've designed an add-in to Outlook 2010 where I'm trying to fire (or, rather, catch) an event fired when a button is clicked as shown in this article. I've targeted the right XML (since the changes to it are seen on the ribbon). However, The event I'm trying to catch is either not fired at all or (more likely) fired an other way than what my listened is looking (listening?). I also tried to go by the reference on MSDN here, here and mostly here. To no avail, though... I wonder if it's got to

Code to download attachment from Outlook, save it on desktop and open it

*爱你&永不变心* 提交于 2019-12-23 04:45:54
问题 This is the code in Outlook that sets the rules in Outlook automatically to save the attachment (Excel) with date stamp: Public Sub saveAttachtoDisk(itm As Outlook.MailItem) Dim objAtt As Outlook.Attachment Dim saveFolder As String Dim dateFormat dateFormat = Format(Now, "yyyy-mm-dd H-mm") saveFolder = "c:\Users\abc1\Desktop\" For Each objAtt In itm.Attachments objAtt.SaveAsFile saveFolder & "\" & dateFormat & objAtt.DisplayName Set objAtt = Nothing Next End Sub Next step I want is to open

Set a MailItem as sent before calling SaveAs in Outlook Addin with C#

戏子无情 提交于 2019-12-23 02:46:20
问题 I am building an Outlook 2010 addin to integrate it with some business software and have trapped the ItemSend Event. I check if it is a MailItem and if it is I call the SaveAs function to save it as a .msg to the file system (in the users temp folder). void Application_ItemSend(object Item, ref bool Cancel) { if(Item is Outlook.MailItem) { Outlook.MailItem mailitem = (Outlook.MailItem)Item; string filename = "somefilename.msg"; string path = System.IO.Path.GetTempPath(); string fullPathName =

Outlook VBA - Run a code every half an hour with outlook 2010 64 bits

时光怂恿深爱的人放手 提交于 2019-12-22 13:55:20
问题 This question is done (and solved) before, see Outlook VBA - Run a code every half an hour I used the code fore several years on with no trouble on several computers running Vista (32 bit), Windows 7 and Windows 8.1 (all 64 bit). A new computer with a new office 2010 installation gives some problems. The 64 bit version of outlook seems to react different as the 32 bit version. I get errors with these lines Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long,