<?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>ManvirSingh.net &#187; powerpoint</title>
	<atom:link href="http://www.manvirsingh.net/index.php/tag/powerpoint/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.manvirsingh.net</link>
	<description>Manvir&#039;s Blog!</description>
	<lastBuildDate>Tue, 01 Jun 2010 09:21:59 +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>Demystifying Microsoft Office Object Model &#8211; Part 2</title>
		<link>http://www.manvirsingh.net/index.php/demystifying-microsoft-office-object-model-part-2/</link>
		<comments>http://www.manvirsingh.net/index.php/demystifying-microsoft-office-object-model-part-2/#comments</comments>
		<pubDate>Sun, 23 May 2010 03:16:00 +0000</pubDate>
		<dc:creator>Manvir</dc:creator>
				<category><![CDATA[Office Automation]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[office]]></category>
		<category><![CDATA[powerpoint]]></category>
		<category><![CDATA[word]]></category>

		<guid isPermaLink="false">http://www.manvirsingh.net/?p=67</guid>
		<description><![CDATA[Hello everyone! In the last post we left off with a small example of how to automate Microsoft Office applications from our custom solutions. This week we are going to discuss about what does Microsoft Office object model means, and will discuss about various classes/interfaces available in the Office applications. As I had mentioned earlier, [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone! In the last post we left off with a small example of how to automate Microsoft Office applications from our custom solutions. This week we are going to discuss about what does Microsoft Office object model means, and will discuss about various classes/interfaces available in the Office applications.</p>
<p>As I had mentioned earlier, Microsoft Office applications (from now on, wherever I mentions this term, I am referring to Microsoft Word, Excel, and PowerPoint) are also COM (Component Object Model) servers. This enables them to provide a way for developers to use their features in other programs.</p>
<p>As a developer, all you need to do is call a function to launch the server, and once it is up and running, you can ask for the various interfaces provided by the server and utilize its functionality into your application.</p>
<p>The task of launching an Office application from your program can be performed in different ways depending on whether you are linking to the COM server’s type library statically, or you want to launch it dynamically. While linking statically, all you need to do is call the constructor of the main class of the COM Server and then you can access the other Interfaces by using properties/methods of the main class object. Linking dynamically involves calling <em>CoCreateInstance</em> API specifying either the CSLID or ProgID of the application to launch. In the example code of my <a title="Demystifying Microsoft Office Object Model - Part 1" href="http://www.manvirsingh.net/index.php/demystifying-microsoft-office-object-model-part-i/" target="_blank">previous post</a>, we have seen the static linking technique.</p>
<p>Each of the Office applications provide their main class by the name <strong>Application</strong>, and<em> </em>rest of the Interfaces/Classes that we can use are exposed as Properties of the Application class. It represents a running instance of the Sever and provides methods to manipulate its state like, activating it, setting its visibility etc.</p>
<p>After the Application class, each Office application provides a class that represents the document it works on. In case of Word it is Document class, for Excel it is called Workbook and in case of PowerPoint it is named as Presentation. The Application class maintains the list of all currently opened documents and provides a property that represents this collection. To access a particular document, we need to first get the collection and then find our required document object.</p>
<p>In case of Excel and PowerPoint, each working document contains another level of isolation for its contents. Excel provides separate Worksheets in a workbook and a PowerPoint presentation contains various Slides. You might say that even Word documents contain various Pages, and you are very right. However, Word doesn’t provide page as another isolation of its content. All of the content of a document is represented by the Document class only.</p>
<p>Ok, I think that is enough of the theory; let’s see how this architecture of Office applications can be depicted:</p>
<p> <img style="display: inline; border: 0px;" title="Office Object Model Architecture" src="http://www.manvirsingh.net/wp-content/uploads/2010/05/OOM12.png" border="0" alt="Office Object Model Architecture" width="640" height="335" /></p>
<p>As shown above, Range class is common to Word and Excel, and it represents the portion of the content that can be manipulated with these applications. In case of Word, it could represent a paragraph, a line of text, or a single word. In case of Excel, it represents a collection of Cells, or a particular cell. In PowerPoint, the content of a slide is represented by a collection of Shapes, i.e., each item of a slide in PowerPoint is a shape.</p>
<p>A point to be noted here is that even though I have mentioned Range/Shape as THE object to manipulate content in Office application, it not the only one. There are other objects, too, that can be used to play around with the content of these applications. Here is a small list of such objects:</p>
<ul>
<li>Word
<ul>
<li>Selection – type of Range object</li>
<li>Shapes – represents drawings, embedded images or objects, etc.</li>
<li>InlineShapes – shapes that are displayed in-line with text</li>
</ul>
</li>
<li>Excel
<ul>
<li>Rows – Range object representing a row of data in Excel</li>
<li>Columns – Range object representing a column of data in Excel</li>
<li>Cells – another Range object, for a single/multiple cell(s)</li>
<li>Shapes – represents drawings, embedded images or objects etc.</li>
<li>Selection – Represents any selected item on the sheet, could be a Cell, a Range of cells, or a Shape etc.</li>
</ul>
</li>
<li>PowerPoint
<ul>
<li>Selection – represents a currently selected object on the slide</li>
<li>SlideRange – object to manipulate single or multiple slides</li>
<li>TextRange – object to manipulate a selected piece of text</li>
<li>ShapeRange – object representing a collection of shapes</li>
</ul>
</li>
</ul>
<p>In <a title="Dymistifying Microsoft Office Object Model - Part 1" href="http://www.manvirsingh.net/index.php/demystifying-microsoft-office-object-model-part-i/" target="_blank">Part-1</a> of this post, we saw code snippets in VC++ and C# to insert a piece of text in a Word document. If you were to implement similar task for an Excel workbook or a PowerPoint Presentation, you can very easily implement it by knowing what type of object you should work with. For instance, you can use Range or Cell object in Excel, and you can use Shape object in case of PowerPoint.</p>
<p>With this, I am going to end this post. I am sure this post has broadened your view of how to work with Office applications. You can also refer to <a href="http://msdn.microsoft.com/en-us/office/aa905496.aspx">Microsoft Office SDK Documentation and Developer References</a> for more details and list of other classes/objects available to you.</p>
<p>In case you have any queries, please feel free to drop in your comments; I will be more than happy to respond.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.manvirsingh.net/index.php/demystifying-microsoft-office-object-model-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paste as Link of Excel Chart may fail in PowerPoint</title>
		<link>http://www.manvirsingh.net/index.php/paste-as-link-of-excel-chart-may-fail-in-powerpoint/</link>
		<comments>http://www.manvirsingh.net/index.php/paste-as-link-of-excel-chart-may-fail-in-powerpoint/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 17:08:56 +0000</pubDate>
		<dc:creator>Manvir</dc:creator>
				<category><![CDATA[Office (General)]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[powerpoint]]></category>

		<guid isPermaLink="false">http://www.manvirsingh.net/?p=28</guid>
		<description><![CDATA[While working with PowerPoint 2007 today I noticed a strange behavior: If you have a Chart in an Excel workbook, and you want to insert this chart as link in a PowerPoint Slide by using Paste Special, it may fail to paste anything in the slide if the current view is Outline View. Also, even [...]]]></description>
			<content:encoded><![CDATA[<p>While working with PowerPoint 2007 today I noticed a strange behavior:</p>
<p>If you have a Chart in an Excel workbook, and you want to insert this chart as link in a PowerPoint Slide by using Paste Special, it may fail to paste anything in the slide if the current view is Outline View.</p>
<p>Also, even if the current active tab on the Normal View of a PowerPoint presentation is Outline View and it has the input focus, PowerPoint will fail to paste anything. And, the stranger part is that you will not get any message box informing so!? (&#8230;not surprised!)</p>
<p><strong>How to avoid this:</strong></p>
<p>You can paste the chart by following any of the following ways:</p>
<ol>
<li>Close Pane 1 of Normal View.</li>
<li>Activate the Slides tab in Pane 1 (see screenshot below).</li>
<li>While keeping the Outline tab as selected tab in Pane 1, Activate Pane 2 (Slide pane) by clicking in it, before you select Paste Special.</li>
</ol>
<p style="text-align: center;"><img class="size-full wp-image-29 aligncenter" title="PowerPoint Panes" src="http://www.manvirsingh.net/wp-content/uploads/2009/06/powerpointpanes.jpg" alt="PowerPoint Panes" width="571" height="272" /></p>
<p> </p>
<p>Please note that you may encounter the issue even if the Outline tab in Pane 1 is activated and it has input focus.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.manvirsingh.net/index.php/paste-as-link-of-excel-chart-may-fail-in-powerpoint/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
