none
Word Automation in Access VB 2007

    Question

  •  

    I am trying to use the Word Library in Microsoft Access VB to create a nicely formatted document/report to send as an e-mail attachment.

     

    I cannot find the Word Library in the Object Browser. Is this an add-in of some sort?

     

    Please let me know how I can add the library, Thank You!

     

    ~EKA~

    Tuesday, March 25, 2008 5:12 PM

Answers

  • The Word libraries can be used with Access, but only if you have Word installed. They do not come with Access.

     

    To make them available in an Access VBA script, you need to reference the libraries in your VBA project.

     

    I don't have Access 2007, only 2003, so it might be done a little differently in 2007.

    Start the Visual Basic Editor (VBE) with your VBA project as the active project. In the VBE, choose Tools - References. In the dialog box that appears, scroll down until you can see "Microsoft Word xx Object Library" - xx will be a number, I guess 12.0 for Word 2007. Tick the box beside it, then OK the dialog box. You should now be able to see the Word library in your object browser.

     

    Wednesday, March 26, 2008 3:37 AM

All replies

  • Maybe this is a silly question, but I am using the book "Access 2007 VBA for Data Centric Microsoft Office Application"

     

    Its showing the Word Library in Access VB, but I cannot find it in mine. I have some code that I want to try, but I do not have this library to use any of the properties, or methods.

     

    I have read about Automation, but I cannot see to figure this out. The book is explaining steps as if the library is already apart of the program, That's why I ask if this is an add-in...

     

    Any advice at all would be helpful, I'm totally stuck, Thanks!

     

    ~EKA~

     

     

    Tuesday, March 25, 2008 6:09 PM
  • The Word libraries can be used with Access, but only if you have Word installed. They do not come with Access.

     

    To make them available in an Access VBA script, you need to reference the libraries in your VBA project.

     

    I don't have Access 2007, only 2003, so it might be done a little differently in 2007.

    Start the Visual Basic Editor (VBE) with your VBA project as the active project. In the VBE, choose Tools - References. In the dialog box that appears, scroll down until you can see "Microsoft Word xx Object Library" - xx will be a number, I guess 12.0 for Word 2007. Tick the box beside it, then OK the dialog box. You should now be able to see the Word library in your object browser.

     

    Wednesday, March 26, 2008 3:37 AM