Quantcast
Channel: Outlook for Developers forum
Viewing all 6421 articles
Browse latest View live

How to access "Sent Items" (or other folders) folder in Excel (or other application)

$
0
0

This is not a question but more of an answer or technique.

Sub myReply()

    ' Create object variables
    Dim olApp As Object
    Dim nsn As Object
    Dim fd As Object
   
    Set olApp = CreateObject("Outlook.Application")
    Set nsn = olApp.GetNameSpace("MAPI")
   
    ' Please refer to msdn documentation on the integer 5 as argument to the call
    ' https://msdn.microsoft.com/en-us/library/office/aa211818(v=office.11).aspx
    Set fd = nsn.GetDefaultFolder(5)
   
    ' MsgBox (fd.Name)
End Sub

I had a hard time figuring this out since the GetDefaultFolder method takes a constant as its argument GetDefaultFolder(olFolderSentMail) but Excel will not accept it probably because the constant definitions were not loaded. Upon checking on the documentation website above, there a code that uses the number 9 to access the calendar folders using the GetDefaultFolder method. I have to make trial and error to check what number is the Sent Items folder and in multiple tries found the number "5"


When I double click the .ics file it should open in outlook my calendars?

$
0
0

i am export the all the appointment in .ics file format. As of now when i double click the .ics. It will open in other calendars. my users does not like this pattern. When the user double click the .ics file it should open in outlook my calendars. If any know how to do this implementation please help me. I am using Asp.net

Thanks, 

Arunkumar.

Integrating IM applications with Office

$
0
0

I am trying to create an IM Provider for Outlook 2016 with following msdn-specification:
https://msdn.microsoft.com/en-us/library/office/jj900715.aspx?f=255&MSPPError=-2147217396

I am using C#/.Net with CSExeCOMServer as a COM-Out-Of-Process Server:
https://code.msdn.microsoft.com/windowsapps/CSExeCOMServer-3b1c1054

But outlook is only calling the COM-Factory method but not the methods of IUCOfficeIntegration inteface.
What might be the problem? (is there a working sample solution?)

My visual studio solution + Outlook PCX log:
https://web.corner4.com/C4Downloads/OfficeIMProvider_TestSln.zip


How to modify Outlook template body using c#

$
0
0

I have outlook template with some content.

I have to replace the content of template and save into drafts using C#.net

I am using below solution.

Outlook.Application application = new Outlook.Application();

Outlook.MailItem mail = application.CreateItemFromTemplate(@"Some path") as Outlook.MailItem;

mail.Body = mail.Body.replace("-","XXX"); (*** getting error in this line)

mail.Save();

While I am trying with above code. I got the below Error.

Err Msg: Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))
Err Code: -2147467260

I used Microsoft.Office.Interop.Outlook;

Please provide me teh solution.

Thanks in Advance!

How to extract part of string in WIX bootstrapper

$
0
0

I need to extract a piece of a string from a value I get by the registry search in WIX. Following is the overall outline of what I am trying to do.

<util:RegistrySearchId="RegSearch"Root="HKCR"Key="Outlook.Application\CurVer"Format="raw"Variable="version"/><util:RegistrySearchId="RegSearch2"Root="HKLM"Key="SOFTWARE\Microsoft\Office\[version].0\Outlook"Value="Bitness"Format="raw"Variable="Bit"/>

The second registry search do not work because the result produced by [version] looks something like "Applicaiton.Outlook.xx". How can I only extract only the xx part from "Applicaiton.Outlook.xx" resulted in [version] property, so i can use that value in the second registry search ? Code examples are appreciated.

[Outlook] Add rule : Run a script

$
0
0

Hi,

I really have no knowledge in Script or VBA language, but I need to set a rule that will run a script to find a text within the email, change the subject and save.

Here is a detailed explanation:

1. Email received:

          From: example@domain.com 

          Subject: New email

          Thisitem# is for you. bla bla bla.

2. Run rule:

          a. from : example@domain.com & Subject: New email

          b. Run script :

i.   find : item#

       ii.  Set email subject to: item#

          iii. Save email.

3. Result:

From: Example@domain.com 

          Subject: item#

         This item# is for you. bla bla bla.

fyi,

Item# is numeric (digits) and it change every email.

I know how to set a new rule, I just need the script to find, edit & save.

