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

FREE Microsoft eBooks

Largest collection of FREE Microsoft eBooks ever, including: Windows 8.1, Windows 8, Windows 7, Office 2013, Office 365, Office 2010, SharePoint 2013, Dynamics CRM, PowerShell, Exchange Server, Lync 2013, System Center, Azure, Cloud, SQL Server, and much m

Microsoft Senior Sales Excellence Manager – Eric Ligman

July 10, 2014 Posted by | Uncategorized | Leave a comment

Win API (HWND) integration in Outlook is not a supported platform technology.

How to add a window that is adjacent to the preview pane in Outlook  –

June 18, 2014 Posted by | Uncategorized | Leave a comment

Support guidelines for client-side messaging development – KB266353

Why Win32 API is not supported

June 14, 2014 Posted by | Outlook, Uncategorized | Leave a comment

Exchange 2010 does not support WebDAV ( discontinued)

Exchange 2007 was the last version of Exchange to support using WebDAV.

Developer roadmap for Exchange ( search for WebDAV)

Discontinued Features

What may work for you is to use Exchange Web Serveries (EWS), which overall has superior calendaring abilities.  There is a .NET API called the EWS Managed API which wraps EWS calls and should make using EWS a lot easier.

Differences between the EWS Managed API and EWS

EWS Managed API reference

Microsoft Exchange Web Services Managed API 2.2

Explore the EWS Managed API 2.0


June 12, 2014 Posted by | Office, Outlook | Leave a comment

Office update center- build number and SP’s details + Open XML SDK 2.5

Open XML SDK 2.5 for Microsoft Office

Update center for Office, Office servers, and related products

June 12, 2014 Posted by | Outlook | Leave a comment

Microsoft Office Configuration Analyzer Tool 1.2

The Office Configuration Analyzer Tool 1.2 (OffCAT ) provides a quick and easy method to analyze most Microsoft Office programs for common configurations that may cause problems. *Download only OffCAT.msi if you want to install OffCAT. Review the ReadMe file to see if the other files are needed.

Supported Operating System

Windows 7, Windows 8, Windows Vista Service Pack 2, Windows XP Service Pack 3
This download works with the following Microsoft Office products:

• Microsoft Office 2013 (32-bit or 64-bit, Click-to-run or Msi installs)
• Microsoft Office 2010 (32-bit or 64-bit)
• Microsoft Office 2007
OffCAT version 1.2 provides scanning for the following Office programs:

•Microsoft Access
•Microsoft Excel
•Microsoft InfoPath
•Microsoft OneNote
•Microsoft Outlook
•Microsoft PowerPoint
•Microsoft Publisher
•Microsoft Visio
•Microsoft Word
The following minimum version of the Microsoft .NET Framework is required:
• Microsoft .NET Framework Version 2.0
The following Microsoft Office feature is also required:
• .NET Programmability Support

June 11, 2014 Posted by | Office | | Leave a comment

Exchange Sp details, support life cycle, EWS Java API – Links

EWS Java API 1.2 – get started!

Exchange: EWS Java API 1.2

Supportability of Microsoft EWS Java API 1.1 for Exchange Server 2007/2010 – Brij Blog

Exchange Server and Update Rollups Build Numbers

Microsoft Support Lifecycle

June 10, 2014 Posted by | Exchange EWS | Leave a comment

Procdump is preferred over Adplus- About ProcDump.

There may be many ways to capture the dumps in winodws, but which one gives us the better dumps ? Obviously Procdump has lot of advantage, details and preferred over Adplus when see the details in Windbg. 

We suggest to use Procdump and also carefully select the bitness when capturing dumps. For 64 bit use -64 or else leave it blank(default it is 32 bit).

 The syntax goes like this for crash-> Procdump -e -ma -t -64 -w Outlook.exe    (Procdump page has got details about these command line switches)

Let me put it in steps,

