Hi, I am trying to write my first application in VB6 that will create a Word file that has lots of text and a few tables. The overall goal is to create a quote in Word populated with data from our database.
My first goal is to write text followed by a table and then followed by more text using just VBA in Word and running the macro to test it. After that I can work it into a VB6 application.
I have recorded a macro inserting a table as follows:
My problem is that I don't know how to add additional text under the table. I can align and populate the table, but how do I get "out" of the table?
-Uncle Cake
My first goal is to write text followed by a table and then followed by more text using just VBA in Word and running the macro to test it. After that I can work it into a VB6 application.
I have recorded a macro inserting a table as follows:
Code:
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 8/9/2006 by
'
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:= _
5, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
wdAutoFitFixed
With Selection.Tables(1)
If .Style <> "Table Grid" Then
.Style = "Table Grid"
End If
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = True
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = True
End With
End Sub
My problem is that I don't know how to add additional text under the table. I can align and populate the table, but how do I get "out" of the table?
-Uncle Cake