<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx</link><description>In the last post, I showed you how to use the Packaging API to find a particular part and get that part's URI. The relationship and URI of the particular part are important as you cannot rely on the name of the part being the persisted from save to save.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Programmatically remove parts from an Office file</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#537914</link><pubDate>Thu, 23 Feb 2006 19:18:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:537914</guid><dc:creator>Brian Jones: Office XML Formats</dc:creator><description>Kevin Boske has another post on using the System.IO.Packaging assembly to work with the new Office Open...</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#538009</link><pubDate>Thu, 23 Feb 2006 21:07:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:538009</guid><dc:creator>KevinBoske</dc:creator><description>Sorry everyone, I didn't realize that Anonymous comments were turned off by default. &amp;nbsp;I've turned them on, you may now comment with impunity.&lt;br&gt;</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#538648</link><pubDate>Fri, 24 Feb 2006 17:48:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:538648</guid><dc:creator>Stephane Rodriguez</dc:creator><description>&lt;br&gt;Cool. Now that comments are enabled, I can give some feedback.&lt;br&gt;&lt;br&gt;First thanks for posting. I think it's nice to keep a lot of this stuff in a single place. So far, pages related to this topic are scattered in a number of places, the msdn winfx system io packaging pages, the XPS samples, the SDK itself, complete with a bad rendering experience with msdn when using a certain open source browser. By the way, I think the SDK should be in this blog side bar, handy.&lt;br&gt;&lt;br&gt;I have a lot of comments, but I'll probably spare you from them from now. One cosmetic request though : the code snippets don't read well because of the indentation (in either IE, Firefox, or a RSS client).&lt;br&gt;&lt;br&gt;Besides this, since you seem to insist on a &amp;quot;foreach&amp;quot; pattern even when you are really querying a single part of a package, I wonder what the LINQified version of this code looks like. &lt;br&gt;&lt;br&gt;</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#538651</link><pubDate>Fri, 24 Feb 2006 17:53:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:538651</guid><dc:creator>Stephane Rodriguez</dc:creator><description>&lt;br&gt;Now for a true technical comment. In regards to the API it seems that the separation between a rel id and a part id is publicly exposed in the API. My question is why? Isn't a part uniquely identified by its absolute path?&lt;br&gt;A corollary to this is that, when you delete a part, you are calling two methods, which means the guts of the SDK are really exposed on the developer. All while I can't see any good reason for that to be the case. Frankly, I would see nothing wrong to be able to say : GetPartById(absolutepath).Delete(), and have the implementation do what you are doing above.&lt;br&gt;&lt;br&gt;The lack of atomciity calls for troubles in my book. I mean, what about concurrency, failure (the documentation says nothing about what exception might be raised, to the point it makes you wonder if any may be raised at all), rollback?&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#538697</link><pubDate>Fri, 24 Feb 2006 19:10:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:538697</guid><dc:creator>KevinBoske</dc:creator><description>Hi Stephane, &lt;BR&gt;&lt;BR&gt;Sorry about the code that you see on the blog. &amp;nbsp;It's an unfortunate side-effect of the blog software we use. &amp;nbsp;The line width is too small. &amp;nbsp;If you download and look at the actual snippet in VS, it will look the way it is intended. &lt;BR&gt;&lt;BR&gt;I will post something that describes how all of this fits together. &amp;nbsp;The System.IO.Packaging assembly is designed for use with any Open Packaging Convention file. &amp;nbsp;Office Open XML files are just an implementation of that spec, as are XPS files. &amp;nbsp;So, yes, the guts of the SDK are exposed. &amp;nbsp; &lt;BR&gt;</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#538881</link><pubDate>Sat, 25 Feb 2006 00:55:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:538881</guid><dc:creator>Stephane Rodriguez</dc:creator><description>&lt;br&gt;&amp;quot;It's an unfortunate side-effect of the blog software we use.&amp;quot;&lt;br&gt;&lt;br&gt;In fact, taking a look at the htlk source code in this blog kind of proves that the blog engine uses a specialized control to translate a piece of source code into html. It's very different to the other blog content. But they've gotten drunk using MSO styles (oh! the irony). I'd recommend using external syntax highlighters available out there such as &lt;a rel="nofollow" target="_new" href="http://puzzleware.net/codehtmler/"&gt;http://puzzleware.net/codehtmler/&lt;/a&gt; or &lt;a rel="nofollow" target="_new" href="http://www.carlosag.net/Tools/CodeColorizer/Default.aspx"&gt;http://www.carlosag.net/Tools/CodeColorizer/Default.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#538882</link><pubDate>Sat, 25 Feb 2006 00:56:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:538882</guid><dc:creator>Stephane Rodriguez</dc:creator><description>&lt;br&gt;Following BrianJ's answer on being unable to add any non-relationship-aware file to a .(doc,xls,ppt)x file, I wonder if you can shed some light on this for us. Is this enforced when the file is committed, in the .Close() call, or is it up to the developer to ensure that all relationships and parts are properly synched up? Something that would be of interest is a &amp;quot;validation&amp;quot; snippet that can validate whether the resulting file is going to be fine or not next time it's opened in an Office app.&lt;br&gt;&lt;br&gt;I can see a number of code snippets around parts : factorize identical parts ; delete unused parts ; find signed parts ; rename rel identifiers so that they match the part uris ; get all parts that match an expression defined with Xpath ; same with a regexped- uri ; OLEify/unOLEify a package ; a generic part update mechanism based on a callback ; how many parts ; ...&lt;br&gt;&lt;br&gt;</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#538956</link><pubDate>Sat, 25 Feb 2006 03:26:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:538956</guid><dc:creator>Pavel</dc:creator><description>Hi Guis, &lt;br&gt;&lt;br&gt;I am a dat anylist for TAXBACK.COM. I do present my work mostly in Excel. I think the validatio part in the previous comment is a really strong point.&lt;br&gt;&lt;br&gt;thanks! greetings from Bulgaria&lt;br&gt;</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#538961</link><pubDate>Sat, 25 Feb 2006 03:37:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:538961</guid><dc:creator>KevinBoske</dc:creator><description>RE: Blog Software and layout of code:&lt;br&gt;&lt;br&gt;I think I spoke too soon. &amp;nbsp;I've been given some pointers by another blogger and I will see if I can get the code to look better over the weekend. &amp;nbsp;BTW: &amp;nbsp;The snippets of the code you see in the post are always available for download at the bottom of the post.</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#539987</link><pubDate>Mon, 27 Feb 2006 20:43:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:539987</guid><dc:creator>Stephen Bullen</dc:creator><description>Are these libraries exposed to COM, so we can do similar operations using VBA (i.e. from within the Apps)? If not, are there any plans to provide a COM wrapper for it?</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#540335</link><pubDate>Tue, 28 Feb 2006 07:44:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:540335</guid><dc:creator>KevinBoske</dc:creator><description>Steven,&lt;br&gt;No, these are not exposed through COM. &amp;nbsp;I'm not sure why you would want to expose the parts and Zip structure through the applications? Once the file is opened in the application, it is loaded into memory. You can already access a lot more of the file through VBA if you have the applications installed. &amp;nbsp;The packaging APIs are meant for working with the files in the Open Packaging Convention formats.</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#540454</link><pubDate>Tue, 28 Feb 2006 12:42:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:540454</guid><dc:creator>Stephen Bullen</dc:creator><description>Kevin, &lt;br&gt;My thinking is that many of the people who want to be able to process the new XML files are the historical Office power users and developers. I don't think many of them have yet adopted .Net and are doing most of their development in VBA (a language they know well). So I'm not talking about using VBA within a file to modify that same file, but I am talking about being able to write some simple VBA code to loop through a directory and process the files therein. I'm also thinking about a need to pre- or post-process a file being opened/saved in an Office App.&lt;br&gt;&lt;br&gt;In other words, is there any way we can work with the files in the OPC formats without coding it in .Net?</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#540908</link><pubDate>Wed, 01 Mar 2006 02:48:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:540908</guid><dc:creator>KevinBoske</dc:creator><description>There are native third-party Zip libraries available which you could use. &lt;br&gt;&lt;br&gt;The Packaging API's are part of the Windows Presentation Foundations in WinFX, which is entirely on .NET code. There is no non-managed Packaging API in V1. &amp;nbsp;&lt;br&gt;</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#541419</link><pubDate>Wed, 01 Mar 2006 21:25:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:541419</guid><dc:creator>Stephen Bullen</dc:creator><description>Kevin,&lt;br&gt;While I agree there are third-party zip libraries I could use to crack open the zip file to a temp folder, then use the MSXML library to process them and the zip library to zip it up again, that's extremely messy, probably slow and not that robust. From what I understand of the packaging API, it does all the manipulation in-place, doesn't it? Are there any plans to have a non-managed Packaging API story by the time Office 12 RTMs?</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#542251</link><pubDate>Thu, 02 Mar 2006 20:49:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:542251</guid><dc:creator>KevinBoske</dc:creator><description>I haven't looked that closely at any of the other ZIP implementations out there, so I can't comment on their relative merits. &amp;nbsp;But as I said in the previous response, we will not provide any non-managed Packaging API in V1.&lt;br&gt;&lt;br&gt; &amp;nbsp;</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#551829</link><pubDate>Wed, 15 Mar 2006 14:36:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:551829</guid><dc:creator>Wolfgang Meyer</dc:creator><description>Hi,&lt;br&gt;I tried to reproduce this excample. I have installed these Software: &lt;br&gt;- Windows XP SP2 German, &lt;br&gt;- VS2005, &lt;br&gt;- Winfx 3.0 Beta2 + Windows SDK.&lt;br&gt;&lt;br&gt;But on this row:&lt;br&gt;&lt;br&gt;using (Package officePackage = Package.Open(fileName, FileMode.Open, FileAccess.ReadWrite))&lt;br&gt;&lt;br&gt;I recieve this Exception:&lt;br&gt;&amp;quot;Required Types tag not found.&amp;quot;&lt;br&gt;&lt;br&gt;I tried to edit a word-Document produced by the actual 2007 Office System beta.&lt;br&gt;&lt;br&gt;What have I done wrong?&lt;br&gt;&lt;br&gt;Regards&lt;br&gt;Wolle&lt;br&gt;</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#552375</link><pubDate>Thu, 16 Mar 2006 03:06:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:552375</guid><dc:creator>KevinBoske</dc:creator><description>Wolfgang,&lt;br&gt;&lt;br&gt;You probably have the February CTP of WinFX, which will work with the Beta 1 Technical Refresh and future versions of the files. Sorry about this, we are a bit out of sync with the WinFX team. To use the Beta1 files, you will have to revert to the Januaray CTP of WinFX, but I recommend waiting for the Technical refresh of Beta1. &amp;nbsp;</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#556381</link><pubDate>Tue, 21 Mar 2006 12:12:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:556381</guid><dc:creator>Wolfgang Meyer</dc:creator><description>It works! Thx. &lt;br&gt;&lt;br&gt;Is there some documentation about the Package-Classes and the structure of an office document?&lt;br&gt;&lt;br&gt;Regards&lt;br&gt;wolle</description></item><item><title>re: Deleting a part</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#560571</link><pubDate>Sat, 25 Mar 2006 05:47:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:560571</guid><dc:creator>KevinBoske</dc:creator><description>Not yet, that will be coming with Ecma standardization. &amp;nbsp;For the time being, you can get sample files from the OpenXMLDevelopers site and Brian, myself, or anyone at the site will be happy to answer any questions.</description></item><item><title>Learning about Open XML on-line</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#562011</link><pubDate>Mon, 27 Mar 2006 18:26:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:562011</guid><dc:creator>OpenXML Developer</dc:creator><description>Links to blog posts that contain useful technical information for developers. &amp;nbsp;Open XML is a new standard, but there's some good information already available if you know where to look.</description></item><item><title> Kevin Boske VSTA Deleting a part | Shed Kits</title><link>http://blogs.msdn.com/kevinboske/archive/2006/02/22/537439.aspx#9643738</link><pubDate>Wed, 27 May 2009 09:33:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9643738</guid><dc:creator> Kevin Boske VSTA Deleting a part | Shed Kits</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://backyardshed.info/story.php?title=kevin-boske-vsta-deleting-a-part"&gt;http://backyardshed.info/story.php?title=kevin-boske-vsta-deleting-a-part&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>