471,338 Members | 1,119 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,338 software developers and data experts.

Building a Word 2003 Document with XML

I have an old product that generates a Word document using Word
Automation (tables, pictures, etc). The execution speed is quite slow
and I'm finally at the point where I can tell my customers that they
HAVE to have Office 2003.

That brings me to the potential of using .NET and building a Word
document using Word XML instead. The document won't have a specific
format - this product randomly produces a test by writing out question
groups, questions and answer choices. Some groups or questions may or
may not contain images. The answer area contains hidden text that
indicates the correct answer so that printing with hidden text turned
on produces the answer key.

In addition, the user enters the questions and answers in a rich text
box. So, formatting information such as font, color, bold, etc. is
embedded in a text string that I pull out of a
database.

Is doing something like this possible? Most of the examples I see
address filling in specific values in a template and not just
generating an entire document from scratch.

Also, can anyone recommend a good reference of the subject?
Thanks in advance!

Jul 21 '05 #1
2 1578
I've designed several computer-based questionnaires / test systems the way
you propose. Both with Windows Forms and Web Forms UI.

Test Generator creates questionnaire in XML format. This allows Windows
Forms, Web Forms and plain vanilla paper UI.
Results are stored in MS-SQL server. Reporting uses SQL Reporting Services.

You can create the XML file
a) with .NET XML classes (this is what I did up to now) or
b) wait for Visual Tools for Office 2003 in VS.2005 (I have no experience
with it) as this is a step towards what I call "server-based Office
automation".

I have not yet tested embedding Flash animations in XML files, it should be
possible. The Flash player control for .NET Windows Forms works ok.

Why do you bind your XML file to MS-Word as the target software to run the
tests?
Word doesn't give you enough control out of the box when running tests
(verify signature and decrypting the XML, test time limitation, ...)

I would design the XML file without Word in mind and offer Word as one of
the many user interface options. Think PDA and mobile network limitations!

Yet using Visual Tools for Office should cut your development time when
using Word-specific features (compared to manually coding using XmlWriter or
XmlSerializer...)

There is multimedia training material available for Visual Tools for Office
on MSDN -(wait for the 2005 updates if you have the time).

pls keep us updated about your design decisions!
best regards herbert

Jul 21 '05 #2
The software product generates test (in Word document form), it doesn't
have anything to do with administering them. The requirements for the
"editor" portion are to provide forms that allow the user to specify
questions and answers with rich text formatting and optional diagrams
(along with many other attributes such as group text & diagrams). The
requirements for the "test generator" are to take these questions and
produce a final test as a Word document (there's many different options
on how to generate the tests).

The technical question that I have is if I'm producing this kind of
"free-form" document with formatting embedded in rich text, is
WordProcessingML going to be of any use to me? I've gone through all
the articles that I can find on Word's XML features, but they're all
geared towards producing "report-style" documents.

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Neil | last post: by
2 posts views Thread by FinallyInSeattle | last post: by
6 posts views Thread by jimryder | last post: by
3 posts views Thread by Niyazi | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.