1)    Before taking dump, enable page heap corruption checking using the following command:   gflags.exe -p /enable outlook.exe /full

 2)    Now run the procdump command to capture the dump with bitness set accordingly. Procdump -e -ma -t -64 -w Outlook.exe  Wait for the crash and confirm dump has been created successfully.

 3)    After the crash, reset command: gflags.exe -p /disable outlook.exe You can use the following command line to see if page heap checking is enabled:    gflags.exe –p

 For additional info, refer Dan B blog post here and about procdump quick video here.

June 6, 2014 Posted by | Uncategorized | | Leave a comment

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

1)      Considerations for server-side Automation of Office –

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

 Exchange for developers –

 Developer roadmap for Exchange –

 Get started with EWS Managed API client applications -

 EWS Managed API concepts –  

 Working with the EWS Managed API –

 Microsoft Exchange Web Services Managed API 2.1  –

 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,

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

4)      Regarding EWS Editor –

May 29, 2014 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




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);



May 15, 2014 Posted by | Uncategorized | | Leave a comment

How to use the Outlook object model to retrieve all recurring appointments

You have to set ‘oItems.IncludeRecurrences = True’ if you are trying to get all the recurring calendar items in VBA-Outlook.

April 30, 2014 Posted by | Uncategorized | Leave a comment

How to use the same keyset for strongname signing as well as for manifest and/or Authenticode signing.

Strong name signing requires KeySpec=2 (AT_SIGNATURE). Similar issue was blogged for VS2005 and that still holds true for VS2010. The certificate has KeySpec=1 (AT_EXCHNAGE) and worked around by modifying the certificate to have KeySpeck=1. Steps below helps you to successfully sign the project

1. Using the “Certifiates” MMC export the existing keyset (KeySpec=1) to a PFX file.

2. Delete the existing certificate from the crypto store (using the MMC).

3. Open a CMD prompt.

4. import the PFX file using this command:certutil -importPFX -user <pfxfilename> AT_SIGNATURE

5. Enter the passphrase for the pfx when prompted.

6. You now should have a keyset/Cert with KeySpec=2. If needed you can now export this into another PFX file using the MMC again.

7. Use the new .pfx in the Visual Studio to sign the executable

April 30, 2014 Posted by | Uncategorized | , , | Leave a comment

Profman2.exe – MAPI Profile Manager v2.0

Profman2.exe is a self-extracting achieve that contains a sample program demonstrating how to use the MAPI interfaces and methods that pertain to the manipulation and creation of MAPI profiles.

Here is a list of its functionality:

  • Create a new blank profile.
  • Add services to a profile.
  • Delete services from a profile.
  • List the services in a profile.
  • Add providers to a service.
  • Delete providers from a service.
  • List the providers in a service.
  • List the available properties of a service (even ones that are normally inaccessible).
  • List the available properties of a provider (even ones that are normally inaccessible).
  • Outlook 2000 Compliant (reads proper location of MAPISVC.inf file)

download @

April 18, 2014 Posted by | Uncategorized | | Leave a comment

From training-links for later reading { O365 apps, Office PIA, XL, VSTO }

O365 web apps development
1) The Office 365 platform —new opportunities for developers

2) Here is a Video of the possibilities :

3) MSDN article we might need to be aware of -Office 365 APIs Preview

4) How to: Add Office 365 APIs to a Visual Studio project

5) What is UDF –

6) UDF using .NET –


8) Automation Add-ins section –

9) What is XLL – An XLL is an add-in for Microsoft Excel that you can build with any compiler that supports building DLLs (dynamic link libraries).
10) Download XLL SDK from –





14) Understanding the Excel Object Model from a .NET Developer’s Perspective

15) How to automate Microsoft Excel from Microsoft Visual C#.NET

16) How to transfer data to an Excel workbook by using Visual Basic .NET

17) How to automate Excel from Visual Basic .NET to fill or to obtain data in a range by using arrays


