<?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>Dot Net 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>thoughts about .Net, WPF, Sharepoint, Javascript and more.</description>
	<lastBuildDate>Wed, 28 Jul 2010 09:59:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.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 images and display it using the a custom slideshow web part, like the AjaxToolkit slideshow [...]]]></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;">
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>
]]></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 [/V[n]] [/D var=value ...] [/L dir] source [destination] MAKECAB [/V[n]] [/D var=value ...] /F directive_file [...]]]></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>
]]></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 InfoApp.XDocuments(0).PrintOut() The printout method doesn&#8217;t have any parameters like Printer name or port etc. As a workaround you [...]]]></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;">
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;">
'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>
]]></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. Dim WordApp As New Microsoft.Office.Interop.Word.Application CType(WordApp, Object).GetType().InvokeMember(&#34;Run&#34;, Reflection.BindingFlags.Default Or Reflection.BindingFlags.InvokeMethod, Nothing, CType(WordApp, Object), New Object() {&#34;helloworld&#34;}) In the code, helloworld is the macro name.Or you can simply [...]]]></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;">
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>
]]></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>
