VS2005 using XML with Word project

Using VS2005 Beta 2 with office tools and Office 2003 Professional, I am trying to populate a large Word report template (lots of existing static text) with XML. It then allows manual changes on the word document to save changes to the XML. I can do this from the microsoft walkthroughs "Writing XML to Word 2003". However, I need the user to enter the data first on some type of form that saves there report entries to SQL Server and then generate this information as XML to the word document.
(1)What type of form can I use. Userform?Windows form? They seem to accept ADO instead of XML population?
(2)After that I need to send the XML information from the saved document back to SQL Server for storage. How in Visual Studio?
(3)How should I lay this out?
(4)Since I built this in VS2005 as an office project with a word template. How do I now get the form to launch prior to launching word?

Thanks for any insight.

[950 byte] By [Manonbbar] at [2008-2-19]
# 1

When you create a project with Office Automation Tools in Visual Studio, There are some settings that make the Word to be your start up form.

The simplest way to use your form to control the Opening of word documents is to write a wrapper class, that calls the Word automation object, you can use the existing class that was generated by VSTO and cut and paste the code into your wrapper class.

Now that you have done this, you need to handle ne word events, you can use the observer-listener pattern for the wrapper class.

Now you can have your form show up and then do all the manipulation you want to do with the Word Form. Word's inbuilt method of saving as xml always requires a folder, you cannot stream it, so the probable way to save the xml data is store it in a folder and retrieve it.

Hope this helps

//Mani

ManiSwaminathan at 2007-9-9 > top of Msdn Tech,.NET Development,XML and the .NET Framework...

.NET Development

Site Classified