Hello,

What's the best way to find whether a range (or selection) contains only =
table rows (and possibly, non-table text)?

Thanks,
Alex.

--=20
Address email to user "response" at domain "alexoren" with suffix "com"

Re: Range contains full table rows? by macropod

macropod
Fri Jun 02 10:28:01 CDT 2006

Hi Alex,

You could iterate through each storyrange in the range/selection, and test
whether the storyrange is in a table.

Cheers

--
macropod
[MVP - Microsoft Word]


"Alex" <inssup35@online.nospam> wrote in message
news:eTjheMlhGHA.3904@TK2MSFTNGP02.phx.gbl...
Hello,

What's the best way to find whether a range (or selection) contains only
table rows (and possibly, non-table text)?

Thanks,
Alex.

--
Address email to user "response" at domain "alexoren" with suffix "com"



Re: Range contains full table rows? by Alex

Alex
Fri Jun 02 11:47:26 CDT 2006

The formulation of the question was very confused.

Basically, I wanted to know whether the selection encompassed only =
complete table rows (including end-of-row markers).

Here's my solution:

Public Function OnlyCompleteRows(rng As Range) As Boolean
OnlyCompleteRows =3D False
If rng.Information(wdWithInTable) And =
rng.Information(wdStartOfRangeColumnNumber) =3D 1 Then
Dim rng2 As Range
Set rng2 =3D Selection.Characters.Last
rng2.Collapse(wdCollapseStart)
If rng2.Information(wdAtEndOfRowMarker) Then
OnlyCompleteRows =3D True
End If
End If
End Function

Can it be optimized?


Best wishes,
Alex.

--=20
Address email to user "response" at domain "alexoren" with suffix "com"