//Cloud notes from my desk -Maheshk

"Fortunate are those who take the first steps.” ― Paulo Coelho

Why Office server side automation is not supported, EWS Links, Open XML starter pack

1)      Considerations for server-side Automation of Office – http://support.microsoft.com/kb/257757/en-us

 2)      EWS API links – Below are some starter links. 

 Exchange for developers – http://msdn.microsoft.com/en-us/office/dn448484

 Developer roadmap for Exchange – http://msdn.microsoft.com//library/office/dd877025(v=exchg.150)

 Get started with EWS Managed API client applications –http://msdn.microsoft.com/en-us/library/office/jj220499(v=exchg.80).aspx

 EWS Managed API concepts – http://msdn.microsoft.com/en-us/library/office/dd633649(v=exchg.80).aspx  

 Working with the EWS Managed API – http://msdn.microsoft.com/en-us/library/office/dd633696(v=exchg.80).aspx

 Microsoft Exchange Web Services Managed API 2.1  – http://www.microsoft.com/en-us/download/details.aspx?id=42022

 C# Sample code:

        //pass the credential and EWS asmx detail

       privateint GetUnreadCount()

        {

            ExchangeService service = newExchangeService(ExchangeVersion.Exchange2013);

            service.Url = newUri(“https://yourcasserver/ews/exchange.asmx“);

            service.Credentials = newWebCredentials(“Username”, “Password”);

 

            Folder inbox = Folder.Bind(service, WellKnownFolderName.Root);

            SearchFilter sf = newSearchFilter.SearchFilterCollection(LogicalOperator.And, newSearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false));

            ItemView view = newItemView(50);

            view.Traversal = ItemTraversal.Shallow;

            FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox, sf, view);

            //get the count

            int count = findResults.Count();

            return count;

        }

3)      For Open XML, http://www.microsoft.com/en-us/download/details.aspx?id=17985

By default, this download installs files to the following locations:

i. Visual C# snippets. PersonalFolder\Visual Studio 2010\Code Snippets\Visual C#\Open XML SDK 2.0 for Microsoft Office 2010

ii.  Visual Basic snippets. PersonalFolder\Visual Studio 2010\Code Snippets\Visual Basic\Open XML SDK 2.0 for Microsoft Office 2010

Generating Excel 2010 Workbooks by using the Open XML SDK 2.0  

http://msdn.microsoft.com/en-us/library/hh180830(v=office.14).aspx

4)      Regarding EWS Editor – http://ewseditor.codeplex.com/

Advertisements

2014-05-29 Posted by | Uncategorized | Leave a comment

How to convert word document to PDF using MS PIA Interop libraries.

For Word interop ref: c:\Program Files (x86)\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office14\Microsoft.Office.Interop.Word.dll

using System;

using System.Reflection;

using Word = Microsoft.Office.Interop.Word;

namespace ConsoleApplication5

{

classProgram

{

staticvoid Main(string[] args)

{

Application app = new Word.Application();

Missing ms = Missing.Value;

Document doc = app.Documents.Open(“D:\\Inputlog.doc”, ms, ms, ms, ms, ms, ms, ms, ms, ms, ms, ms, ms, ms, ms, ms);

doc.ExportAsFixedFormat(“D:\\dave_sample.pdf”, Word.WdExportFormat.wdExportFormatPDF, false, Word.WdExportOptimizeFor.wdExportOptimizeForPrint, Word.WdExportRange.wdExportAllDocument, 1, 1, Word.WdExportItem.wdExportDocumentContent, false, true, Word.WdExportCreateBookmarks.wdExportCreateNoBookmarks, false, true, false);

}

}

2014-05-15 Posted by | Uncategorized | | Leave a comment

   

%d bloggers like this: