VBA with Word Viewer (relates to MS Access and Word)

G

Ganeth

Hi all,

I'm going to start by talking about MS Access, but this is a Word question and relates to the Word VBA library.

The situation is I have a MS Access DB that will be running using the Access runtime environment. The application I'm developing is for a developing country, and therefore I cannot assume users will have Access or Word available. Developing the database is not a problem - there is a runtime version of Access and we have the budget to afford unlimited licenses for distribution. However, one of the outputs of the application needs to be a great variety of printed forms (tax returns, appeal applications, tax refund applications, etc) which all exist in Word format. Getting the DB to pull out data and programmatically write it to word documents is not a challenge - as long as the user has Word 2000 on their system. I'm doing it in a module in Access as below:

'get a load of data from the DB

dim wordObj as Object

Set wordObj = New Word.Application

wordObj.Visible = False

wordObj.Documents.Open "whateverTaxFormTheUserChooses.dot"

'programmatically search for placeholders in the tax form and replace with data from the DB

wordObj.Visible = True

'then print it, save it etc

Not a problem - BUT - can I still do this if my user does not have MS Word installed?

I've downloaded the Word Viewer, which is free and great so far as all that needs to be done is to open and print a document, but from what I can tell I won't be able to use it to generate documents on the fly like I'm doing above, so I guess my question is:

1) As long as I've got the appropriate libraries enabled in Access, can I still get at the classes I need to programmatically edit Word documents even if Word is not installed? (And then display them with the word viewer).

2) Do I have any other options?

Any advice from you knowledgable folks out there would be muchly appreciated.

Thanks,

Ganeth
 
J

Jezebel

No, this won't work if the users do not have Word installed.
Word.Application means, precisely, a licensed copy of Word on the target
machine. Perhaps a better approach, if more tedious at your end, is to write
the outputs as HTML, RTF, or use Crystal Reports. Or for that matter, the
god-awful Access reports. I wrote an application exactly along the lines you
describe a while ago: Access using Word for outputs. Client threw it back as
WAY too slow.

But before you go much further, have you tested the Access Runtime for your
intended purposes? Every usage of it I've met -- include two that I was
involved with (mea maxima culpa) -- were unmitigated disasters. The
installation is massive (over 100MB) and runs foul of every network policy
every invented. If you trawl the Access news forums you'll see there are
very very few references to it. Don't mean to dampen your parade or
anything, but truly, I've never seen a satisfactory outcome with Access
runtime.





"Ganeth"
Hi all,

I'm going to start by talking about MS Access, but this is a Word question
and relates to the Word VBA library.
The situation is I have a MS Access DB that will be running using the
Access runtime environment. The application I'm developing is for a
developing country, and therefore I cannot assume users will have Access or
Word available. Developing the database is not a problem - there is a
runtime version of Access and we have the budget to afford unlimited
licenses for distribution. However, one of the outputs of the application
needs to be a great variety of printed forms (tax returns, appeal
applications, tax refund applications, etc) which all exist in Word format.
Getting the DB to pull out data and programmatically write it to word
documents is not a challenge - as long as the user has Word 2000 on their
system. I'm doing it in a module in Access as below:
'get a load of data from the DB

dim wordObj as Object

Set wordObj = New Word.Application

wordObj.Visible = False

wordObj.Documents.Open "whateverTaxFormTheUserChooses.dot"

'programmatically search for placeholders in the tax form and replace with data from the DB

wordObj.Visible = True

'then print it, save it etc

Not a problem - BUT - can I still do this if my user does not have MS Word installed?

I've downloaded the Word Viewer, which is free and great so far as all
that needs to be done is to open and print a document, but from what I can
tell I won't be able to use it to generate documents on the fly like I'm
doing above, so I guess my question is:
1) As long as I've got the appropriate libraries enabled in Access, can I
still get at the classes I need to programmatically edit Word documents even
if Word is not installed? (And then display them with the word viewer).
 
G

Ganeth

Thanks for the heads up on that one - I'm only one week into the project so I won't look like a complete fool for changing the technology I'm using. I'll check it out. (Being a web sort, I've secretly wanted an excuse to do the whole thing in MySQL and PHP-GTK, or maybe Java, all along). Using Word documents for the forms is going to have to stay, though, this is like some daft legal thing (the forms are part of the new Income Tax Act, and once Parliament have approved it there'll be an earthquake or something if someone changes them without passing a dead chicken over them three times and hiring fifteen lawyers).

Thanks again,

Ganeth
 

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