fyi (2),

I'm not a tech lol

Thanks !


Import VBA module for Outlook using Powershell

$
0
0

Hi I am trying to import VBA module for Outlook using Powershell. I know there is something for Excel but i dont see anything for Outlook when i searched.

For Excel below is the blog that tells how to import module 

https://social.technet.microsoft.com/Forums/office/en-US/f3bcd564-d7e0-4a80-bf4e-120eefc8ccd1/using-powershell-to-add-vba-to-an-excel-spreadsheet?forum=winserverpowershell

But for Outlook i dont see anyway to add VBAcomponents like below

VBProject.VBComponents
Add-Type -AssemblyName Microsoft.Office.Interop.Outlook

$Outlook = New-Object -ComObject Outlook.Application

if we have similar in Outlook then it will be easy to distribute VBA modules to mulitple users using powershell script.

Outlook 2010: macro buttons not working

$
0
0

Hello,

I have created 2 outlook macros that both work fine when run from the Visual Basic editor. I have created buttons linking to those, but unfortunately nothing happens when I click on those.

The buttons are located on the Home tab. You can see them change color & shape when hovering and clicking them, but nothing happens when clicking them.

This on Windows 7 SP1 32-bit & Outlook 2010 (14.0.6112.5000).

Any help appreciated. Thanks!

Chris.


How to assign outlook Task start time and due time?

$
0
0

Hi

I want to sync task start date and time and due date and time from my CRM to outlook. I cant assign the time to this fields. If I assign a time and check the task.startdate or task.duedate, it always show the time 12:00:00 AM. How can i assign my on time?

Thanks

Bobbin

Hide a Outlook folder & its emails from appearing in Outlook Search

$
0
0


1. Is there a way to hide a Outlook folder and its emails from appearing in the search results while searching for emails using the Outlook search?

2. Is there a user property of the email or the folder that can be used to hide the email from the Outlook search results?

How to create a Self-Signed Digital Certificate in Office 2013

$
0
0

In office 2010 we had a "Digital Certificate for VBA Projects" tool for creating self-signed certificates.  How do we do this with the newer Office 2013 suite?

How to Convert Outlook PST Emails to PDF ?

$
0
0

As a Outlook User I have a large amount of emails configured in my account and for portability and printing options I thought of converting my PST files into PDF but I didn't found any reliable solution for same. According to me it will be the best solution for keeping my selected emails in hard copy format and moving them from one place to another. All suggestions are welcomed and kindly provide me the apt solution for PST emails to PDF conversion.

Thanks in Advance to all!!!

Jack Rider

Addin working in Outlook 2007 but not in Outlook 2013

$
0
0

Hi,

An Outlook add-in is developed using Visual Studio 2005 and it loaded successfully in Outlook 2007. But the same add-in is not loaded in Outlook 2013.

During the Outlook startup, it is not loaded and went to "Inactive Add-ins". Activating it manually also doesn't help.

I couldn't see any related logs in EventViewer or in Telemetry logs.

Can someone help me on this?

Is add-in working in Outlook 2007 compatible in Outlook 2013? Anything to be taken care?

I tried recompiling the source/DLLs in Visual Studio 2013 but doesn't help. The add-in not even detected by Outlook and not listed in "Disabled Add-ins" and "Inactive add-ins"

Regards,

Srini

Calendar custom forms do not show when editing a single event in repeated event

$
0
0
I have created custom forms for Outlook Calendar with developer tools.

When I create a repeated event, Outlook Calendar do not show custom fields, if I edit a single event from that repeated event series. If I edit the whole repeated event series, custom fields what I have added with developer tools are in place.

This happens with Outlook 2016. On my old Outlook 2008 this is still possible.


Outlook Calendar - .NET Desktop (console/winforms/wpf) sample

$
0
0

I can not find a simple sample project how to automate work with my appointments in my outlook calendars.

I just want to automate work to delete duplicated items.


I've found sample https://github.com/OfficeDev/O365-Win-Snippets , but to run it, VS needs some Office365 dev account with some domain (where I've typed outlook.com and get an error that is not my host).

Is this API only for corporate users? Or It can be used by a simple users for only my calendar in "calendar.live.com"?


Display voting buttons in column at recipient side

$
0
0

