Feasibility of Writing UI to Replace XML Structure Pane

K

Kim Finleyson

Hello,

An application that my company wrote allows users to generate a schema that
describes the data they want to use in a custom Word document. At the end of
this process, the user clicks "finish," and Word opens with the schema
attached. From there, the user types the text of their document and adds
elements from the schema. Later, the user will select a record in the
application to use as the basis for the data that will be merged into their
document. Basically the Word template+schema will be combined with XML data
to generate a new document, with the selected data.

The problem with this approach is that our users absolutely do not like the
XML Structure pane in Word. So, I've been asked to research alternatives. Can
anyone suggest an approach? Would a VBA plug-in work? I would appreciate
suggestions and if possible, an assessment of how much work we are looking at
and the risks (for example, will we run into security issues?).

Thank you,

Kim Finleyson
Spartan Technology Solutions, Inc.
kfinleyson@[no spam]spartantechnology.com
 
C

Cindy M.

Hi =?Utf-8?B?S2ltIEZpbmxleXNvbg==?=,

Word 2003 or 2007?

What programming language does your company work with, generally?

Have you investigated the SmartDocument feature and/or VSTO document-level
customizations?
An application that my company wrote allows users to generate a schema that
describes the data they want to use in a custom Word document. At the end of
this process, the user clicks "finish," and Word opens with the schema
attached. From there, the user types the text of their document and adds
elements from the schema. Later, the user will select a record in the
application to use as the basis for the data that will be merged into their
document. Basically the Word template+schema will be combined with XML data
to generate a new document, with the selected data.

The problem with this approach is that our users absolutely do not like the
XML Structure pane in Word. So, I've been asked to research alternatives. Can
anyone suggest an approach? Would a VBA plug-in work? I would appreciate
suggestions and if possible, an assessment of how much work we are looking at
and the risks (for example, will we run into security issues?).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
K

Kim Finleyson

Any custom development would have to be compatible with both Word 2003 and
Word 2007, since many of our users are not yet using Word 2007. I was just
reading about VSTO this morning -- that sounds promising, though I would like
to find someone who has actually worked with this. I am not sure if Smart
Document would work...I found information about both of these on the Web, but
if you have links that you've found helpful, I would appreciate it. Thanks!
 
C

Cindy M.

Hi =?Utf-8?B?S2ltIEZpbmxleXNvbg==?=,
Any custom development would have to be compatible with both Word 2003 and
Word 2007, since many of our users are not yet using Word 2007. I was just
reading about VSTO this morning -- that sounds promising, though I would like
to find someone who has actually worked with this. I am not sure if Smart
Document would work...I found information about both of these on the Web, but
if you have links that you've found helpful, I would appreciate it
For VSTO you might want to start by browsing, then asking in the VSTO forum.
You'll also find links there to the documentation

http://forums.microsoft.com/msdn/showforum.aspx?
forumid=16&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=0

VSTO document-level customizations "wrap up" the ISmartDocument interface so
that it's easier to implement and work with. Whether VSTO or SmartDocument: a
solution created for Word 2003 can work in Word 2007. (I use "can" because there
are changes to how Word works between the two versions - not everything ports.
But for the most part, it does.)

One thing the SmartDocument interface does for you differently than VSTO is a
context-sensitive display of options in the Actions pane. With a SmartDocument,
you define that as part of the DLL you code. So if the user clicks within a
particular XML Node, the options for that (and any parent nodes) are visible.
This can also be done in a VSTO solution, but you need to work with events
instead of the context being automatic. That has advantages, as well (finer
control since parent nodes aren't an issue), just a different way of thinking
about it.

Looking at the security side of things, a VBA plug-in would trigger macro
security (also, no possibility of a "pane", it would have to be a toolbar or
user form). A SmartDocument DLL created using a COM application (VB6, for
example) shouldn't trigger any security. Anything done with managed code won't
trigger Office security warnings, but of course must be installed with .NET
Framework permissions. Best, in all cases, whether VBA or VSTO, would be to
digitally sign the code and use that as the "Trust" criteria - then you don't
need to worry about security messages.

Reading through your message again, my inclination is to say a VSTO document-
level customization template would be the way to go. (Template, as the users
will create multiple documents from it.)

<Thinking out-loud>
If you use VSTO you wouldn't necessarily have to use XML nodes and a schema. You
would have the option of letting them insert other types of "controls" (WinForm
or bookmarks). No matter which you choose (XMLNodes, WinForms controls or
bookmarks), these can be bound to the data-cache provided by the VSTO runtime
storage control embedded in the document. This will let you write the data to
the data cache, using the VSTO ServerDocument feature, without needing to
actually open the document, or having to parse the document's XML. (I'm guessing
you're planning to have the documents saved in Word 2003 XML? That wouldn't be
necessary using VSTO, if you don't want.) Just presenting alternatives the
technology would open up... </Thinking out-loud>

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top