Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Opening a Word Document from MS Access 2010

Posted on 2014-09-15
2
Medium Priority
?
1,731 Views
Last Modified: 2014-09-15
I hope someone can help.

I have been using the following code successfully in a database that was written in Access 2003.  When I try to use it in an Access 2010 database I get a Run time Error 424 Object Required on line Set WordDoc.  I have checked references and Access 14.0 Object Library, Word Object Library 14.0 are both set.  Is there a different coding needed for 2010?

   'Open Word Document for Merge
   
   Dim WordApp, WordDoc As Object
   Set WordApp = CreateObject("Word.Application")
   
   Set WordDoc = WordApp.Documents.Open(Forms!HomePage_TaskList!DocumentsFolders & Me.Letters.Column(2))
   WordApp.Visible = True
0
Comment
Question by:PerksP
2 Comments
 
LVL 8

Accepted Solution

by:
Wilder_Admin earned 2000 total points
ID: 40322828
Use that instead:

Private Sub Command30_Click()
Application.FollowHyperlink "T:\G4\Maint\Fac Reports.doc"
End Sub
0
 

Author Comment

by:PerksP
ID: 40322856
Great, that worked.  Many thanks
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question