<feed version="0.3" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://purl.org/atom/ns#" xml:lang="en-GB"><title>rohancragg - dotNet Blog</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/rohancragg/default.aspx" /><tagline type="text/html">currently into CSLA and .Net 2.0</tagline><id>http://dotnetjunkies.com/WebLog/rohancragg/default.aspx</id><author><url>http://dotnetjunkies.com/WebLog/rohancragg/default.aspx</url></author><generator url="http://communityserver.org" version="1.0.1.50214">Community Server</generator><modified>2004-05-12T13:27:00Z</modified><entry><title>Using .config files with NUnit and TestDriven.NET</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/rohancragg/archive/2006/02/17/135368.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:135368</id><created>2006-02-17T11:28:54Z</created><content type="text/html" mode="escaped">&lt;p&gt;&lt;/p&gt;I just emailed Jamie Cansdale at TestDriven.NET but in the meantime, this might come in useful to someone out there using TestDriven.NET...&lt;br&gt;&lt;br&gt;&lt;a href="http://www.testdriven.net/FAQ.aspx"&gt;As discussed in the FAQ&lt;/a&gt; you can use access appSettings values from a .config file.&lt;br&gt;&lt;br&gt;I discovered a way of making this just a little bit easier to manage:&lt;br&gt;&lt;ul&gt;&lt;li&gt;Add an 
App.Config file to your Class Library root folder along with all your tests, and rename it to match the name of the .dll of the unit test class library (e.g. MyProject.Tests.dll.config)&lt;/li&gt;&lt;li&gt;Add your config settings (i.e. appSettings and so on) in the normal way&lt;/li&gt;&lt;/ul&gt;It this point, when
trying to run a test, TestDriven (or possibly NUnit itself?) will not be able to find
your config settings because the config file should really have been
placed in the bin folder but we'd then need to manage 2 copies (one for
each of the Release and Debug folders), and anyway, it's easier for you to see
and manage the config file if it's in the project root folder along with all your other classes rather
than having to move it to the bin folder (because we'd then have to
mess about doing 'show all files' and 'include in project')
&lt;br&gt;&lt;br&gt;To get round this problem without having to move the config file:&lt;br&gt;&lt;ul&gt;&lt;li&gt;Add a pre-build command to the unit test project:&lt;br&gt;(i.e. under the Project Properties dialog (Build Events | Pre-Build Command Line))&lt;/li&gt;&lt;li&gt;enter the following command:&lt;br&gt;&lt;code&gt;xcopy $(ProjectDir)$(TargetFileName).config /YR&lt;/code&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;div id="mb_0"&gt;&lt;br&gt;this will copy the [tests.dll].config file to the (Release or Debug) bin folder&lt;br&gt;&lt;br&gt;Assumptions:&lt;br&gt;&lt;ul&gt;&lt;li&gt;
This advice applies to VS2003, it is probably very similar for VS2005
but I've not tried it (in fact, if I remember correctly, VS2005 has a
much more intuitive method for copying files into the bin directory at
build time which won't need an xcopy command...)&lt;/li&gt;&lt;li&gt;
Your unit tests reside in their own Class Library project&lt;/li&gt;&lt;/ul&gt;UPDATE: Jamie Cansdale has also now &lt;a href="http://weblogs.asp.net/nunitaddin/archive/2006/06/07/ClassLibrary-Projects-and-App.config.aspx"&gt;posted on this topic&lt;/a&gt;&lt;br&gt;&lt;/div&gt;&lt;img width="0" height="0" src="http://www.rohancragg.co.uk/blog/cptrk.ashx?id=6dd8e86c-0f02-403d-b58c-0a7629292aab"&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=135368" width="1" height="1"&gt;</content><slash:comments>1</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/rohancragg/commentrss.aspx?PostID=135368</wfw:commentRss></entry><entry><title>Subverting Tortoises</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/rohancragg/archive/2005/04/06/62655.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:62655</id><created>2005-04-06T16:50:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;The other day&amp;nbsp;I was looking again at where the excellent &lt;A href="http://www.flexwiki.com/"&gt;FlexWiki&lt;/A&gt; project has been progressing and&amp;nbsp;I decided I'd like to download the sourcecode, only to realise I'd need a CVS client to access the source-control database. I promptly downloaded &lt;A href="http://www.tortoisecvs.org/"&gt;TortoiseCVS&lt;/A&gt;&amp;nbsp;and was stunned to discover how easy it was to use. It got me thinking that I might as well start running a CVS locally on my machine for source-control.&lt;/P&gt;
&lt;P&gt;I then naturally revisited the idea of using &lt;A href="http://subversion.tigris.org/"&gt;Subversion&lt;/A&gt; instead as I had read many times how it&amp;nbsp;was "&lt;!--StartFragment --&gt;a compelling replacement for CVS"&amp;nbsp;. It so happens that I decided to just start off with &lt;A href="http://tortoisesvn.tigris.org/"&gt;TortoiseSVN&lt;/A&gt;&amp;nbsp;(a client app for Subversion) with the aim of seeing how that works and it turns out that it has an amazingly handy&amp;nbsp;feature whereby you can &lt;A href="http://tortoisesvn.tigris.org/docs/TortoiseSVN_en/ch03s03.html"&gt;use TortoiseSVN to setup and run a&amp;nbsp;source-control repository locally&lt;/A&gt;. TortoiseSVN then treats that location on your hard drive exactly as if it were a Subversion server proper.&lt;/P&gt;
&lt;P&gt;With this proliferation of Tortoises in my life I decided to hark back to my days as a Zoology student and have a look at what&amp;nbsp;other&amp;nbsp; Chelonia I might expect to find here in Europe. I like the Golden Greek Tortoise the best...&lt;/P&gt;
&lt;P&gt;&lt;IMG alt="Golden Greek Tortoise" hspace=0 src="http://www.chelonia.org/photogallery/photo18622/tgraecaterrestrisDS1.jpg" align=baseline border=0&gt;&lt;/P&gt;
&lt;P&gt;see &lt;A href="http://www.chelonia.org/European_Gallery.htm"&gt;http://www.chelonia.org/European_Gallery.htm&lt;/A&gt;&amp;nbsp;for more!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img width="0" height="0" src="http://www.rohancragg.co.uk/blog/cptrk.ashx?id=174082f0-b780-449d-a22d-86443de12b3a"&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=62655" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/rohancragg/commentrss.aspx?PostID=62655</wfw:commentRss></entry><entry><title>MCP-me</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/rohancragg/archive/2005/04/06/62917.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:62917</id><created>2005-04-06T15:48:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;I passed my first MCP exam today with a satisfyingly high score (hint: &amp;gt; 900)!&lt;BR&gt;&lt;BR&gt;I'm delighted to be able to say with confidence that I am now a certified expert in Developing and Implementing Web Applications with Visual C#.Net and Visual Studio.NET (070-315)&lt;/P&gt;
&lt;P&gt;[UPDATE] after kind congrats from &lt;A href="http://dotnetjunkies.com/WebLog/thomasswilliams/"&gt;Thomas Williams&lt;/A&gt;&amp;nbsp;I thought I'd say something about how I managed this feat ;-)&lt;!--StartFragment --&gt;&lt;/P&gt;
&lt;P&gt;For anyone else wanting to do the same, be aware that the MS Press books DON'T cover everything you need to know in the exams. While they're a good foundation they miss out material or don't go into enough detail. I have read very good reviews of the &lt;A href="http://www.amazon.co.uk/exec/obidos/ASIN/0789728222/rohancracouk-21?creative=6394&amp;amp;camp=1406&amp;amp;link_code=as1 "&gt;MCSD/MCAD Training Guide by Amit Kalani&lt;/A&gt;&amp;nbsp;if you want to be sure of not missing anything.&lt;/P&gt;
&lt;P&gt;Of course, there's no substitute for experience of actually using the technology (which is a good thing of course - dump the braindumps).&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG height=52 src="http://www.rohancragg.co.uk/blog/content/binary/MCP-RGB.gif" width=112 border=0 padding="50"&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P align=center&gt;&amp;nbsp;&lt;/P&gt;&lt;img width="0" height="0" src="http://www.rohancragg.co.uk/blog/cptrk.ashx?id=afb6d47a-3239-4994-9553-276787a86881"&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=62917" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/rohancragg/commentrss.aspx?PostID=62917</wfw:commentRss></entry><entry><title>Crosspost test</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/rohancragg/archive/2005/02/25/56604.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:56604</id><created>2005-02-25T12:11:00Z</created><content type="text/html" mode="escaped">This is just to test that &lt;A href="http://www.rohancragg.co.uk/blog"&gt;my new dasBlog blog&lt;/A&gt; is cross-posting OK to &lt;A href="http://www.sharepointblogs.com/rcragg/"&gt;my SharePoint blog&lt;/A&gt;&amp;nbsp;and to &lt;A href="http://dotnetjunkies.com/WebLog/rohancragg/"&gt;my dotnetjunkies blog&lt;/A&gt;&lt;img width="0" height="0" src="http://www.rohancragg.co.uk/blog/cptrk.ashx?id=84051f9b-c514-4b7e-949b-70e439e59cf0"&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=56604" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/rohancragg/commentrss.aspx?PostID=56604</wfw:commentRss></entry><entry><title>Should I use ASMX or not?!</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/rohancragg/archive/2004/10/08/28091.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:28091</id><created>2004-10-08T11:32:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;I think it's fair to say that I'm one of the unwashed masses that &lt;A href="http://hyperthink.net/blog/default.aspx"&gt;Steve Maine&lt;/A&gt; refers to in his article on &lt;A href="http://hyperthink.net/blog/PermaLink,guid,efd237dd-029b-4e51-91e4-711a8660c7c8.aspx"&gt;contract-first&amp;nbsp;is not the same as WSDL-first&lt;/A&gt;&amp;nbsp;(no offence taken) so&amp;nbsp;I don't have anything technical to add but I am currently&amp;nbsp;reading this and related info with great interest. I've been feeling really misled by the original hype about how ASMX was supposed to enable the building of solutions in a distributed architecture, without having to leave the comfortable surroundings of coding .Net classes and methods.&lt;/P&gt;
&lt;P&gt;I'm currently developing just in an intranet environment so&amp;nbsp;having tried to 'do the right thing'&amp;nbsp;and make use of Web Services for anything I might want to re-use in a number of client applications I've met with alot of grief. I quickly realised that starting&amp;nbsp;from my&amp;nbsp;object model in .Net code and then trying to squeeze that structure and logic through the WSDL pipeline to a client at the other end, lots of 'stuff' gets lost, and as &lt;A href="http://www.capescience.com/articles/wsdlfirst/index.shtml"&gt;Will Provost makes clear&lt;/A&gt;, this is also a problem in other environments such as Java.&lt;/P&gt;
&lt;P&gt;I was thinking I might have to resort to .Net Remoting instead&amp;nbsp;which didnt look like it was going to be&amp;nbsp;any easier at first glance, but then I started reading Christian Weyer's posts on how he has crafted a &lt;A href="http://weblogs.asp.net/cweyer/archive/2004/08/30/222725.aspx"&gt;Visual Studio .Net Add-In to make the WSDL/XSD-first approach much easier&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Thanks &lt;A href="http://weblogs.asp.net/cweyer/"&gt;Christian&lt;/A&gt;, I'll give it a try!&lt;/P&gt;

