RE: Opening a Word Document from Access
- From: "Ofer" <Ofer@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 3 Jul 2005 15:12:01 -0700
Do you have reference to Microsoft Word 11.0 Object Library?
To check open any code section, or the immidiate window, select tools,
reference.
If you dont have then create by browsing and selecting MSWORD.OLB, probably
under c:\Program Files\Microsoft Office\Office11\
But its better to check by searching for it.
"turner" wrote:
> I am trying to Open a Word Document from an Access form "User Documentation"
> I get an Automation Error. I am using Access 2000 for testing. However, it
> will be installed using Access 97. Could some one please help:
>
> Private Sub Command0_Click()
>
> Dim objword As Word.Application
> Dim objDoc As Word.Document
> Dim DocPath As String
>
> DocPath = "c:\MyPath\UserDoc.doc"
>
> Set objword = New Word.Application
>
> '************************************************
> ' Automation Error - The Server Threw An Exception
> ' Run Time Error -2147417851
> ' Note - I have Triple Check the Path, It's Correct
> '************************************************
> Set objDoc = objword.Documents.Open(DocPath)
> '************************************************
>
> objDoc.Activate
> objword.Visible = True
>
> End Sub
.
- References:
- Opening a Word Document from Access
- From: turner
- Opening a Word Document from Access
- Prev by Date: Re: Multiple assignment of selected record
- Next by Date: RE: form header/footer
- Previous by thread: Opening a Word Document from Access
- Next by thread: Re: Opening a Word Document from Access
- Index(es):
Relevant Pages
|