Dim Appword As word.application

  • Thread starter Thread starter john.9.williams
  • Start date Start date
J

john.9.williams

Hi

I am using this daclaration in a program

"Dim Appword As word.application"

when i run my program i get this error assigned to this

"Compile error userdefined type not defined"

I know i have to do something but not sure what, any help greatly
received

Johny
 
Use:

Set AppWord=CreateObject("Word.Application")

OR:

Add the Word object library reference to your project
 
Have you created a reference to the Word type library? Go to
Tools>References, scroll down to Microsoft Word, and check it.
 
You would do that instead of

Set AppWord = New Word.Application

but note my other post.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
You need to set a reference to the Word object library. In VBA,
go to the Tools menu, choose References, and scroll down to
Microsoft Word. Check that box.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Back
Top