Tab Position

  • Thread starter Thread starter Robert
  • Start date Start date
R

Robert

Hi,

I am new to VBA in Word. Would anyone be able to answer
this:

If I have two tabs and I am at the position starting at
the second tab, how can I determine in VBA if there is
anything at the first tab on the next line. For example:

Tab 1 Tab 2
Line 1 Some Text Some other text
Line 2 Yet more text

If there is a paragraph mark at the end of "Some other
text" on Line 1, when I return to the start of the next
line, how can I determine if there is anything at Tab 1
for the second line?

I hope I am explaining this clear enough! Any help would
be appreciated.

Thanks.
 
Sorry, Please disregard. I posted to the wrong group.

Sorry to all.
 
This code works for me. I believe there'e a newsgroup for Word and VBA
programming, so if the following doesn't solve your problem, you can ask
there.

Sub Test()
With ActiveDocument
For p = 1 To .Paragraphs.Count - 1
If Left$(.Paragraphs(p + 1).Range.Text, 1) = vbTab Then
Debug.Print p + 1, "tab"
Else
Debug.Print p + 1, "no tab"
End If
Next p
End With
End Sub
 

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

Back
Top