.NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge?
Go Back  Xtreme Visual Basic Talk > > > .NET Dataset -> Word .dot Template -> Best way to Merge?


Reply
 
Thread Tools Display Modes
  #1  
Old 09-16-2005, 07:09 AM
Joker797's Avatar
Joker797 Joker797 is offline
Regular
 
Join Date: Jan 2004
Location: Dublin, Ireland
Posts: 67
Default .NET Dataset -> Word .dot Template -> Best way to Merge?


Hi,

I've had a look on the Microsoft website, but haven't really gotten anywhere with this..... so back to the best place to get a question answered - XtremeVB!

I'm looking at the best way to do a Merge with Word, from a Dataset in .NET to a .dot template. The .dot template can contain a table which will have multiple lines (e.g. if it is Orders, the table will have one line with the fields in it, but will grow depending on the number of Order lines).

At the moment I'm converting the Dataset to XML (using WriteXML), and using a component which opens up Word as a object, then replaces each field one-by-one. The thing is it's very slow, programmatically replacing all the fields in a large document can take some time......

There must be a better, faster way to do this? I'm thinking there is a function in Word Automation to give it an XML file to merge itself, which would mean Word doing the work and not the communication between .NET and Word line by line.

Any suggestions?
__________________
What if the Hokey Kokey IS what it's all about?
Reply With Quote
  #2  
Old 09-16-2005, 03:44 PM
herilane's Avatar
herilane.NET Dataset -> Word .dot Template -> Best way to Merge? herilane is offline
Unashamed geek

Retired Moderator
* Expert *
 
Join Date: Jul 2003
Location: London, England
Posts: 8,988
Default

If you're using Word 2003, how about saving the Word document as xml and then working on the xml file instead? That should be faster than automation. If you need the final output as doc then you can use automation to open the xml and re-save as doc.
Reply With Quote
  #3  
Old 09-19-2005, 02:05 AM
Joker797's Avatar
Joker797 Joker797 is offline
Regular
 
Join Date: Jan 2004
Location: Dublin, Ireland
Posts: 67
Default

Thanks for your reply herilane, good to hear from you - how are you getting on?

At the moment I'm using OfficeXP with the Application, that is what I have at home and in the production environment. I have 2003 here in work, so I'll have a little play around with that and see how I go.

You're saying that instead of using a .dot, save the template Word document as xml, then I would presume open this in VB and work with -> adding the required values from the Dataset etc, then save the xml, then open it in Word to present to the User? (sometimes they need to make some changes before printing)
__________________
What if the Hokey Kokey IS what it's all about?
Reply With Quote
  #4  
Old 09-19-2005, 02:48 PM
herilane's Avatar
herilane.NET Dataset -> Word .dot Template -> Best way to Merge? herilane is offline
Unashamed geek

Retired Moderator
* Expert *
 
Join Date: Jul 2003
Location: London, England
Posts: 8,988
Default

Yes, that's exactly what I meant.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
.NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge? .NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge?
 
.NET Dataset -> Word .dot Template -> Best way to Merge?
.NET Dataset -> Word .dot Template -> Best way to Merge?
 
-->