G
Grenier
Automation a word report from Access. At run time, I want to be able to
insert 2 field type to a company name. One type for a TOC and a second for an
index. I'am using a table for an uniform layout. How can I simply insert
those field right after the company name in the cell ? Maybe I started all
wrong ?
Do until rst.eof
Set Tbl = Wrd.ActiveDocument.Tables.Add(Wrd.Selection.Range, 8, 2)
with Tbl
.Cell(1, 1).Range.Text = "Company name :"
.Cell(1, 1).Range.Style = wdStyleStrong
.Cell(1, 2).Range.Text = rst!CompName
'insert {XE "test"}{TC "Test" \l 1} after the company name...
end with
wrd.selection.InsertBreak Type:=wdSectionBreakNextPage
rst.movenext
loop
insert 2 field type to a company name. One type for a TOC and a second for an
index. I'am using a table for an uniform layout. How can I simply insert
those field right after the company name in the cell ? Maybe I started all
wrong ?
Do until rst.eof
Set Tbl = Wrd.ActiveDocument.Tables.Add(Wrd.Selection.Range, 8, 2)
with Tbl
.Cell(1, 1).Range.Text = "Company name :"
.Cell(1, 1).Range.Style = wdStyleStrong
.Cell(1, 2).Range.Text = rst!CompName
'insert {XE "test"}{TC "Test" \l 1} after the company name...
end with
wrd.selection.InsertBreak Type:=wdSectionBreakNextPage
rst.movenext
loop