Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Defining MS Word as an Application in Access VBA


Message #1 by "Tammy Tappan" <GRTappan@e...> on Sun, 18 Nov 2001 22:36:42
I've created a query to determine which contacts have requested packets, 

based on the packet type (choice of 3) & the date requested. The packet 

type & date in for the query come from info on an active form. I've done 

this before, & sent the data to a report.



This time I want to send it to a Word document, inserting the 

name/address/etc info into merge fields. I've been trying to use the 

procedure shown in "Beginning Access 2000 VBA" by Robert Smith & David 

Sussman, from page 540 on (in case some responder has the book, to 

reference to). However, when I compile the database I get a compile error 

that "User-defined type not defined". The highlighted line is from the 

Declarations section, copied exactly from the book, as:



Private m_objWord as Word.Application



Any ideas why it doen't like this statement? Thanks, all!



+Tammy
Message #2 by "John Ruff" <papparuff@c...> on Sun, 18 Nov 2001 14:48:30 -0800
Have you referenced the Word library?  Go to Tools>References and check

the Microsoft Word library



John Ruff - The Eternal Optimist :-)







-----Original Message-----

From: Tammy Tappan [mailto:GRTappan@e...] 

Sent: Sunday, November 18, 2001 10:37 PM

To: Access

Subject: [access] Defining MS Word as an Application in Access VBA





I've created a query to determine which contacts have requested packets,



based on the packet type (choice of 3) & the date requested. The packet 

type & date in for the query come from info on an active form. I've done



this before, & sent the data to a report.



This time I want to send it to a Word document, inserting the 

name/address/etc info into merge fields. I've been trying to use the 

procedure shown in "Beginning Access 2000 VBA" by Robert Smith & David 

Sussman, from page 540 on (in case some responder has the book, to 

reference to). However, when I compile the database I get a compile

error 

that "User-defined type not defined". The highlighted line is from the 

Declarations section, copied exactly from the book, as:



Private m_objWord as Word.Application



Any ideas why it doen't like this statement? Thanks, all!



+Tammy

---

You are currently subscribed to access as: papparuff@c... To

unsubscribe send a blank email to $subst('Email.Unsub')





Message #3 by "Tammy Tappan" <GRTappan@e...> on Mon, 19 Nov 2001 13:59:52
YOU ARE A GENIOUS!! That was just tooooo easy!! I checked the library (don't ask how long I 

looked for it on the Tools menu until I realized I needed to be in the VBA window, not the 

database window!!), complied the database, & it accepted Word.



Of course, there are still other bugs to be worked out, but I'll play a while.



John, you did so good here - want to try any of the other questions I posted?  =)



+Tammy, a true Pollyanna herself!!!



> Have you referenced the Word library?  Go to Tools>References and check

> the Microsoft Word library

> 

> John Ruff - The Eternal Optimist :-)

> 




  Return to Index