[UPDATE]
March 8 2005
The debate is growing: &lt;a href="http://www.theserverside.net/news/thread.tss?thread_id=32272" /&gt;Should Developers Be Forced To Learn WSDL?&lt;/a&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=28091" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/rohancragg/commentrss.aspx?PostID=28091</wfw:commentRss></entry><entry><title>Smart Documents just got easier</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/rohancragg/archive/2004/06/28/17736.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:17736</id><created>2004-06-28T14:06:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;I'm still trying to come to terms with what all the great new developments for Office Programability will mean (i.e. what should I use now, what should I keep an eye on for next year, what is just not relevant?) and I'll try and post some findings here.&lt;/P&gt;
&lt;P&gt;In the meantime I'm going to compile&amp;nbsp;a list of useful URL's here once I get a minute (useful for me that is, it you find it useful too then that's even better).&lt;/P&gt;
&lt;P&gt;But the first one I have to mention is &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dno2k3ta/html/odc_SmartDocsWrapper.asp"&gt;Smart Documents Made Easier for .NET Developers&lt;/A&gt;&amp;nbsp;on MSDN&amp;nbsp;courtesy of&amp;nbsp;&lt;A href="http://vertigosoftware"&gt;Vertigo Software&lt;/A&gt;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=17736" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/rohancragg/commentrss.aspx?PostID=17736</wfw:commentRss></entry><entry><title>OneNote Managed API</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/rohancragg/archive/2004/06/18/16893.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:16893</id><created>2004-06-18T08:31:00Z</created><content type="text/html" mode="escaped">Woohoo!, I love using &lt;A href="http://www.onfolio.com"&gt;Onfolio&lt;/A&gt; but I'm also starting to love using OneNote too (only wish I had a tablet PC) but the forthcoming &lt;A href="http://blogs.msdn.com/dolange/archive/2004/06/17/158976.aspx"&gt;managed API for OneNote&lt;/A&gt; really opens up some exciting possibilities for managing 'nebulous' research information in one place, now I can code it myself. I think I'll also suggest 'export to OneNote' as a feature request for Onfolio.&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=16893" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/rohancragg/commentrss.aspx?PostID=16893</wfw:commentRss></entry><entry><title>Unit Testing in Visual Studio 2005</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/rohancragg/archive/2004/06/14/16397.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:16397</id><created>2004-06-14T06:27:00Z</created><content type="text/html" mode="escaped">I agree that &lt;A href="http://www.peterprovost.org/archive/2004/06/12/1379.aspx"&gt;Unit Testing support should be included with all versions of Visual Studio 2005 and not just with Team System&lt;/A&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=16397" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/rohancragg/commentrss.aspx?PostID=16397</wfw:commentRss></entry><entry><title>To DataSet or not to DataSet?</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/rohancragg/archive/2004/06/10/16023.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:16023</id><created>2004-06-10T07:18:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;&lt;A href="http://weblogs.asp.net/aaguiar/archive/2004/06/03/147208.aspx"&gt;That is the discussion!&lt;/A&gt;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=16023" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/rohancragg/commentrss.aspx?PostID=16023</wfw:commentRss></entry><entry><title>Command-Line Reporting Services</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/rohancragg/archive/2004/06/04/15412.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:15412</id><created>2004-06-04T06:52:00Z</created><content type="text/html" mode="escaped">Mmmm! I like &lt;A href="http://sqljunkies.com/WebLog/Roman/archive/2004/06/03/2868.aspx"&gt;this&lt;/A&gt;.&amp;nbsp;The boss will like it too. I remember how much of a nightmare it was to think how to try and do something like this in Crystal (although maybe that was just me not being able to find it in the oh-so-easy-to-search documentation from Seagate ;-)&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=15412" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/rohancragg/commentrss.aspx?PostID=15412</wfw:commentRss></entry><entry><title>NotePad2</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/rohancragg/archive/2004/05/21/14127.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:14127</id><created>2004-05-21T09:18:00Z</created><content type="text/html" mode="escaped">&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=882170711-21052004&gt;&lt;A href="http://www.flos-freeware.ch/notepad2.html"&gt;I love NotePad2&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=882170711-21052004&gt;, you can do RegEx search/replace and loads more, but I have one suggestion. I can use the following Registry Key to add NotePad2 to my 'View Source' in Internet Explorer:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\View Source Editor\Editor Name]&lt;BR&gt;@="c:\Program Files\NotePad2\Notepad2.exe"&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;DIV&gt;&lt;SPAN class=882170711-21052004&gt;&lt;FONT face=Arial size=2&gt;BUT, I cannot find a way to make notepad2 open another instance of the progam. If I already have notepad2 running, a dialog&amp;nbsp;asks me if&amp;nbsp;I want to save the currently open file, which is not what I want, I want to have multiple notepad2 windows open.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN class=882170711-21052004&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN class=882170711-21052004&gt;&lt;FONT face=Arial size=2&gt;the -n switch usually works, so I&amp;nbsp;tried:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN class=882170711-21052004&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN class=882170711-21052004&gt;
&lt;DIV&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;"c:\Program Files\NotePad2\Notepad2.exe"&lt;SPAN class=882170711-21052004&gt; -n&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;SPAN class=882170711-21052004&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;SPAN class=882170711-21052004&gt;and &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;SPAN class=882170711-21052004&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN class=882170711-21052004&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;"c:\Program Files\NotePad2\Notepad2.exe&lt;SPAN class=882170711-21052004&gt; -n&lt;/SPAN&gt;"&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;But no luck, so I emailed the author. I'll post here if I find a solution.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;[&lt;STRONG&gt;Update:&lt;/STRONG&gt; thanks everyone for the useful comments, in fact I emailed Flo about this issue and in fact he/she has decided to release version 1.0.10 with ReuseWindow off by default. Fast work! maybe&amp;nbsp;it had already been on the TODO list?... some other interesting features now too - it just gets better!&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=+0&gt;&lt;FONT face=Arial size=2&gt;Thanks especially to&amp;nbsp;&lt;/FONT&gt;&lt;A href="http://weblogs.asp.net/whaggard/archive/2004/05/14/132229.aspx"&gt;&lt;FONT face=Arial size=2&gt;Wes&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt; for the Registry hack, useful for distributing to others in my team who might not think of this issue until they get to it, and might assume it's a bug:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;&lt;FONT size=2&gt;Under &lt;STRONG&gt;[HKEY_CURRENT_USER\Software\Notepad2\Settings]&lt;/STRONG&gt; you can add a new DWORD value with the name "&lt;STRONG&gt;ReuseWindow&lt;/STRONG&gt;" and give it a value of 0. This will have it open a new window by default.&lt;/FONT&gt;&lt;/FONT&gt;]&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;[&lt;STRONG&gt;Update2:&lt;/STRONG&gt; I found another post on &lt;A href="http://weblogs.asp.net/omars/archive/2004/04/30/124093.aspx"&gt;Completely Replacing Notepad.exe&lt;/A&gt;]&lt;/FONT&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=14127" width="1" height="1"&gt;</content><slash:comments>12</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/rohancragg/commentrss.aspx?PostID=14127</wfw:commentRss></entry><entry><title>VSTO - fun with Word Templates</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/rohancragg/archive/2004/05/12/13424.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:13424</id><created>2004-05-12T13:27:00Z</created><content type="text/html" mode="escaped">I have been getting very excited about VSTO. As soon as I started playing I realised that I'd be able to create a template project and have code that could fill in some of the fields such as names and addresses based on the XML nodes it finds in the template. 
&lt;P&gt;&lt;/P&gt;I decided that I could have one, very generic&amp;nbsp;.Net assembly that&amp;nbsp;fills-in fields within the document based on their names. I could then&amp;nbsp;hook-up multiple word templates to that assembly simply by making sure that the document template has the '_AssemblyLocation0' and '_AssemblyName0' custom properties mapping to the assembly in question. The beauty of this is that a non-developer could do the same as long as then followed the agreed naming convention for the XML nodes within the document.&lt;BR&gt;&lt;BR&gt;The challenge now was to have code that ran when opening a new document based on the template, but then 'un-hooking' the code from the resulting document so that it was just an ordinary letter or fax again. The answer was to delete the custom document properties as follows (I also show how I added some new custom document properties). 
&lt;P&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;PRE&gt;&lt;P dir=ltr&gt;ThisDocument.CustomDocumentProperties("_AssemblyLocation0").Delete()&lt;BR&gt;ThisDocument.CustomDocumentProperties("_AssemblyName0").Delete()&lt;BR&gt;With ThisDocument.CustomDocumentProperties&lt;BR&gt; .Add("NameID", False, Office.MsoDocProperties.msoPropertyTypeNumber, 14543)&lt;BR&gt; .Add("ClientCode", False, Office.MsoDocProperties.msoPropertyTypeString, "GS1564")&lt;BR&gt; .Add("AutoGeneratedDate", False, Office.MsoDocProperties.msoPropertyTypeDate, Now())&lt;BR&gt;End With&lt;/P&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr&gt;[UPDATE - I have since found&amp;nbsp;some info on the &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/html/wrlrfsetassemblynameandlocationmethod.asp"&gt;SetAssemblyNameAndLocation&lt;/A&gt; method, which you can use to set&amp;nbsp;assembly links&amp;nbsp;from an admin script]&lt;/P&gt;
&lt;P dir=ltr&gt;I came across a couple of things that had me stuck though, which I thought might be worth blogging about:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;I was totally stuck wondering why code I had put into a document template project didnt run when word created a new document based on that template.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;In the meantime I used Matt Reynolds' fantastic newsgroup aggregator to&amp;nbsp;have a search on the VSTO newsgroup:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;A href="http://www.dotnet247.com/247reference/msgs/47/237749.aspxAnd" target=_blank&gt;http://www.dotnet247.com/247reference/msgs/47/237749.aspx&lt;/A&gt;&lt;A href="http://www.dotnet247.com/247reference/msgs/47/237749.aspxAnd" target=_blank&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;/A&gt;And&lt;/A&gt; I found this:&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P dir=ltr&gt;"The reason the document does not execute the assembly is that the property _AssemblyLocation0 references a relative location. When the document or the template itself is moved to a different location, the assembly cannot be found any more.&lt;BR&gt;&lt;BR&gt;The easy workaround is to edit this property and make it an absolute location instead. It is easy to do that by hand by going to the menu File/Properties/Custom. It can also be done at runtime. One of the VSTO Word samples does exactly that in method MakeAbsoluteAssemblyLocation."&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr&gt;Which I think also makes a useful point which I have made a mental note of. Eventually I realised that, in this case,&amp;nbsp;I needed to put the code&amp;nbsp;into the 'ThisDocument_New 'procedure, instead of 'ThisDocument_Open'.&lt;/P&gt;
&lt;P dir =ltr&gt;See also the 'Assembly Cannot Be Found' section of this troubleshooting article: &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/html/wroriTroubleshootingInOfficeAtRunTime.asp"/&gt;Troubleshooting in Office at Run Time&lt;/a&gt;
&lt;P dir=ltr&gt;My challenge now is: How do I pass parameters such as a client ID so that my code knows what data to fill in?&lt;/P&gt;
&lt;P dir=ltr&gt;[UPDATE:&lt;/P&gt;
&lt;P dir=ltr&gt;I got some replies to this last question: &lt;A href="http://www.dotnet247.com/247reference/msgs/50/250487.aspx"&gt;http://www.dotnet247.com/247reference/msgs/50/250487.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;My feeling is that, since all our users will be using IE, the best way might be to go for a really simple solution and use javascript to pass some structured data (XML?) into the clipboard (using .execCommand("Copy")), as in: &lt;A href="http://www.dynamicdrive.com/dynamicindex11/copytext.htm"&gt;http://www.dynamicdrive.com/dynamicindex11/copytext.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Presumably VSTO can then attempt to access the clipboard data on opening...]&lt;/P&gt;
&lt;P dir=ltr&gt;[UPDATE 2:&lt;/P&gt;
&lt;P dir=ltr&gt;This post has been listed on &lt;a href=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_vsto2003_ta/html/OfficeVSTOBestOfBlogs2003.asp &gt;MSDN!&lt;/a&gt;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=13424" width="1" height="1"&gt;</content><slash:comments>1</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/rohancragg/commentrss.aspx?PostID=13424</wfw:commentRss></entry></feed>