<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dotnet thoughts &#187; Office Interoperability</title>
	<atom:link href="http://www.dotnetthoughts.net/category/net/office-interoperability/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotnetthoughts.net</link>
	<description>a dotnet developer&#039;s technical blog</description>
	<lastBuildDate>Thu, 02 Feb 2012 03:18:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Covert PowerPoint Slides to Images</title>
		<link>http://www.dotnetthoughts.net/2009/10/09/covert-powerpoint-slides-to-images/</link>
		<comments>http://www.dotnetthoughts.net/2009/10/09/covert-powerpoint-slides-to-images/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 10:38:27 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[.Net 3.0 / 3.5]]></category>
		<category><![CDATA[Office Interoperability]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[C#.Net]]></category>
		<category><![CDATA[Office Automation]]></category>
		<category><![CDATA[Office Interop]]></category>
		<category><![CDATA[Powerpoint]]></category>

		<guid isPermaLink="false">http://anuraj.wordpress.com/?p=427</guid>
		<description><![CDATA[Today one of my colleague comes with a problem; he want to display a Powerpoint presentation in his Sharepoint site. But we didn&#8217;t got any direct way to display it. They we tweaked the code, to export the Slides to &#8230; <a href="http://www.dotnetthoughts.net/2009/10/09/covert-powerpoint-slides-to-images/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today one of my colleague comes with a problem; he want to display a Powerpoint presentation in his Sharepoint site. But we didn&#8217;t got any direct way to display it. They we tweaked the code, to export the Slides to images and display it using the a custom slideshow web part, like the AjaxToolkit slideshow control.</p>
<p>I am attaching the code to export all the slides from a Power Point to Images</p>
<pre class="brush: csharp; title: ; notranslate">
string ExportLocation = &quot;C:\\Sample&quot;;
Microsoft.Office.Interop.PowerPoint.Application ppApp = new Microsoft.Office.Interop.PowerPoint.Application();
ppApp.Visible = MsoTriState.msoTrue;
ppApp.WindowState = PpWindowState.ppWindowMinimized;
Microsoft.Office.Interop.PowerPoint.Presentations oPresSet = ppApp.Presentations;
Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open(&quot;C:\\ScreenShots.ppt&quot;,
            MsoTriState.msoFalse, MsoTriState.msoFalse,
            MsoTriState.msoFalse);
ppApp.ShowWindowsInTaskbar = MsoTriState.msoFalse;	//Hiding the application; But it will be displayed always
try
{
    Slides objSlides = oPres.Slides;	//Getting all the slides
    for (int i = 1; i &lt; objSlides.Count - 1; i++)
    {
        string file = Path.Combine(ExportLocation, string.Format(&quot;{0}.{1}&quot;, objSlides[i].Name, &quot;jpg&quot;));
        oPres.Slides[i].Export(file, &quot;jpg&quot;, 800, 600);
    }
}
finally
{
    ppApp.Quit();	//Closing the Powerpoint application. Sometimes it won't work too.
}
</pre>
<p>Thanks to <strong>ArunKumar</strong>, for providing the code snippet.</p>
<div class="betterrelated"><p><strong>Related content:</strong></p>
<ol><li> <a href="http://www.dotnetthoughts.net/2009/09/23/import-export-data-in-ms-excel-using-c/" title="Permanent link to Import / export data in MS Excel using C#">Import / export data in MS Excel using C#</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/02/16/import-data-from-excel-using-c-part-2/" title="Permanent link to Import Data from Excel using C# &#8211; Part 2">Import Data from Excel using C# &#8211; Part 2</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2009/09/30/convert-image-to-icon-using-c/" title="Permanent link to Convert Image to Icon using C#">Convert Image to Icon using C#</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2008/04/25/printing-infopath-forms/" title="Permanent link to Printing Infopath forms">Printing Infopath forms</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2007/09/20/calling-word-macros-from-net/" title="Permanent link to Calling word Macros from .Net">Calling word Macros from .Net</a>  </li>
</ol></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2009/10/09/covert-powerpoint-slides-to-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating CAB files using MakeCab.exe</title>
		<link>http://www.dotnetthoughts.net/2008/05/02/creating-cab-files-using-makecabexe/</link>
		<comments>http://www.dotnetthoughts.net/2008/05/02/creating-cab-files-using-makecabexe/#comments</comments>
		<pubDate>Fri, 02 May 2008 12:25:54 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Office Interoperability]]></category>
		<category><![CDATA[sharepoint]]></category>

		<guid isPermaLink="false">http://anuraj.wordpress.com/?p=82</guid>
		<description><![CDATA[If you are working with Sharepoint or Infopath sometime you need to use makecab.exe, it is a command line utility to create cab files from Microsoft. You can use makecab utility from command prompt. Command line output from MakeCab/? MAKECAB &#8230; <a href="http://www.dotnetthoughts.net/2008/05/02/creating-cab-files-using-makecabexe/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are working with Sharepoint or Infopath sometime you need to use makecab.exe, it is a command line utility to create cab files from Microsoft. You can use makecab utility from command prompt.</p>
<p>Command line output from MakeCab/?</p>
<p><code><br />
MAKECAB [/V[n]] [/D var=value ...] [/L dir] source [destination]<br />
MAKECAB [/V[n]] [/D var=value ...] /F directive_file [...]</code><br />
<code>source  - File to compress.<br />
destination  - File name to give compressed file. If omitted, the<br />
last character of the source file name is replaced<br />
with an underscore (_) and used as the destination.<br />
/F directives - A file with MakeCAB directives (may be repeated).<br />
/D var=value - Defines variable with specified value.<br />
/L dir - Location to place destination (default is current directory).<br />
/V[n] - Verbosity level (1..3)</code></p>
<p>But I was unable to create the cab file with multiple files using this. After a long search I found one solution from <a href="http://msdn.microsoft.com/en-us/library/ms916839.aspx" target="_blank">MSDN &#8211; Using MakeCab.exe</a>. Then I have created one .ddf file and using the command</p>
<p><code><br />
makecab.exe /f Sample.ddf<br />
</code></p>
<p>And in the sample.ddf you can specify the file names.</p>
<p><code><br />
;*** Sample Source Code MakeCAB Directive file example<br />
;<br />
.OPTION EXPLICIT ; Generate errors<br />
.Set CabinetNameTemplate="Sample.cab"<br />
.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single directory<br />
.Set CompressionType=MSZIP;** All files are compressed in cabinet files<br />
.Set UniqueFiles="OFF"<br />
.Set Cabinet=on<br />
.Set DiskDirectory1="Cabs"<br />
image1.gif<br />
image2.gif<br />
mystyle.xsl<br />
manifest.xsf<br />
myschema.xsd<br />
script.vbs<br />
template.xml<br />
upgrade.xsl<br />
;*** &lt;the end&gt;<br />
</code></p>
<p>I think the code is self explanatory.</p>
<div class="betterrelated"><p><strong>Related content:</strong></p>
<ol><li> <a href="http://www.dotnetthoughts.net/2008/04/25/printing-infopath-forms/" title="Permanent link to Printing Infopath forms">Printing Infopath forms</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2009/04/03/gui-for-stsadm/" title="Permanent link to GUI for STSADM">GUI for STSADM</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2011/06/02/how-to-integrate-fxcop-to-visual-studio-2010-professional/" title="Permanent link to How to integrate FxCop to Visual Studio 2010 Professional">How to integrate FxCop to Visual Studio 2010 Professional</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/12/10/process-start-and-directory-setcurrentdirectory/" title="Permanent link to Process.Start() and Directory.SetCurrentDirectory()">Process.Start() and Directory.SetCurrentDirectory()</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/10/11/silverlight-in-sharepoint-wss-3-0/" title="Permanent link to Silverlight in Sharepoint (WSS 3.0)">Silverlight in Sharepoint (WSS 3.0)</a>  </li>
</ol></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2008/05/02/creating-cab-files-using-makecabexe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Printing Infopath forms</title>
		<link>http://www.dotnetthoughts.net/2008/04/25/printing-infopath-forms/</link>
		<comments>http://www.dotnetthoughts.net/2008/04/25/printing-infopath-forms/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 07:37:57 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Office Interoperability]]></category>
		<category><![CDATA[Infopath]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://anuraj.wordpress.com/?p=75</guid>
		<description><![CDATA[While working in Infopath forms, there may some situations where you may need to Print the InfoPath form. But the problem of Infopath API is that we can&#8217;t specify the printer name for printing. Like this one The printout method &#8230; <a href="http://www.dotnetthoughts.net/2008/04/25/printing-infopath-forms/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While working in Infopath forms, there may some situations where you may need to Print the InfoPath form. But the problem of Infopath API is that we can&#8217;t specify the printer name for printing. Like this one</p>
<pre class="brush: vb; title: ; notranslate">
InfoApp.XDocuments(0).PrintOut()
</pre>
<p>The printout method doesn&#8217;t have any parameters like Printer name or port etc. As a workaround you can export the Infopath document as Word, and print the document using Word API, where you can specify the printer name. To export the Infopath as Word there is no direct method, but you can do export to &#8220;MHT&#8221;(MHTML Document), and change the extention to &#8220;.doc&#8221; and using Word.Application you can open it and Print.</p>
<pre class="brush: vb; title: ; notranslate">
'Creating the Infopath application
Dim InfoApp As New InfoPath.Application()
'Opening the Infopath document.
InfoApp.XDocuments.Open(&quot;C:\Sample\template.xml&quot;)
'Exporting the document as Word(MHT)
InfoApp.XDocuments(0).View.Export(&quot;C:\Sample\Samplex.doc&quot;, &quot;MHT&quot;)
</pre>
<p>Let me know if you find any other solutions <img src='http://www.dotnetthoughts.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="betterrelated"><p><strong>Related content:</strong></p>
<ol><li> <a href="http://www.dotnetthoughts.net/2008/05/17/xpath-query-in-infopath-forms/" title="Permanent link to XPath query in Infopath forms">XPath query in Infopath forms</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2007/09/20/calling-word-macros-from-net/" title="Permanent link to Calling word Macros from .Net">Calling word Macros from .Net</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2008/05/02/creating-cab-files-using-makecabexe/" title="Permanent link to Creating CAB files using MakeCab.exe">Creating CAB files using MakeCab.exe</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2009/10/09/covert-powerpoint-slides-to-images/" title="Permanent link to Covert PowerPoint Slides to Images">Covert PowerPoint Slides to Images</a>  </li>
</ol></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2008/04/25/printing-infopath-forms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calling word Macros from .Net</title>
		<link>http://www.dotnetthoughts.net/2007/09/20/calling-word-macros-from-net/</link>
		<comments>http://www.dotnetthoughts.net/2007/09/20/calling-word-macros-from-net/#comments</comments>
		<pubDate>Thu, 20 Sep 2007 11:30:16 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Office Interoperability]]></category>
		<category><![CDATA[Interop]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[Word]]></category>

		<guid isPermaLink="false">http://anuraj.wordpress.com/2007/09/20/calling-word-macros-from-net/</guid>
		<description><![CDATA[While using Word automation with .Net sometimes it is required ti call, word macro&#8217;s from C# or VB.Net. Here is the code to call word macros from VB.Net. In the code, helloworld is the macro name.Or you can simply call &#8230; <a href="http://www.dotnetthoughts.net/2007/09/20/calling-word-macros-from-net/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While using Word automation with .Net sometimes it is required ti call, word macro&#8217;s from C# or VB.Net.</p>
<p>Here is the code to call word macros from VB.Net.</p>
<pre class="brush: vb; title: ; notranslate">
Dim WordApp As New Microsoft.Office.Interop.Word.Application
CType(WordApp, Object).GetType().InvokeMember(&quot;Run&quot;, Reflection.BindingFlags.Default Or Reflection.BindingFlags.InvokeMethod, Nothing, CType(WordApp, Object), New Object() {&quot;helloworld&quot;})
</pre>
<p>In the code, <em>helloworld</em> is the macro name.Or you can simply call <code>WordApp.Run("helloworld")</code> will also works fine.</p>
<p> </p>
<p>You can also refer link from Microsoft<br />
<a href="http://support.microsoft.com/kb/306683" target="_blank">http://support.microsoft.com/kb/306683</a></p>
<div class="betterrelated"><p><strong>Related content:</strong></p>
<ol><li> <a href="http://www.dotnetthoughts.net/2008/04/25/printing-infopath-forms/" title="Permanent link to Printing Infopath forms">Printing Infopath forms</a>  </li>
</ol></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2007/09/20/calling-word-macros-from-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