Office PIA

19) Primary Interop Assemblies Concept –


21) Better eventing support in CLR 4.0 using NOPIA support

22) How to: Install Office Primary Interop Assemblies –



23) Adding custom task pane

24) How to: Attach Managed Code Extensions to Documents (2007 System)

25) Memory leak (When you automate a Off app from .NET, the Office application does not quit when you call the Quit method)

April 18, 2014 Posted by | Uncategorized | | Leave a comment

Office server side automation is not supported- famous KB 257757

There is no surprise still developers tend to code some kind of office automation on server without knowing that is not supported by us.
Recently I have seen a case where the developer is creating an excel pivot charts in server(automation) using SQL Server, DTS along with some programming with It was working for him but all sudden it broke after migrating to latest server OS.
Here is the famous KB article which we keep sharing with dev’s and also famously referred in MS as “2 5 7 7 5 7″ which talks about why this is not supported. More at; 257757 KB here –


April 17, 2014 Posted by | Uncategorized | | Leave a comment

How to use EWS API for reading SMIME email message

What is SMIME – 

class Program
static ExchangeService exService;

static void Main(string[] args)
exService = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
exService.UseDefaultCredentials = true;
exService.AutodiscoverUrl(“”, RedirectionCallback);

Console.WriteLine(“Connected(Autodiscovered EWS Endpoint)- ” + exService.Url);

//find the trace log dumped in debug\log.txt
exService.TraceEnabled = true;
exService.TraceListener = new TraceListener();
exService.TraceEnablePrettyPrinting = true;

Console.WriteLine(“Getting inbox items..”);
byte[] data = GetInboxMailItems();

if (data == null)
Console.WriteLine(“No Mails retreived “);
byte[] resultObject= DecryptToFile(data);

Console.WriteLine(“No object retrieved from Decrypt. somthing wrong in this method”);

string uniqueFname = Path.GetRandomFileName()+”.eml”;
Console.WriteLine(@”Decrypted EML file dumped here — c:\temp\” + uniqueFname);

//Find the decrypted file here
//Load this file in Outlook for testing.
File.WriteAllBytes(@”c:\temp\” + uniqueFname, resultObject);

//write the decrypted content to a file – mail item .eml
Console.WriteLine(“Press any key to exit..”);
catch (Exception ex)
Console.WriteLine(“Error while initializing..” + ex.ToString());

/// <summary>
/// </summary>
private static byte[] GetInboxMailItems()
byte[] data = null;

//Get inbox unread mails (have a mail ready for decrypt which is signed & decrypt)
Folder inbox = Folder.Bind(exService, WellKnownFolderName.Inbox);
SearchFilter sf = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false));

ItemView view = new ItemView(1);

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

//Have atleast 1 unread ‘encrypted,signed’ mail for this testing
if (findResults.TotalCount == 0)
return data;
Console.WriteLine(“No Mails retreived”);

//Loop through the items and do whatever is required.
foreach (Item item in findResults)
//Load the mail item
PropertySet ps = new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.Attachments);

foreach (Microsoft.Exchange.WebServices.Data.Attachment attach in item.Attachments)
// find the encrypted mails attachment- in general body and any mail content for encrypted mail would be bundled as smime.p7m file in mailstore
if (attach.Name == “smime.p7m”)
Console.WriteLine(“Process smime.p7m file”);
FileAttachment fileAttachment = (FileAttachment)attach;
MemoryStream stream = new MemoryStream();
StreamReader stReader = new StreamReader(stream);
stream.Seek(0, SeekOrigin.Begin);
data = stream.GetBuffer();

return data;
return data;

/// <summary>
/// </summary>
/// <param name=”data”></param>
private static byte[] DecryptToFile(byte[] data)
byte[] resultObject = null;

EnvelopedCms envelopObj = new EnvelopedCms();

