How does Outlook create Task Requests? - c#

I have been working with EWS Managed API and have frequently come across posts for Assign Task or Task Requst creation is not supported by EWS.
http://social.msdn.microsoft.com/Forums/exchange/en-US/53418cb8-9fb8-4f4d-9bcf-d314909e9eb9/create-task-request-using-ews?forum=exchangesvrdevelopment
http://social.msdn.microsoft.com/Forums/exchange/en-US/82574974-890b-4c13-849f-73f111906b98/send-a-task-request-using-ews?forum=exchangesvrdevelopment
But we can create Task Requests from Outlook. How does Outlook do that? What API does it use in the back to achieve this?
Is there a way to use the same API that Outlook uses to achieve this functionality?

Outlook internally uses Extended MAPI (accessible in C++ or Delphi only).
You can use the Outlook Object Model or Redemption (I am its author), which wraps Extended MAPI.
If you need to build a task request without using the MAPI system in one form or another, you would need to build a winmail.dat attachment, which is a TNEF stream containing MAPI specific properties used by task requests.

Related

How to Read/Write Contacts and Events in Outlook when it is set to Work Offline - C#

As the Title suggest, i am trying to Read and Write (R&W) Contact and Event information to multiple Outlook Accounts/Profiles in a local computer, while Outlook is set to Work Offline.
So far i discovered two ways to R&W contacts and Events to Outlook:
1.- Microsoft.Graph:
This seems to work only online, since it reads and writes to the Microsoft server, not to the local pst/ost files.
2.- microsoft.office.interop.outlook library:
This does work offline/locally (by accessing the Outlook pst/ost files) but the approach i am using so far requires the creation of an Application object as
var app = new Microsoft.Office.Interop.Outlook.Application();
Nevertheless, creating an Application object implicitly logs in a profile/user to the application, and further, if Outlook is already running and logged in with a Profile X, the code above instantiates an Outlook object in which the Profile X is logged in, so in that scenario i can only R&W Contacts and Events for that specific user/Profile.
So, is there a way to be able to R&W Contact and Event information for different profiles independently of if Outlook is running with a Profile X?
Well, there is no magic - if you want offline access, something needs to implement the storage to keep the cached data and cache your changes so that they can be uploaded when the server comes back online.
If you don't want to implement that logic, cached Outlook profile is probably your only choice. You are right that Outlook, being a singleton, can only access one profile at a time. You can use Extended MAPI to access a profile other than the other used by Outlook, but it is C++ or Delphi only. If using Redemption is an option (I am its author), it wraps Extended MAPI API for use in any language (C# included) - you can use its RDOSession.Logon method to access any existing profile.

Read Outlook emails in c#

I need some advice on how to solve a problem. I have an application that sends out emails to users. Note, I am using Microsoft Exchange as email server. I would like to have a feature where the user can reply to the email sent by the application and the application be able to read the reply and perform certain actions.
For example, the application will send out an email requesting approval for an item. I would like the user to reply the email and say whether or not the item has been approved or rejected. It's a very simple scenario but it captures what I want to do. How can I read emails sent to a particular address in c#?
Reading, parsing and answering emails in code is often very hard piece of machinery. If you are open to suggestions though one of the possible solutions could be a couple of Approve/Reject links in the body of the email which are linking back to your web site and triggering corresponding actions in your approval workflow. Hope it helps!
You can use EWS, see EWS Managed API, EWS, and web services in Exchange. If you are dealing with Office 365 you may also consider using Outlook REST API.
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution. Read more about that in the Considerations for server-side Automation of Office article.
If you use Outlook for sending emails consider using the VotingOptions property of the MailItem class which allows to set a string specifying a delimited string containing the voting options for the mail message. This property uses the character specified in the value name, sList, under HKEY_CURRENT_USER\Control Panel\International in the Windows registry, as the delimiter for multiple voting options. So, in a response you can use the VotingResponse property which returns a string specifying the voting response for the mail message. This property is usually set to one of the delimited values returned by the VotingOptions property on a reply to the original message.

Outlook Interop from c# service

I have a barebones c# service installed and want to use the outlook.interop functionallity from within my program. Just to detect and read new emails recieved. I have the program that does this but it is a form application. Is it possible to use outlook.interop from a C# service?
Better avoid using an interactive application within a service environment. Using Outlook from a service is not supported by Microsoft and will get you probably in all sorts of trouble (think message boxes popping up for instance).
If you want to talk to an Exchange server better use CDO/MAPI or the Exchange Web service API.
If you want to talk to a POP3 or IMAP server use a dedicated library.
You should look at the Redemption RDO Library (commercial third-party tool), which is effectively a managed wrapper for MAPI that allows out-of-process access to Outlook stores. To detect new mail, you could subscribe to the RDOStore.OnNewMail event.

Skype plugin in C#

I write system, that collects informations about local system. It's a system like admin-client. Client collects and sends log to admin. There's of course possibility to get this log by admin over LAN, but I'd like to add option send log over Internet.
I thought about skype. Client must have logged skype and when admin (of course there must be appropriate authorization, but it's separate topic) send request by skype - client must e.g. connect to SQL database or simple file with collected log and send it over skype.
How can I do this?
Is this the best way? Plugin in skype? What lib may I use?
I think it's an either/or situation.
If you want an administrator who is already using Skype to be able to send this information over the internet, then a plugin which exposes that functionality in Skype is the way to go.
If you want the administrator to be able to send the information over Skype's network, but not necessarily have to have the application running (perhaps this will be done through the application that gathers data), then using the API to control Skype externally is better.
You can find the documentation for Skype here:
http://developer.skype.com/accessories
Skype has a COM API called Skype4COM which you could use through COM interop in order to access Skype.
It should be noted that SkypeKit is now available for use in both embedded and desktop programs. There's a small one-time registration fee (currently $5 USD) for each program, but it will allow you to access Skype without actually using any UI functionality (it's completely up to you to provide the interface).
Until SkypeKit is released, you're limited to the Skype Public API. However according to the docs this API only allows to specify the recipient and open the file dialog, initiating a file transfer automatically seems to be impossible (see "OPEN FILETRANSFER" in the docs).
I suggest you use an open protocol like HTTP or FTP instead.

integrating Outlook with c#

is it possible to integrate outlook with my c# program without having Microsoft office installed?
It depends on what functionality you are trying to achieve?
It also depends on your environment.Do you have access to exchange server?
For example, If you want to create appointments in outlook client for individual user, you can very well make use of webservice provided by Exchange server. However, it works starting with outlook 2007.
In a word, no. If you want to call an Outlook dll you will need Outlook installed.
Perhaps if you describe what you need to do there may be an alternative approach, such as calling Exchange Server as suggested by Edwin.

Categories

Resources