<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Jive into Messaging world</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/vikas/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/vikas/feed.xml</link>
    <description />
    <lastBuildDate>Tue, 16 Apr 2019 05:35:45 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Draft: How to take EWS/OWA/ETL trace to troubleshoot Exchange Web Services issues – EXCHANGE 2007 &amp; 2010</title>
      <link>https://docs.microsoft.com/archive/blogs/vikas/draft-how-to-take-ewsowaetl-trace-to-troubleshoot-exchange-web-services-issues-exchange-2007-2010</link>
      <pubDate>Thu, 23 Jun 2011 02:27:02 GMT</pubDate>
      <dc:creator><![CDATA[Vikas - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vikas/2011/06/23/draft-how-to-take-ewsowaetl-trace-to-troubleshoot-exchange-web-services-issues-exchange-2007-2010/</guid>
      <description><![CDATA[THIS IS A DRAFT DOCUMENT AND MAY CHANGE WITHOUT PRIOR NOTICE.   PURPOSE: Collect ETL trace from...]]></description>
      <content:encoded><![CDATA[<p>THIS IS A DRAFT DOCUMENT AND MAY CHANGE WITHOUT PRIOR NOTICE. </p>  <p><strong>PURPOSE: </strong>Collect ETL trace from Exchange Server 2007 &amp; 2010 to troubleshoot Exchange Web Services related issues.</p>  <p><strong>Applies to: </strong>Microsoft® Exchange Server© 2007 &amp; 2010</p>  <p align="justify"><strong><u>Steps</u></strong></p>  <p>1) Go to CAS Server and fire up Extra.exe <em>(%PROGRAMFILES%\Microsoft\Exchange Server\Bin\ExTRA.exe)</em>    <br />2) This will bring the following window, click on ‘Select a task’</p>  <p><a href="https://www.vikasverma.com/blogimages/Draft-How-to-take-ETL-Traces_CDCF/image.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://www.vikasverma.com/blogimages/Draft-How-to-take-ETL-Traces_CDCF/image_thumb.png" width="717" height="596" /></a></p>  <p>3) Click on “Trace Control”</p>  <p><a href="https://www.vikasverma.com/blogimages/Draft-How-to-take-ETL-Traces_CDCF/image_3.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://www.vikasverma.com/blogimages/Draft-How-to-take-ETL-Traces_CDCF/image_thumb_3.png" width="717" height="596" /></a></p>  <p>4) Configure the trace options, file location, maximum file size (100-200mb should be enough for normal scenarios)   <br />5) Select sequential logging, and run traces for a time period in which you should be able to reproduce the issue. Usually 300 seconds are good enough to switch over and reproduce the error.    <br />6) Click “Set components and tags for the type of tracing selected”    <br />7) Type of tracing will be “6. OWA Tracing”</p>  <p><a href="https://www.vikasverma.com/blogimages/Draft-How-to-take-ETL-Traces_CDCF/image_4.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://www.vikasverma.com/blogimages/Draft-How-to-take-ETL-Traces_CDCF/image_thumb_4.png" width="718" height="549" /></a></p>  <p>8) Under trace types, select all of them to get a verbose log   <br />9) Under components, OWA will be selected by default – you might want to uncheck that as it will add logs for OWA traffic as well    <br />10) Choose trace components according to your problem, in basic scenarios and EWS issues MSExchangeWebServices should be sufficient.    <br />11) These are the providers which looks good to get a detailed log and uncovering the hidden issues somewhere in the communication.    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; a. ADProvider    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; b. ADRecipientCache    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; c. ADExpansion    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; d. AuthenticationProvider    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e. Common    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; f. Diagnostics    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; g. MSExchangeWebServices    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; h. NetworkingLayer    <br />12) Once done, hit Start tracing</p>  <p><a href="https://www.vikasverma.com/blogimages/Draft-How-to-take-ETL-Traces_CDCF/image_5.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://www.vikasverma.com/blogimages/Draft-How-to-take-ETL-Traces_CDCF/image_thumb_5.png" width="720" height="589" /></a></p>  <p>13) It will run the trace for the specified duration, keep it running and reproduce the problem</p>        <p><a href="https://www.vikasverma.com/blogimages/Draft-How-to-take-ETL-Traces_CDCF/image_6.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://www.vikasverma.com/blogimages/Draft-How-to-take-ETL-Traces_CDCF/image_thumb_6.png" width="721" height="590" /></a></p>  <p>14) Once done it will generate a binary file (.ETL) which contains all the proprietary &amp; confidential debugging information related to the product.</p>  <p>15) Take instructions from the Microsoft Support Professional on how to send the file back to him/her.</p>  <p><strong>DISCLAIMER: THE STEPS BELOW CAN IMPACT THE PERFORMANCE OF THE EXCHANGE SERVER AND MUST BE PERFORMED IN GUADIANCE OF MICROSOFT SUPPORT PROFESSIONAL. IN NO EVENT SHALL MICROSOFT, ITS AUTHORS, OR ANYONE ELSE INVOLVED IN THE CREATION, PRODUCTION, OR DELIVERY OF THE DOCUMENT BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE DOCUMENTATION, EVEN IF MICROSOFT HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</strong></p>]]></content:encoded>
    </item>
    <item>
      <title>Trouble updating contacts’ physical addresses using EWS Managed API?</title>
      <link>https://docs.microsoft.com/archive/blogs/vikas/trouble-updating-contacts-physical-addresses-using-ews-managed-api</link>
      <pubDate>Tue, 14 Jun 2011 08:57:18 GMT</pubDate>
      <dc:creator><![CDATA[Vikas - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vikas/2011/06/14/trouble-updating-contacts-physical-addresses-using-ews-managed-api/</guid>
      <description><![CDATA[This happened to be a second recent case among many others facing the similar issue, and they could...]]></description>
      <content:encoded><![CDATA[<p>This happened to be a second recent case among many others facing the similar issue, and they could not update an existing contact using EWS Managed API.</p>  <p>I got this customer, like all others complaining that they cannot set the contact’s Physical Address to a blank value. The same contact can be updated using EWS SOAP API but not with managed API… hmm… I knew the answer already <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="https://www.vikasverma.com/blogimages/EWS-1.1-Managed-API-aka-EWS-MAPI_12A6F/wlEmoticon-smile.png" /></p>  <p>Error Message: <strong>The request failed schema validation: The element 'Updates' in namespace '</strong><a href="https://schemas.microsoft.com/exchange/services/2006/types'">https://schemas.microsoft.com/exchange/services/2006/types'</a><strong> has incomplete content. List of possible elements expected: 'AppendToItemField, SetItemField, DeleteItemField' in namespace 'https://schemas.microsoft.com/exchange/services/2006/types'.</strong></p>  <p>Here is the code which was causing the trouble</p>  <div class="csharpcode">   <pre class="alt">        <span class="kwrd">static</span> <span class="kwrd">void</span> UpdateContact(ExchangeService svc,ItemId id)</pre>

  <pre>        {</pre>

  <pre class="alt">            Contact myContact = Contact.Bind(svc, id);</pre>

  <pre>&#160;</pre>

  <pre class="alt">            PhysicalAddressEntry paEntryHome = <span class="kwrd">null</span>;</pre>

  <pre>            PhysicalAddressEntry paEntryBusiness = <span class="kwrd">null</span>;</pre>

  <pre class="alt">&#160;</pre>

  <pre>            paEntryHome = <span class="kwrd">new</span> PhysicalAddressEntry();</pre>

  <pre class="alt">            paEntryHome.Street = <span class="str">&quot;&quot;</span>;</pre>

  <pre>            paEntryHome.City = <span class="str">&quot;&quot;</span>;</pre>

  <pre class="alt">            paEntryHome.PostalCode = <span class="str">&quot;&quot;</span>;</pre>

  <pre>            paEntryHome.State = <span class="str">&quot;&quot;</span>;</pre>

  <pre class="alt">            paEntryHome.CountryOrRegion = <span class="str">&quot;&quot;</span>;</pre>

  <pre>&#160;</pre>

  <pre class="alt">            paEntryBusiness = <span class="kwrd">new</span> PhysicalAddressEntry();</pre>

  <pre>            paEntryBusiness.Street = <span class="str">&quot;&quot;</span>;</pre>

  <pre class="alt">            paEntryBusiness.City = <span class="str">&quot;&quot;</span>;</pre>

  <pre>            paEntryBusiness.PostalCode = <span class="str">&quot;&quot;</span>;</pre>

  <pre class="alt">            paEntryBusiness.State = <span class="str">&quot;&quot;</span>;</pre>

  <pre>            paEntryBusiness.CountryOrRegion = <span class="str">&quot;&quot;</span>;</pre>

  <pre class="alt">&#160;</pre>

  <pre>            myContact.PhysicalAddresses[PhysicalAddressKey.Home] = paEntryHome;</pre>

  <pre class="alt">            myContact.PhysicalAddresses[PhysicalAddressKey.Business] = paEntryBusiness;</pre>

  <pre>            </pre>

  <pre class="alt">            <span class="kwrd">try</span></pre>

  <pre>            {</pre>

  <pre class="alt">                myContact.Update(ConflictResolutionMode.AlwaysOverwrite);</pre>

  <pre>            }</pre>

  <pre class="alt">            <span class="kwrd">catch</span>(Exception e)</pre>

  <pre>            {</pre>

  <pre class="alt">                Console.WriteLine(e.ToString());</pre>

  <pre>            }</pre>

  <pre class="alt">&#160;</pre>

  <pre>        }</pre>
</div>




<p>&#160;</p>

<p>So what was the trouble in the code, it look pretty neat.. huh? Not exactly. You are creating a new instance of <strong>PhysicalAddressEntry </strong>instead of using the existing object given by Managed API..</p>

<p>Only, few lines of code change and it started to work like charm.. here is the working code for the same.</p>

<p>&#160;</p>

<div class="csharpcode">
  <pre class="alt">        <span class="kwrd">static</span> <span class="kwrd">void</span> UpdateContact(ExchangeService svc,ItemId id)</pre>

  <pre>        {</pre>

  <pre class="alt">            Contact myContact = Contact.Bind(svc, id);</pre>

  <pre>&#160;</pre>

  <pre class="alt">            PhysicalAddressEntry paEntryHome = <span class="kwrd">null</span>;</pre>

  <pre>            PhysicalAddressEntry paEntryBusiness = <span class="kwrd">null</span>;</pre>

  <pre class="alt">&#160;</pre>

  <pre>            paEntryHome = myContact.PhysicalAddresses[PhysicalAddressKey.Home];</pre>

  <pre class="alt">            paEntryBusiness = myContact.PhysicalAddresses[PhysicalAddressKey.Business];</pre>

  <pre>&#160;</pre>

  <pre class="alt">            paEntryHome.Street = <span class="str">&quot;&quot;</span>;</pre>

  <pre>            paEntryHome.City = <span class="str">&quot;&quot;</span>;</pre>

  <pre class="alt">            paEntryHome.PostalCode = <span class="str">&quot;&quot;</span>;</pre>

  <pre>            paEntryHome.State = <span class="str">&quot;&quot;</span>;</pre>

  <pre class="alt">            paEntryHome.CountryOrRegion = <span class="str">&quot;&quot;</span>;</pre>

  <pre>&#160;</pre>

  <pre class="alt">            paEntryBusiness.Street = <span class="str">&quot;&quot;</span>;</pre>

  <pre>            paEntryBusiness.City = <span class="str">&quot;&quot;</span>;</pre>

  <pre class="alt">            paEntryBusiness.PostalCode = <span class="str">&quot;&quot;</span>;</pre>

  <pre>            paEntryBusiness.State = <span class="str">&quot;&quot;</span>;</pre>

  <pre class="alt">            paEntryBusiness.CountryOrRegion = <span class="str">&quot;&quot;</span>;</pre>

  <pre>            </pre>

  <pre class="alt">            <span class="kwrd">try</span></pre>

  <pre>            {</pre>

  <pre class="alt">                myContact.Update(ConflictResolutionMode.AlwaysOverwrite);</pre>

  <pre>            }</pre>

  <pre class="alt">            <span class="kwrd">catch</span>(Exception e)</pre>

  <pre>            {</pre>

  <pre class="alt">                Console.WriteLine(e.ToString());</pre>

  <pre>            }</pre>

  <pre class="alt">&#160;</pre>

  <pre>        }</pre>
</div>




<p>&#160;</p>

<p>Hope this helps you all. </p>

<p><strong><em>Happy coding / debugging!!!</em></strong></p>]]></content:encoded>
    </item>
    <item>
      <title>Where are you Outlook???</title>
      <link>https://docs.microsoft.com/archive/blogs/vikas/where-are-you-outlook</link>
      <pubDate>Fri, 10 Jun 2011 02:59:04 GMT</pubDate>
      <dc:creator><![CDATA[Vikas - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vikas/2011/06/10/where-are-you-outlook/</guid>
      <description><![CDATA[So I got this friend of mine who works for MS IT and was curious to find Outlook’s install location...]]></description>
      <content:encoded><![CDATA[<p>So I got this friend of mine who works for MS IT and was curious to find Outlook’s install location programmatically irrespective of 32/64 bit installation of OS or Outlook.</p> <p>First thought was registry, but that gets little messy.. you go to HKCR &amp; then parse through it to find the location of Outlook.exe… I didn’t like that much, and that was not sure shot way… I could delete the Outlook.exe and it will still point me to the same path. You might ask why would someone delete the Outlook.exe and leaving other registry entries? My answer is because you can and then the registry solution will break.</p> <p>So why not ask the Outlook itself where are you buddy? Nice, you would say, if only he can speak… yes he can!!! Here is how its done in C#</p> <p>I am using Reflection to create an object to Outlook.Application. You can use this to create an object of any COM Object though. Whenever you create the object to a COM server inside EXE, its EXE is launched if not running already. So all you need to do is use <strong>System.Diagnostics.Process </strong>class to get its Process Path. </p><pre class="csharpcode"><span class="kwrd">using</span> System;
<span class="kwrd">using</span> System.Reflection;
<span class="kwrd">using</span> System.Diagnostics;

<span class="kwrd">namespace</span> OutlookLocationFinder
{
    <span class="kwrd">class</span> Program
    {
        <span class="kwrd">static</span> <span class="kwrd">void</span> Main(<span class="kwrd">string</span>[] args)
        {
            System.Type objType = <span class="kwrd">null</span>;
            <span class="kwrd">object</span> comObject = <span class="kwrd">null</span>;
            <span class="kwrd">string</span> version = <span class="kwrd">string</span>.Empty;
            Process[] p = <span class="kwrd">null</span>;

            <span class="kwrd">try</span>
            {

                <span class="rem">// Create an object to Outlook.Application , replace with your COM Server's ProgID</span>
                objType = System.Type.GetTypeFromProgID(<span class="str">"Outlook.Application"</span>);

                <span class="rem">// Activate the object</span>
                comObject = System.Activator.CreateInstance(objType);

                <span class="rem">// This is Outlook specific, I am calling the member property to get the version of Outlook</span>
                version = (<span class="kwrd">string</span>)objType.InvokeMember(<span class="str">"Version"</span>,
                               BindingFlags.InvokeMethod, <span class="kwrd">null</span>, comObject, <span class="kwrd">null</span>);
            }
            <span class="kwrd">catch</span>
            {
                Console.Write(<span class="str">"Unable to create the object of type \"Outlook.Application\""</span>);
            }

            <span class="rem">// Whenever you create the object to a COM server inside EXE, its EXE is launched if not running already</span>
            <span class="rem">// Now, just get hold of the Process by its name</span>
            p = Process.GetProcessesByName(<span class="str">"Outlook"</span>);
            
            <span class="rem">// Beware there could be multiple instances running of the same application, we just care about first one.</span>
            <span class="kwrd">if</span> (<span class="kwrd">null</span> != p &amp;&amp; p.Length &gt; 0)
                Console.WriteLine(<span class="str">"Outlook ({0}) is launched from: {1}"</span>, version, p[0].MainModule.FileName);
            <span class="kwrd">else</span>
                Console.WriteLine(<span class="str">"Outlook does not seem to be installed properly on this machine, could not find process running on local machine"</span>);

            Console.Write(<span class="str">"Press any key to exit."</span>);
            Console.ReadKey(<span class="kwrd">false</span>);
        }
    }
}
</pre><pre class="csharpcode"><em>Happy Coding / Debugging !!!</em></pre><pre class="csharpcode">&nbsp;</pre>


]]></content:encoded>
    </item>
    <item>
      <title>WP7: Quick Timer: Sample Application for Windows Phone 7</title>
      <link>https://docs.microsoft.com/archive/blogs/vikas/wp7-quick-timer-sample-application-for-windows-phone-7</link>
      <pubDate>Sun, 09 Jan 2011 02:13:49 GMT</pubDate>
      <dc:creator><![CDATA[Vikas - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vikas/2011/01/09/wp7-quick-timer-sample-application-for-windows-phone-7/</guid>
      <description><![CDATA[No
 wonder the development of WP7 apps is super easy and very much fun. I 
was looking for a quick...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: Tahoma; color: black; font-size: x-small;"><span style="font-size: 10pt;" dir="ltr">No
 wonder the development of WP7 apps is super easy and very much fun. I 
was looking for a quick hand timer application with laps and of course I
 could find hundreds of Apps on the Marketplace. I thought why not build
 one for myself and see how difficult it
is.<br />
<br />
Here is my first application and it did not took more than 15min to code the logic... yeah UI design took over 45min :)<br />
</span></span></p>
<p>&nbsp;</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/83/19/8508.QuickTimer_Screenshot.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-83-19/8508.QuickTimer_5F00_Screenshot.jpg" border="0" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>[View:https://www.youtube.com/watch?v=WyqkqVJ_6Ak]</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Download the source code from below, feel free to use the code of this application for personal &amp; educational purposes. Written permission is required prior to any commercial use of the code. </p>
<p>&nbsp;</p>
<p>Have fun, happy coding!!!</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/11/34/37/QuickTimer_SourceCode_v1.0.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-11-34-37/QuickTimer_5F00_SourceCode_5F00_v1.0.zip">QuickTimer_SourceCode_v1.0.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>FYI: BUG: Attachments.Add fails for POP3/IMAP only accounts when the attachment type is Outlook.olEmbeddedItem</title>
      <link>https://docs.microsoft.com/archive/blogs/vikas/fyi-bug-attachments-add-fails-for-pop3imap-only-accounts-when-the-attachment-type-is-outlook-olembeddeditem</link>
      <pubDate>Wed, 15 Sep 2010 13:51:11 GMT</pubDate>
      <dc:creator><![CDATA[Vikas - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vikas/2010/09/15/fyi-bug-attachments-add-fails-for-pop3imap-only-accounts-when-the-attachment-type-is-outlook-olembeddeditem/</guid>
      <description><![CDATA[Problem: Attachments.Add fails only for POP3/IMAP accounts when the attachment type is...]]></description>
      <content:encoded><![CDATA[<p><strong>Problem: </strong>Attachments.Add fails <strong><em>only </em></strong>for POP3/IMAP accounts when the attachment type is <strong>Outlook.olEmbeddedItem</strong></p>  <p><strong>Cause: </strong>This is a known issue with Microsoft Product (<u>Outlook 2010</u>) and we have an internal fix available. The fix is expected to go public with the release of next Service Pack for the product.</p>  <p><strong>Repro Code:</strong></p>  <p>1. Setup a POP3 only profile   <br />2. Make sure that there is at least one mail item in the Inbox.    <br />3. Make the Inbox the current folder and run the following code:</p>  <p>Sub TestAddAttachment()   <br />&#160;&#160;&#160; Dim objItem As Outlook.MailItem    <br />&#160;&#160;&#160; Dim objAttachments As Outlook.Attachments    <br />&#160;&#160;&#160; Dim objItemAtt As Outlook.MailItem    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; Set objItem = Application.CreateItem(olMailItem)    <br />&#160;&#160;&#160; objItem.Subject = &quot;TestAddAttachment&quot;    <br />&#160;&#160;&#160; Set objItemAtt = Application.ActiveExplorer.Selection.Item(1)    <br />&#160;&#160;&#160; Set objAttachments = objItem.Attachments    <br />&#160;&#160;&#160; objAttachments.Add objItemAtt, Outlook.olEmbeddeditem, 1, objItemAtt.Subject    <br />&#160;&#160;&#160; objItem.Display    <br />End Sub</p>  <p><strong>Actual Result:</strong> </p>  <p>objAttachments.Add raises an error:</p>  <p>Run-time error '-2147221233 (8004010f)':   <br />The attempted operation failed. An object could not be found.</p>  <p><strong>Expected Result:&#160; </strong></p>  <p>No error   <br /></p>  <p><strong>Workaround:</strong></p>  <p>There is a workaround by saving the embedded item to the file system, similar to the following:</p>  <p>Sub TestAddAttachmentWorkaround()   <br />&#160;&#160;&#160; Dim objItem As Outlook.MailItem    <br />&#160;&#160;&#160; Dim objAttachments As Outlook.Attachments    <br />&#160;&#160;&#160; Dim objItemAtt As Outlook.MailItem    <br />&#160;&#160;&#160; Dim strPath As String    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; Set objItem = Application.CreateItem(olMailItem)    <br />&#160;&#160;&#160; objItem.Subject = &quot;TestAddAttachment&quot;    <br />&#160;&#160;&#160; Set objItemAtt = Application.ActiveExplorer.Selection.Item(1)    <br />&#160;&#160;&#160; strPath = Environ(&quot;TEMP&quot;) &amp; &quot;\testmsg.msg&quot;    <br />&#160;&#160;&#160; objItemAtt.SaveAs strPath, olMSG    <br />&#160;&#160;&#160; Set objAttachments = objItem.Attachments    <br />&#160;&#160;&#160; objAttachments.Add strPath, Outlook.olEmbeddeditem, 1, objItemAtt.Subject    <br />&#160;&#160;&#160; objItem.Display    <br />&#160;&#160;&#160; Kill strPath    <br />End Sub    <br /></p>  <p>Please contact Microsoft PSS if you are affected by this problem and cannot wait until next service pack release of Outlook 2010.</p>]]></content:encoded>
    </item>
    <item>
      <title>Exchange 2007: Transport error when sending emails using TLS (0x80040213)</title>
      <link>https://docs.microsoft.com/archive/blogs/vikas/exchange-2007-transport-error-when-sending-emails-using-tls-0x80040213</link>
      <pubDate>Fri, 23 Jul 2010 09:54:46 GMT</pubDate>
      <dc:creator><![CDATA[Vikas - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vikas/2010/07/23/exchange-2007-transport-error-when-sending-emails-using-tls-0x80040213/</guid>
      <description><![CDATA[Ok, this was a fun case and I never had such fun on a CDOSYS case &amp; I am lying. I spent nearly...]]></description>
      <content:encoded><![CDATA[<p>Ok, this was a fun case and I never had such fun on a CDOSYS case &amp; I am lying. I spent nearly all day in hunting down a Transport failure issue when sending emails using CDOSYS and Exchange 2007 as backend.</p>  <p>This was the configuration of the default Receive connector, pretty secured…huh??? Yeah!!!</p>  <p><a href="https://www.vikasverma.com/blogimages/42d622d6f955_1375B/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="https://www.vikasverma.com/blogimages/42d622d6f955_1375B/image_thumb.png" width="885" height="491" /></a></p>  <p><strong>Goal:&#160; Send secured emails using CDOSYS over TLS using BASIC authentication</strong></p>  <p><strong>Challenges:&#160; ‘80040213’ The transport failed to connect to the server.</strong></p>  <p>I confirmed that the issue is not in connectivity and I could easily do a telnet to port 25 and get the banner and supported verbs lists. The problem was that I could not do STARTTLS… heck it was not listed in the verbs list. With my “Mr. Fix It” cap on I took an ETL trace and started debugging the issue.</p>  <p>I concluded that the certificates was the blocking issue, and I quickly turned back to the Event Viewer to see the following event log</p>  <p class="MsoNormal"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 8pt"><font color="#000000">Event Type:&#160;&#160;&#160;&#160;&#160;&#160; Error </font></span></p>  <p class="MsoNormal"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 8pt"><font color="#000000">Event Source:&#160;&#160;&#160; MSExchangeTransport </font></span></p>  <p class="MsoNormal"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 8pt"><font color="#000000">Event Category: TransportService </font></span></p>  <p class="MsoNormal"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 8pt"><font color="#000000">Event ID:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 12014 </font></span></p>  <p class="MsoNormal"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 8pt"><font color="#000000">Date:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 7/23/2010 </font></span></p>  <p class="MsoNormal"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 8pt"><font color="#000000">Time:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 6:26:25 PM </font></span></p>  <p class="MsoNormal"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 8pt"><font color="#000000">User:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; N/A </font></span></p>  <p class="MsoNormal"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 8pt"><font color="#000000">Computer:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; MSGEX07 </font></span></p>  <p class="MsoNormal"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 8pt"><font color="#000000">Description: </font></span></p>  <p class="MsoNormal"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 8pt"><font color="#000000">Microsoft Exchange couldn't find a certificate that contains the domain name msgex07.msglab.com in the personal store on the local computer. Therefore, it is unable to support the STARTTLS SMTP verb for the connector Default with a FQDN parameter of msgex07.msglab.com. If the connector's FQDN is not specified, the computer's FQDN is used. Verify the connector configuration and the installed certificates to make sure that there is a certificate with a domain name for that FQDN. If this certificate exists, run Enable-ExchangeCertificate -Services SMTP to make sure that the Microsoft Exchange Transport service has access to the certificate key. </font></span></p>  <p class="MsoNormal"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 8pt"></span></p>  <p><font color="#000000"></font></p>  <p>&#160;</p>  <p>&#160;</p>  <p class="MsoNormal"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 8pt"><font color="#000000">For more information, see Help and Support Center at </font><a href="https://go.microsoft.com/fwlink/events.asp"><font color="#000000">https://go.microsoft.com/fwlink/events.asp</font></a><font color="#000000">.</font></span></p>  <p class="MsoNormal"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 8pt"><font color="#000000"></font></span></p>  <p class="MsoNormal"><a href="https://www.vikasverma.com/blogimages/42d622d6f955_1375B/clip_image001.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001" border="0" alt="clip_image001" src="https://www.vikasverma.com/blogimages/42d622d6f955_1375B/clip_image001_thumb.jpg" width="410" height="454" /></a></p>  <p class="MsoNormal"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 8pt"></span></p>  <p>Once I have resolved the Certificate issues, I can see the <b>STARTTLS </b>verb supported by the Exchange server.</p>  <p><a href="https://www.vikasverma.com/blogimages/42d622d6f955_1375B/clip_image0015.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001[5]" border="0" alt="clip_image001[5]" src="https://www.vikasverma.com/blogimages/42d622d6f955_1375B/clip_image0015_thumb.jpg" width="681" height="346" /></a></p>  <br />  <br />  <p>If you do not see STARTTLS and DO see the event log entry then you need to verify the following things</p>  <p>1) The FQDN of the server which is specified in the code, abc.xyz.com MUST match with the FQDN of the certificate </p>  <p>2) The FQDN of the Receive Connector MUST match the FQDN of the certificate</p>  <p>3) The Certificate in itself should be a valid one (not expired or with missing root CA)</p>  <p>You can verify these details with the help of your Exchange Admin and the following Powershell Cmdlet</p>  <p><strong>Get-ExchangeCertificate | fl</strong></p>  <p><strong>Enable-ExchangeCertificate –Services SMTP</strong></p>  <p><strong>New-ExchangeCertificate</strong></p>  <p>See the below link for more information</p>  <p>Reference: <a href="https://technet.microsoft.com/en-us/library/bb430748.aspx">https://technet.microsoft.com/en-us/library/bb430748.aspx</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Exchange 2010: OWA Customization: Preview forms does not works in Conversation Mode</title>
      <link>https://docs.microsoft.com/archive/blogs/vikas/exchange-2010-owa-customization-preview-forms-does-not-works-in-conversation-mode</link>
      <pubDate>Fri, 23 Jul 2010 04:52:54 GMT</pubDate>
      <dc:creator><![CDATA[Vikas - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vikas/2010/07/23/exchange-2010-owa-customization-preview-forms-does-not-works-in-conversation-mode/</guid>
      <description><![CDATA[I recently had couple of customer reporting that their existing/new OWA customization code is not...]]></description>
      <content:encoded><![CDATA[<p>I recently had couple of customer reporting that their existing/new OWA customization code is not working in Preview mode. </p>  <p>You will notice the following error message displayed instead..</p>  <p>&quot;This type of message isn't fully supported in Conversation mode. Click here to open the full version, which may show you more details or features.&quot;</p>  <p>This same form <em><u>should</u> </em>work in Exchange 2007. </p>  <p>I have two news here, first there has been changes to <em><strong>Registry.xml </strong></em>and there has been couple of new clients support added. Make sure you have all of them listed in your <strong><em>Registry.xml </em></strong>when you run the test on Exchange 2010</p>  <p>&#160;&#160;&#160; &lt;Client Application=&quot;MSIE&quot; MinimumVersion=&quot;7&quot; Platform=&quot;Windows NT&quot; /&gt;    <br />&#160;&#160;&#160; &lt;Client Application=&quot;MSIE&quot; MinimumVersion=&quot;7&quot; Platform=&quot;Windows 2000&quot; /&gt;     <br />&#160;&#160;&#160; &lt;Client Application=&quot;MSIE&quot; MinimumVersion=&quot;7&quot; Platform=&quot;Windows 98; Win 9x 4.90&quot; /&gt;     <br />&#160;&#160;&#160; &lt;Client Application=&quot;Safari&quot; MinimumVersion=&quot;3&quot; Platform=&quot;Macintosh&quot; /&gt;     <br />&#160;&#160;&#160; &lt;Client Application=&quot;Firefox&quot; MinimumVersion=&quot;3&quot; Platform=&quot;Windows NT&quot; /&gt;     <br />&#160;&#160;&#160; &lt;Client Application=&quot;Firefox&quot; MinimumVersion=&quot;3&quot; Platform=&quot;Windows 2000&quot; /&gt;     <br />&#160;&#160;&#160; &lt;Client Application=&quot;Firefox&quot; MinimumVersion=&quot;3&quot; Platform=&quot;Windows 98; Win 9x 4.90&quot; /&gt;     <br />&#160;&#160;&#160; &lt;Client Application=&quot;Firefox&quot; MinimumVersion=&quot;3&quot; Platform=&quot;Macintosh&quot; /&gt;     <br />&#160;&#160;&#160; &lt;Client Application=&quot;Firefox&quot; MinimumVersion=&quot;3&quot; Platform=&quot;Linux&quot; /&gt;     <br />&#160;&#160;&#160; &lt;Client Application=&quot;Chrome&quot; MinimumVersion=&quot;1&quot; Platform=&quot;Windows NT&quot; /&gt;</p>  <p>Secondly, This issue is <strong>“by design”</strong> that the custom forms will not work in Conversation Mode for now. </p>  <p>This issue seems like something obvious that the product group will want to fix in the <strong>next major version</strong>.&#160;&#160; It is currently not under consideration for a service pack or rollup for Exchange 2010, but may be considered at some point based on customer feedback. </p>  <p>If this issue is causing troubles for you then I would request you to contact PSS.</p>]]></content:encoded>
    </item>
    <item>
      <title>System.Net.Mail cannot send secured email using SMTP over SSL aka SMTPS protocol</title>
      <link>https://docs.microsoft.com/archive/blogs/vikas/system-net-mail-cannot-send-secured-email-using-smtp-over-ssl-aka-smtps-protocol</link>
      <pubDate>Fri, 23 Jul 2010 02:36:49 GMT</pubDate>
      <dc:creator><![CDATA[Vikas - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vikas/2010/07/23/system-net-mail-cannot-send-secured-email-using-smtp-over-ssl-aka-smtps-protocol/</guid>
      <description><![CDATA[This is just FYI that we know the limitation of System.Net.Mail classes and its incapability of...]]></description>
      <content:encoded><![CDATA[<p>This is just FYI that we know the limitation of System.Net.Mail classes and its incapability of sending secured emails over SSL / SMTPS.</p>  <p>The <a href="https://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx">SmtpClient</a> class only supports the SMTP Service Extension for Secure SMTP over Transport Layer Security as defined in RFC 3207. In this mode, the SMTP session begins on an unencrypted channel, then a STARTTLS command is issued by the client to the server to switch to secure communication using SSL. See RFC 3207 published by the Internet Engineering Task Force (IETF) for more information.</p>  <p>An alternate connection method is where an SSL session is established up front before any protocol commands are sent. This connection method is sometimes called SMTP/SSL, SMTP over SSL, or SMTPS and by default uses port 465. This alternate connection method using SSL is not currently supported.</p>  <p>This is the limitation of SmtpClient and publically documented here but often missed</p>  <p><a href="https://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.enablessl.aspx">https://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.enablessl.aspx</a></p>  <p>You may also ask your service provider to see if they can support STARTTLS sessions, which is fairly secure and not too complex to implement. </p>  <p>You have an option to use either CDOSYS / System.Web.Mail from .Net 1.1 which internally uses CDOSYS to send out email. CDOSYS had this support but then the support was dropped in System.Net.Mail. Some may argue that why this downgrade, when CDOSYS had this support why System.Net.Mail drop this support – well this is not really a downgrade but a design decision that they made to support only one of the two optional ways to implement SSL while the SMTPS is used less commonly when compared to TLS.</p>  <p>Here is the sample code that can do the job for you, please do not forget to add a reference to System.Web.dll into your project for this to work. I have compiled it on VS2008 and found it working.</p>  <p>Please do proper testing before using this code in production and treat this piece of code just for the sake of educational purpose.</p>  <pre class="csharpcode"><span class="kwrd">using</span> System;
<span class="kwrd">using</span> System.Collections.Generic;
<span class="kwrd">using</span> System.Text;
<span class="kwrd">using</span> System.Web.Mail;
 
<span class="kwrd">namespace</span> ConsoleApplication2
{
    <span class="kwrd">class</span> Program
    {
        <span class="kwrd">static</span> <span class="kwrd">void</span> Main(<span class="kwrd">string</span>[] args)
        {
 
            MailMessage msg = <span class="kwrd">new</span> MailMessage();
            msg.To = <span class="str">&quot;to@server.com&quot;</span>;
            msg.From = <span class="str">&quot;from@server.com&quot;</span>;
            msg.Subject = <span class="str">&quot;This is a test email using System.Web.Mail&quot;</span>;
            msg.Body = <span class="str">&quot;Hello There!!!&quot;</span>;
            msg.BodyFormat = MailFormat.Text;
 
            <span class="rem">// SMTP Server to use</span>
            msg.Fields.Add(<span class="str">&quot;https://schemas.microsoft.com/cdo/configuration/smtpserver&quot;</span>, <span class="str">&quot;smtp.server.com&quot;</span>);   
 
            <span class="rem">// SMTP Port to use</span>
            msg.Fields.Add(<span class="str">&quot;https://schemas.microsoft.com/cdo/configuration/smtpserverport&quot;</span>, <span class="str">&quot;465&quot;</span>);                 
            
            <span class="rem">// Send using Value, leave it to 2 for sending via SMTP Port specified</span>
            msg.Fields.Add(<span class="str">&quot;https://schemas.microsoft.com/cdo/configuration/sendusing&quot;</span>, <span class="str">&quot;2&quot;</span>);                        
            
            <span class="rem">// Use SSL : 0 = False, 1 = True</span>
            msg.Fields.Add(<span class="str">&quot;https://schemas.microsoft.com/cdo/configuration/smtpusessl&quot;</span>, <span class="str">&quot;1&quot;</span>);                       
 
 
            <span class="rem">// Authentication mode: </span>
            <span class="rem">//  0 - Anonymous</span>
            <span class="rem">//  1 - Basic</span>
            <span class="rem">//  2 - NTLM</span>
            msg.Fields.Add(<span class="str">&quot;https://schemas.microsoft.com/cdo/configuration/smtpauthenticate&quot;</span>, <span class="str">&quot;1&quot;</span>);
 
 
            <span class="rem">// Username and password to connect to the SMTP Server</span>
            msg.Fields.Add(<span class="str">&quot;https://schemas.microsoft.com/cdo/configuration/sendusername&quot;</span>, <span class="str">&quot;USERNAME_HERE&quot;</span>);
            msg.Fields.Add(<span class="str">&quot;https://schemas.microsoft.com/cdo/configuration/sendpassword&quot;</span>, <span class="str">&quot;PASSWORD_HERE&quot;</span>);
 
            SmtpMail.Send(msg);            
 
        }
    }
}</pre>
]]></content:encoded>
    </item>
    <item>
      <title>HOTFIX: .NET 4.0 (System.Net.Mail) Unable to send emails with large attachments (more than 3MB)</title>
      <link>https://docs.microsoft.com/archive/blogs/vikas/hotfix-net-4-0-system-net-mail-unable-to-send-emails-with-large-attachments-more-than-3mb</link>
      <pubDate>Tue, 20 Jul 2010 16:52:58 GMT</pubDate>
      <dc:creator><![CDATA[Vikas - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vikas/2010/07/20/hotfix-net-4-0-system-net-mail-unable-to-send-emails-with-large-attachments-more-than-3mb/</guid>
      <description><![CDATA[&#160;  We have an official release for the issue and if you are facing this problem then I would...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>We have an official release for the issue and if you are facing this problem then I would recommend you contacting PSS and refer to this blog</p>  <p><a title="https://blogs.msdn.com/b/vikas/archive/2010/04/05/bug-net-4-0-system-net-mail-unable-to-send-emails-with-large-attachments-more-than-3mb.aspx" href="https://blogs.msdn.com/b/vikas/archive/2010/04/05/bug-net-4-0-system-net-mail-unable-to-send-emails-with-large-attachments-more-than-3mb.aspx">https://blogs.msdn.com/b/vikas/archive/2010/04/05/bug-net-4-0-system-net-mail-unable-to-send-emails-with-large-attachments-more-than-3mb.aspx</a></p>  <p>I am expected it to be released in a public KB in some time but for the time being you can request for the hotfix by contacting PSS</p>  <p><strong>UPDATE - 7/21/2010</strong></p>  <p>If you prefer not to contact PSS, you can download the hotfix by yourself from the following link.</p>  <p><a href="https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=30226">https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=30226</a></p>]]></content:encoded>
    </item>
    <item>
      <title>FYI: MAPI Application does not work when running from Windows Service (MAPI_E_NETWORK_ERROR)</title>
      <link>https://docs.microsoft.com/archive/blogs/vikas/fyi-mapi-application-does-not-work-when-running-from-windows-service-mapi_e_network_error</link>
      <pubDate>Thu, 17 Jun 2010 09:53:19 GMT</pubDate>
      <dc:creator><![CDATA[Vikas - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vikas/2010/06/17/fyi-mapi-application-does-not-work-when-running-from-windows-service-mapi_e_network_error/</guid>
      <description><![CDATA[I recently had two cases where the MAPI application was failing while creating a dynamic profile...]]></description>
      <content:encoded><![CDATA[<p>I recently had two cases where the MAPI application was failing while creating a dynamic profile calling IMsgServiceAdmin::ConfigureMsgService. </p>  <p>Although if the same application is executed outside Service Control Manager then it work and is able to create the profile just fine.</p>  <p>In both cases we found out that the older versions of OLMAPI32 had this problem and you MUST upgrade to the latest version <b>12.0.6514.5000 or above</b></p>  <p>Publically available latest version is “October 2009 security update” - <a href="https://support.microsoft.com/kb/972363">https://support.microsoft.com/kb/972363</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>