Thanks, that sounds good. But I'm afraid I'm not sure how to proceed to
convert to the borderless table you mentioned. Do you maybe have an example
that could get me started?
Thanks
Glenn Suggs was telling us:
Glenn Suggs nous racontait que :
> Thanks, that sounds good. But I'm afraid I'm not sure how to proceed
> to convert to the borderless table you mentioned. Do you maybe have
> an example that could get me started?
> Thanks
As an example to get you started:
'_______________________________________
Dim wrdDoc As Document
Dim rgeDoc As Range
Dim lngRecCount As Long
Dim lngFieldCount As Long
Dim i As Long
Set wrdDoc = ActiveDocument
Set rgeDoc = wrdDoc.Range
lngRecCount = 5
lngFieldCount = 5
With rgeDoc
For i = 1 To lngRecCount
.InsertAfter "strNetwork " & i
.InsertAfter vbTab
.InsertAfter "strVault " & i
.InsertAfter vbTab
.InsertAfter "strCSSName " & i
.InsertAfter vbTab
.InsertAfter "strCSSAddress " & i
.InsertAfter vbTab
.InsertAfter "strAccountNumber " & i
.InsertAfter Chr$(13)
Next
.ConvertToTable Separator:=wdSeparateByTabs, _
NumColumns:=lngFieldCount, _
NumRows:=lngRecCount
With .Tables(1)
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
.Borders(wdBorderHorizontal).LineStyle = wdLineStyleNone
.Borders(wdBorderVertical).LineStyle = wdLineStyleNone
.Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone
.Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone
.Borders.Shadow = False
.Columns(1).Width = InchesToPoints(1)
.Columns(2).Width = InchesToPoints(0.75)
.Columns(3).Width = InchesToPoints(2.5)
.Columns(4).Width = InchesToPoints(1.25)
.Columns(5).Width = InchesToPoints(0.5)
End With
End With
'_______________________________________

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Glenn Suggs - 27 Feb 2007 15:33 GMT
Hello Jean-Guy,
Thank you very much for the response. The code looks good but I seem to be
having some trouble making it work. I notice you have quotes around the
field names and of course I want to print the data instead of the field names
so I took the quotes out since I'm reading the fields in from a table
(Access). But even so, the data is lining up along the left margin instead
of in a horizontal row like I wanted.
Here's something that may make a difference. The first part of the document
stays the same so it is saved as it is, with one info line and the headers.
So the first thing my code does is to open that document. Then I read thru
the Access table and try to place the data beneath those headers in the
correct columns.
Thanks again for your help.

Signature
Glenn
> Glenn Suggs was telling us:
> Glenn Suggs nous racontait que :
[quoted text clipped - 53 lines]
> End With
> '_______________________________________
Jean-Guy Marcil - 27 Feb 2007 19:53 GMT
Glenn Suggs was telling us:
Glenn Suggs nous racontait que :
> Hello Jean-Guy,
> Thank you very much for the response. The code looks good but I seem
[quoted text clipped - 9 lines]
> data beneath those headers in the correct columns.
> Thanks again for your help.
As I wrote, my code was just a working example. You have to modify it to fit
your situation.
Post the relevant part of your code.

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org