Console.WriteLine(“Encryption Algorithm: Name={0}”, envelopObj.ContentEncryptionAlgorithm.Oid.FriendlyName);
Console.WriteLine(“Key length={0}”, envelopObj.ContentEncryptionAlgorithm.KeyLength);
Console.WriteLine(“Recipients ({0})”, envelopObj.RecipientInfos.Count);

foreach (RecipientInfo r in envelopObj.RecipientInfos)
Console.WriteLine(” Encrypted key={0}”, BitConverter.ToString(r.EncryptedKey));
Console.WriteLine(” Encryption alg={0}”, r.KeyEncryptionAlgorithm.Oid.FriendlyName);

if (r.RecipientIdentifier.Type == SubjectIdentifierType.IssuerAndSerialNumber)
X509IssuerSerial xi = (X509IssuerSerial)r.RecipientIdentifier.Value;
Console.WriteLine(” Issuer={0}”, xi.IssuerName);
Console.WriteLine(” SerialNumber={0}”, xi.SerialNumber);
Console.WriteLine(” SubjectKeyInfo={0}”, r.RecipientIdentifier.Value);

Console.WriteLine(“Certificates ({0})”, envelopObj.Certificates.Count);

foreach (X509Certificate2 cert in envelopObj.Certificates)
Console.WriteLine(“Subject={0}”, cert.SubjectName);

Console.WriteLine(“Unprotected Attributes ({0})”, envelopObj.UnprotectedAttributes.Count);

foreach (CryptographicAttributeObject obj in envelopObj.UnprotectedAttributes)

Console.WriteLine(“Success. Decrypted… !!”);
resultObject = envelopObj.ContentInfo.Content;

return resultObject; ;
catch (Exception ex)
return resultObject;

/// <summary>
/// </summary>
/// <param name=”url”></param>
/// <returns></returns>
static bool RedirectionCallback(string url)
// Return true if the URL is an HTTPS URL.
return url.ToLower().StartsWith(“https://&#8221;);

/// <summary>
/// </summary>
public class TraceListener : ITraceListener
#region ITraceListener Members

public void Trace(string traceType, string traceMessage)
CreateXMLTextFile(traceType + ” — ” + traceMessage.ToString());


private void CreateXMLTextFile(string traceContent)
string strPath = System.AppDomain.CurrentDomain.BaseDirectory;
strPath = strPath + “\\Log.txt”;
System.IO.FileStream fs;
if (System.IO.File.Exists(strPath) == false)
fs = System.IO.File.Create(strPath);
fs = System.IO.File.OpenWrite(strPath);


// Create an instance of StreamWriter to write text to a file.
System.IO.StreamWriter sw = System.IO.File.AppendText(strPath);
sw.WriteLine(System.DateTime.Now.ToString() + “: ” + traceContent);


April 15, 2014 Posted by | Uncategorized | , , | Leave a comment

How to convert Hex to Base64 in C#

Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding.

Base64 encoding schemes are commonly used when there is a need to encode binary data that needs to be stored and transferred over media that is designed to deal with textual data. This is to ensure that the data remains intact without modification during transport. Base64 is commonly used in a number of applications including email via MIME, and storing complex data in XML.

//Convert Hex to Base64
static void Main(string[] args)
string hexstr = “040000008200E00074C5B7101A82E0080000000622029301EB4592B71528F44A48D7″;
byte[] data = ConvertFromStringToHex(hexstr);
string base64 = Convert.ToBase64String(data);


public static byte[] ConvertFromStringToHex(string inputHex)
inputHex = inputHex.Replace(“-“, “”);

byte[] resultantArray = new byte[inputHex.Length / 2];
for (int i = 0; i < resultantArray.Length; i++)
resultantArray[i] = Convert.ToByte(inputHex.Substring(i * 2, 2), 16);
return resultantArray;

April 15, 2014 Posted by | Uncategorized | | Leave a comment


Get every new post delivered to your Inbox.