Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word 2000 VBA to generate report.. Selection.InsertRowBelow??

Status
Not open for further replies.

ftpdoo

Programmer
Aug 9, 2001
202
GB
Hi,

I'm using word 2000 to generate reports from a microsoft Access database using an ADO recordset.

problem:
----------

The new row is being added but the data focus is being set back to the first row and no data is appearing in the new row!!

' Print Script FIRST COLUMN Information
.ActiveDocument.Bookmarks("COLUMN_1").Select
.Selection.TypeText prsData!ScriptID
.Selection.TypeParagraph

' Add new Row in Table
.Selection.InsertRowsBelow 1


How do I set the focus to the new row??? I know it should happen automatically. I think i'm doing something wrong with the ".ActiveDocument.Bookmarks("COLUMN_1").Select" Line????????

Pleaassssssssssseeeeeee help,
Jonathan..
 
Have you tried the add approach, ie.

With NewDoc.ActiveWindow.Selection
If .Information(wdWithInTable) = True Then
.Rows.Add
Else
' Do something else
EndIf

Where Newdoc is your document object?

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top