User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » Word automation and templates Page [1]  
Shaggy
All American
17820 Posts
user info
edit post

So we do alot of faxing and printing and other stuff that requires templates. The way we've done this in the past is our account managers create a template specific to our client in word with bookmarks where data should be inserted. We have a list of valid bookmark names and then when a document needs to be created, we have an automated (VB6) app that grabs the data from the database, loads the template, fills out the bookmarks with the data, and then saves it off to be printed/faxed/whatevered.

This works ok and makes it very very easy to create templates. Anyone who can use word can create one. The only real problem is that word automation kinda sucks. It requires word to be installed wherever automation will be used and the libraries are all COM. Essentially word automation is exactly what it says. It launches a word instance (either hidden or shown) and then fills out each field exactly as if a user was filling it out manually. Then it saves the doc and closes the instance of word. This leads to all kinds of problems with hung instances and memory leaks if something screws up. Because of this we currently reboot the servers we do this on every day. Not a clean solution, but it works.

So now here I am trying to come up with a new solution. The old one has been working for like 6-7 years now. Most of our new development is done in Java so I've spent a good deal of time trying to find a java solution, but pickin's are slim. The Apache POI project doesnt support bookmarks and all the other solutions I've seen are just JNI or process exec wrappers around native word components.

Then I figured, well maybe theres other template stuff native to java. Maybe we dont need word at all. But thats even worse than JNI because while there are plenty of good template libraries, there aren't any with good user friendly template creation tools.

At this point my current strategy is to create a tool to convert a word doc template to a java friendly template (in this case Apache Velocity). So i'll still be using word automation, but it would only be run here and there to convert new/changed templates from word to Velocity. Greatly decreasing the impact of a word automation fuck up.

My questions for you lot are:
1) What do you use for templating? What does your template system have for template creation tools?
2) Is there any way to open/read/write word docs+bookmarks without using word automation?

12/13/2010 9:53:36 AM

Shaggy
All American
17820 Posts
user info
edit post

Bonus question that is related but is really more of a c#/visual studio/com question:

When using this stuff alot of the calls to word require passing (ref variable) instead of the actual variable. This is really the first time I've done anything in C# so is this a standard c# thing or an artifact of using COM stuff in C#?

12/13/2010 9:56:34 AM

Novicane
All American
15416 Posts
user info
edit post

File maker 11?

12/13/2010 11:31:43 AM

Shaggy
All American
17820 Posts
user info
edit post

that looks like a crm. i guess it might have its own internal template system but thats not what im looking for.

our process is someone in the call center does work -> application generates external message -> application picks up external message details + builds appropriate document from template -> document is submitted to a printer/fax server/whatever.

if filemaker has a template system thats separate from whatever it is their product is i might be interested. their website sucks though.

12/13/2010 1:03:31 PM

 Message Boards » Tech Talk » Word automation and templates Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.