Hello everyone!

Could someone help to answer question about voting buttons:

Is there any possibility to display information about voting atrecipient side in column in common view by VBA? It is not possible by embedded functional of outlook. Information aboutnecessity of voting places is in InfoBar (by default). But to checknecessity of voting I need to open email. This is not quite convenient and I want to see this information in common view.

Thanks in advance for any help.

Voting buttons

Outlook REST API with Event from Calendar

$
0
0
Hi all, 

I'm working with Outlook REST API and now I have a problem. I hope you can help me.

I create event on Calendar, then I check my Inbox by API `https://outlook.office.com/api/v2.0/me/messages`. I got this event on response

`{
      "@odata.type": "#Microsoft.OutlookServices.EventMessage",
      "@odata.id": "https://outlook.office.com/api/v2.0/Users('00030000-d2c2-9b1c-0000-000000000000@84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa')/Messages('AQMkADAwATMwMAItZDJjMi05YjFjLTAwAi0wMAoARgAAA7SxQhm9l89Pp6ZsIuivJtUHAGcFa_dfAPlIilhNjKhjJegAAAIBDAAAAGcFa_dfAPlIilhNjKhjJegAAS6w35MAAAA=')",
      "@odata.etag": "W/\"CwAAABYAAABnBWvnXwD5SIpYTYyoYyXoAAEuwAsh\"",
      "Id": "AQMkADAwATMwMAItZDJjMi05YjFjLTAwAi0wMAoARgAAA7SxQhm9l89Pp6ZsIuivJtUHAGcFa_dfAPlIilhNjKhjJegAAAIBDAAAAGcFa_dfAPlIilhNjKhjJegAAS6w35MAAAA=",
      "CreatedDateTime": "2016-09-20T10:47:50Z",
      "LastModifiedDateTime": "2016-09-20T10:47:50Z",
      "ChangeKey": "CwAAABYAAABnBWvnXwD5SIpYTYyoYyXoAAEuwAsh",
      "Categories": [],
      "ReceivedDateTime": "2016-09-20T10:47:50Z",
      "SentDateTime": "2016-09-20T10:47:14Z",
      "HasAttachments": false,
      "InternetMessageId": "<SG2PR0199MB06453B4C07A93E060578624BB0F70@SG2PR0199MB0645.apcprd01.prod.exchangelabs.com>",
      "Subject": "Hello",
      "Body": {
        "ContentType": "HTML",
        "Content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=iso-8859-1\">\r\n<style type=\"text/css\" style=\"\">\r\n<!--\r\np\r\n\t{margin-top:0;\r\n\tmargin-bottom:0}\r\n-->\r\n</style>\r\n</head>\r\n<body dir=\"ltr\">\r\n<div id=\"divtagdefaultwrapper\" style=\"font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif\">\r\n<p>:D</p>\r\n</div>\r\n</body>\r\n</html>\r\n"
      },
      "BodyPreview": ":D",
      "Importance": "Normal",
      "ParentFolderId": "AQMkADAwATMwMAItZDJjMi05YjFjLTAwAi0wMAoALgAAA7SxQhm9l89Pp6ZsIuivJtUBAGcFa_dfAPlIilhNjKhjJegAAAIBDAAAAA==",
      "Sender": {
        "EmailAddress": {
          "Name": "Nguyen Anh",
          "Address": "anh.nt-gu@outlook.com"
        }
      },
      "From": {
        "EmailAddress": {
          "Name": "Nguyen Anh",
          "Address": "anh.nt-gu@outlook.com"
        }
      },
      "ToRecipients": [
        {
          "EmailAddress": {
            "Name": "appdev180@outlook.com",
            "Address": "appdev180@outlook.com"
          }
        }
      ],
      "CcRecipients": [],
      "BccRecipients": [],
      "ReplyTo": [],
      "ConversationId": "AQQkADAwATMwMAItZDJjMi05YjFjLTAwAi0wMAoAEAAL-7ynjN3PTpM4jWi5kEVc",
      "IsDeliveryReceiptRequested": null,
      "IsReadReceiptRequested": false,
      "IsRead": true,
      "IsDraft": false,
      "WebLink": "https://outlook.live.com/owa/?ItemID=AQMkADAwATMwMAItZDJjMi05YjFjLTAwAi0wMAoARgAAA7SxQhm9l89Pp6ZsIuivJtUHAGcFa%2BdfAPlIilhNjKhjJegAAAIBDAAAAGcFa%2BdfAPlIilhNjKhjJegAAS6w35MAAAA%3D&exvsurl=1&viewModel=ReadMessageItem",
      "InferenceClassification": "Focused",
      "MeetingMessageType": "MeetingRequest"
    }`

