|
-
Jun 11th, 2002, 03:40 PM
#1
Thread Starter
Junior Member
Opening Word and Documents,,, Automation Error
I am having trouble opening Word and a document from VB (and Access for that matter)
I copied the following code from the MSKB Q313193.
Private Sub Command1_Click()
Dim oWord As Word.Application
Dim oDoc As Word.Document
Dim oTable As Word.Table
Dim oPara1 As Word.Paragraph, oPara2 As Word.Paragraph
Dim oPara3 As Word.Paragraph, oPara4 As Word.Paragraph
Dim oRng As Word.Range
Dim oShape As Word.InlineShape
Dim oChart As Object
Dim Pos As Double
'Start Word and open the document template.
Set oWord = CreateObject("Word.Application")
oWord.Visible = True
Set oDoc = oWord.Documents.Add
'Insert a paragraph at the beginning of the document.
Set oPara1 = oDoc.Content.Paragraphs.Add
.
.
.
An instance of Word open with no document.
When I hit the Set oDoc = oWord.Documents.Add statement I get
Run-time error '-2147417851 (80010105)':
Automation Error
Anybody have any ideas on what would cause this.
Thanks
Bob T
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|