automation

  • Thread starter Thread starter jebuss
  • Start date Start date
J

jebuss

I am trying to start an instance of MS Word 2000 from my Access 2000
database application, without success.

Here is how I am trying to do this

On my Form
General Declarations
Dim appWord as Word.Application
Dim appDoc as Word.Document

on Form Load
Set appWord = CreateObject ("Word.Application")

When I start my form I get the following error
User defined type not defined

I've checked my refereneces and have them checked for Visual basic, ms
access 9.0 library, ole automation, but there are a slew of references
in the listing that are not checked. Could this be my problem?

Any help is much appreciated
 
Yes, if you want to use early binding (Dim appWord As Word.Application)
you'll need a reference to the Microsoft Word Object Library.

If you'll want to deploy this application to other users, you might want to
consider using late binding (Dim appWord As Object) instead. See the help
files, the MSDN library (http://msdn.microsoft.com/library) or, if you have
the Developer edition of Office, the printed Office Developers Guide, for
details on early vs. late binding.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Brendan, thanks, it works sweet now (will study late binding as
suggested when I get a chance to catch my breath after this app is
done 8-)

Another question please

When my user clicks on the View Doc button on my form, the doc opens
as expected in msword. I would like to limit the user to these 3
options in word:
Viewing the document
Printing the document
Returning to the access input form (app)

Can I thru access cause this instance of word to open with a menu bar
offering these 3 items and not showing the default word menu?

Any help or pointers to the 'how to' of this manoeuver would be
happily appreciated. BTW, I am using msoffice 2000 for this work.

Thanks
 
Probably, but I'm not an expert on programming Word. If no one else answers
your question here, you might want to ask that question in a Word newsgroup.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Back
Top