Follow this documention `https://msdn.microsoft.com/en-us/office/office365/api/complex-types-for-mail-contacts-calendar`. The EventMessage has `Event` property which associated with the event message. But I can not found it.

How can I find event related to above email? Thank all :)

How can I check the bitness of outlook?

$
0
0

Hi

I've an outlook addin installer for outlook 2007, 2010, 2013 and 2015. Its working fine. Right now I've two installers for 64bit and 32bit. This also working fine. Here my problem is if I try to install the 32bit Addin installer in a machine, which have 64bit outlook, my addin will easily install. I don't want to install like this. My Aim is When I try to install 32bit installer in a machine which have 64bit outlook is installed, it will show an error message and skip the installation.

Can i check this in setup project (launch condition) or need to add custom action project?

Thanks in advance

Bobbin

How to export body e-mail line by line in excel ?

$
0
0

Hi , 

I`m just begining to learn c# and i ask if you please help me with a code to export in excel like described below :

I have a subfolder where emails contain a reply to an approval request email and i need to export this e-mails in excel this way ;

Aprroval response from the body of the response email in a cell and the date of the response in other cell

From the approval request : sender email in one cell , recipient in one cell , subject in one cell , date of approval request email in one cell and from the body of the email the first line of the email body in a cell , the second line in other cell...

For the begining i have the code below but i know is not right because is exporting first the emails in txt.Please tell me from where do i start to learn working in c# with outlook , word , excell because online i find very few tutorials on this.I like to learn from tutorials but if it is more information on this in books, please guide me.

Thank you.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Office.Interop.Outlook;
namespace AccessingOutlookmails
{
    class Program
    {
        public static void getEmails()
        {
            Microsoft.Office.Interop.Outlook.Application app = null;
            Microsoft.Office.Interop.Outlook._NameSpace ns = null;
            Microsoft.Office.Interop.Outlook.MAPIFolder inboxFolder = null;
            Microsoft.Office.Interop.Outlook.MAPIFolder subFolder = null;

            System.IO.StreamWriter file = new System.IO.StreamWriter("C:\\Users\\Daniel\\d.txt");

            try
            {
                app = new Microsoft.Office.Interop.Outlook.Application();
                ns = app.GetNamespace("MAPI");
                ns.Logon("daniel.tou@btrl.ro", "Albastru99", false, true);
                inboxFolder = ns.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);
                subFolder = inboxFolder.Folders["Octavian"]; //folder.Folders[1]; also works
                Console.WriteLine("Folder Name: {0}, EntryId: {1}", subFolder.Name, subFolder.EntryID);
                Console.WriteLine("Num Items: {0}", subFolder.Items.Count.ToString());

                for (int i = 1; i <= subFolder.Items.Count; i++)
                {
                    Microsoft.Office.Interop.Outlook.MailItem item = (Microsoft.Office.Interop.Outlook.MailItem)subFolder.Items[i];
                    file.WriteLine(i.ToString());
                    file.WriteLine(item.Subject);
                    file.WriteLine(item.SentOn.ToLongDateString());
                    file.WriteLine(item.Body.ToString());
                }
                file.Close();
            }
            catch (System.Runtime.InteropServices.COMException ex)
            {
                Console.WriteLine(ex.ToString());
            }
            finally
            {
                ns = null;
                app = null;
                inboxFolder = null;
            }
        }
        public static void exportToExcel()
        {
        }

        static void Main(string[] args)
        {
            getEmails();
            Console.ReadKey();
        }
    }
}

not able to install outlook 2016 & excel 2016 on one PC

$
0
0

Hi Team,

I am not able to install outlook 2016 & excel 2016 on one PC, please suggest I can I do for this.

I am getting error of click-to-run. I can install either excel or outlook on that PC.

Please helm me out to resolve this issue. I want to install both on that PC.

Viewing all 6421 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>