Re: Word automation, etc.



Hi Cindy,

Sorry, I cut and pasted this post and I left off the Word version. We will
be using Word 2003. The development environment is .NET (2003) and C#.

Yes, the tools will be common to all templates, only the layout of the
templates will be different. I'm not up on my Word terminology so I may be
using the wrong word here.

I like the idea of a "central" Addin...

The question I posed about loading a template from a URL - the action will
be the user clicks a button on a custom made toolbar to "request" a new job.
What I was hoping I could do is submit the request to a webserver and the
webserver send the template (or something to this effect. Maybe use file|open
functionality or LoadDocument?) .

I haven't tried "save as" back to the webserver yet. I will try it...

I have to check with the super on the tab key issue. I don't know if she
will allow me to use anything other than tab. If that's the case, I'll
probably go the keybindings/macro route...

Thank you so much for your input. You have no idea how much I appreciate it!

David


"Cindy M -WordMVP-" wrote:

> Hi =?Utf-8?B?d2lsc29uZA==?=,
>
> I think the first thing we have to know is, which version of Word are you
> targeting?
>
> Then, the programming environment in which you'll be working?
>
> More inline...
>
> > Toolbars. Can I create a custom toolbar (with my own custom actions that
> > will be performed upon clicking) that will only be available (visible?) under
> > certain circumstances. Say, perhaps, when a certain template was loaded? I
> > understand I can put the toolbars in a template document ( .dot file). Is
> > this correct? I don't particularly want to do that. There will be a "generic"
> > template but there will also be at least 4 different templates for each
> > client. The templates can not be stored on the local drive either (they must
> > be "fed" to the application upon user request). I was thinking an Add-in
> > here. But, I don't want the toolbar to load if say, the user starts Word the
> > "normal" way to type a letter to grandma, etc.
> >
> Traditionally, if you want tools to only be available in certain documents (or
> groups of documents) you place the toolbar there. In a template from which the
> documents are going to be created, for example. WHY would you not want to do
> that? Is it because the tools are common to all the templates?
>
> You can use an Addin (either the COM or template kind). However, the Addins
> "visibility" would have to be controlled by Events (such as DocumentChange).
> What you might do would be to have a "central" Addin that's always loaded. The
> user requests a document type through it, and the toolbars are created, on the
> fly, in the document, linked to events in the Addin. If you create them with the
> Temporary parameter set to "True", they'll disappear when the document is
> closed.
>
> > Can I load a document template from a url? Or I guess maybe the correct
> > question would be: Can I create a new document from a template that is stored
> > on a webserver? I need to do this without
> > "prompting" the user at all. The template, I suppose, could be saved
> > temporarily on the users hard-drive and then loaded from the hard-drive. I
> > would like to load it from the url and not have to save it to the hard-drive
> > first.
> >
> Default action when clicking a URL is to open that file. There's no way a URL
> can create a new document; this would have to be automation code. (If we're
> talking Word 2003 there are other possibilities)
>
> If the template isn't going to provide any tools (everything in the Addin), you
> could have the URL simply link to a document with all the necessary
> boiler-plate.
>
> > How can I save a document back to a web server? I cannot save it back to a
> > drive letter:\path because there won't be any mapped network shares. I cannot
> > allow the user to save the document on their local hard-drive either. I do
> > not want to "prompt" the user.
> >
> Let's hope your target version is Word 2003... Although most recent versions of
> Word do support saving to "http" targets. Have you tested saving back to a web
> server, yet, using File/Save As?
>
> > The document templates will have "fields" or "tags". For example, lets say
> > there are 5 tags: tag1, tag2, ...tag5. Let's say the cursor is in between
> > tag2 and tag3. Is there anyway I can capture the "tab" key such that when the
> > user presses it, it tabs between tags? For instance, say the cursor is in the
> > above mentioned place, the user presses the tab key and the cursor moves to
> > the "start" of the next tag (tag3). If the user presses "shift + tab" the
> > cursor moves back to the previous tag (tag1).
> >
> Word only supports this with formfields (see the Forms toolbar) and ActiveX
> controls (see the Controls toolbox) with form field protection in force.
>
> Using KeyBindings you can reassign most key presses, but only to VBA code within
> the current context (a macro in the template). You can use a callback to make it
> execute code in a DLL, but that callback still has to be in a local VBA project.
>
> A possibility could be to use "orphaned" macrobutton fields and have the users
> press F11 to move from field to field (Shift+F11 to move backwards).
>
> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
> 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 :-)
>
>
.


Loading