Word 2000 Lines between bookmarks

G

Greg Rowland

Writing a macro to format a table of unknown length.

Need to find out how many rows/lines are between bookmark TOP and BOTTOM
so the values can be pasted to this statement
to satisfy NumRows;

Selection.ConvertToTable Separator:=wdSeparateByTabs, NumColumns:=6, _
NumRows:=7, Format:=wdTableFormatNone, ApplyBorders:=True,
ApplyShading:= _
True, ApplyFont:=True, ApplyColor:=True, ApplyHeadingRows:=True, _
ApplyLastRow:=False, ApplyFirstColumn:=True, ApplyLastColumn:=False,
_
AutoFit:=True, AutoFitBehavior:=wdAutoFitContent


Unless of course there is a better way.

Thanx in advance,

Greg
 
C

Cindy Meister -WordMVP-

Hi Greg,

NumRows (and NumColumns) are optional; Word should be able to figure this out
for itself, based on the separator + vbCR in the range or selection being
converted. I'd simply remove these arguments from your code...
Need to find out how many rows/lines are between bookmark TOP and BOTTOM
so the values can be pasted to this statement
to satisfy NumRows;

Selection.ConvertToTable Separator:=wdSeparateByTabs, NumColumns:=6, _
NumRows:=7, Format:=wdTableFormatNone, ApplyBorders:=True,
ApplyShading:= _
True, ApplyFont:=True, ApplyColor:=True, ApplyHeadingRows:=True, _
ApplyLastRow:=False, ApplyFirstColumn:=True, ApplyLastColumn:=False,
_
AutoFit:=True, AutoFitBehavior:=wdAutoFitContent

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top