Hi,
This should be very simple but I have literally spent two hours trying to add a line break after a table then set the word range to the current cursor location. Can someone please guide me out of this wormhole. I know it is extremely simple but I am a hack. Thanks. Ron
Code:
'Active Loop Start
Set wdRng = .Bookmarks("Active").Range
Do While Not QueryM.EOF
'>>>>>I need to set the wdRng to current cursor location here??<<<<<
‘Insert Table
'Set wdtbl = .Tables.Add(Range:=wdRng, NumRows:=1, NumColumns:=6, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitFixed)
'With wdtbl
.Style = "Table Grid"
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = False
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = False
.ApplyStyleRowBands = True
.ApplyStyleColumnBands = False
.Borders(wdBorderLeft).Color = -603930625
.Borders(wdBorderRight).Color = -603930625
.Borders(wdBorderTop).Color = -603930625
.Borders(wdBorderBottom).Color = -603930625
.Borders(wdBorderVertical).Color = -603930625
With .Cell(1, 1).Range
.InsertAfter QueryM![DA Prefix] & QueryM![Year] & "/" & QueryM![DA No]
End With
‘>>>>>>I would like move the cursor to the end of the table and add a paragraph break after the table so that then next table will be placed after the previous one. But I don’t know how?? I can't use move to last character as it is not at the end of the document.<<<<<
End With
QueryM.MoveNext
'Active Loop Ends
Loop
QueryM.Close