|
-
Nov 18th, 2000, 04:23 PM
#1
Thread Starter
New Member
From VB6, I open a Word document and fill it with data from an Access db using Recordsets and DAO. This works fine. The problem is that I don't know how create a Table inside this document. The document ultimately will contain text and tables. Looking for suggestions! Thanks.
Dim RptDb as Database
Dim rsRpt as Recordset
Dim oDoc as Word.Document
Dim strDoc as String
Set oDoc = GetObject("pathname of emptyfile.doc")
...
rsRpt.MoveFirst
Do Until rsRpt.Eof
...
Select Case rsRpt("AnswerType")
Case "Text"
strDoc = ....
oDoc.Application.WordBasic.Insert strDoc
Case "Table"
...
If Not rsTbl.BOF and Not rsTbl.EOF then
'determine number of cols and rows needed
'now create the table, fill it with the
'Access data
Case ....
End Select
rsRpt.MoveNext
Loop
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
|