J
Josha
Hi,
I am new to VB and still getting a handle on things. This is being done in
MSWord How do I repeat the below code for each new odd numbered page. If this
requires the use of line numbers instead of paragraph numbers to set the
range, see the remark in code.
Josha
Code:
Sub Test3()
Dim pChar As Variant
Set myDoc = ActiveDocument
'The following example creates a Range object beginning at the start
'of the second paragraph and ending after the third paragraph.
'The corresponding line numbers that need to be used are ln10 to ln15.
'The code must be repeated for each odd numbered page.
Set myRange = myDoc.Range(Start:=myDoc.Paragraphs(2).Range.Start , _
End:=myDoc.Paragraphs(5).Range.End)
For Each pChar In myRange.Characters
If pChar Like "[A-Z]" Then
pChar.Select
Selection.Range.Case = wdTitleWord
End If
Next
End Sub
--------------------------------------------------------------------------------
I am new to VB and still getting a handle on things. This is being done in
MSWord How do I repeat the below code for each new odd numbered page. If this
requires the use of line numbers instead of paragraph numbers to set the
range, see the remark in code.
Josha
Code:
Sub Test3()
Dim pChar As Variant
Set myDoc = ActiveDocument
'The following example creates a Range object beginning at the start
'of the second paragraph and ending after the third paragraph.
'The corresponding line numbers that need to be used are ln10 to ln15.
'The code must be repeated for each odd numbered page.
Set myRange = myDoc.Range(Start:=myDoc.Paragraphs(2).Range.Start , _
End:=myDoc.Paragraphs(5).Range.End)
For Each pChar In myRange.Characters
If pChar Like "[A-Z]" Then
pChar.Select
Selection.Range.Case = wdTitleWord
End If
Next
End Sub
--------------------------------------------------------------------------------