Hi there;
I need a code which searches for multiple question form sentences in a word document and selects (not highlights) all of them at once!
I am a newbie and I would be so grateful for any help
thanks
Hi there;
I need a code which searches for multiple question form sentences in a word document and selects (not highlights) all of them at once!
I am a newbie and I would be so grateful for any help
thanks
Can't be done. The Word VBA object model does not recognized discontinuous selections and can't make them either.
Dear Greg;
many thanks for your quick reply.
cheers
Anielo,
I hope that you get a notification that I've posted again. Actually, while perhaps bit crude, there may be a way to do this. If you apply a unique style to the text you want selected then this might work. Here the unique style is body text:
Sub SelectDiscontinuousRanges() Dim oPar As Paragraph Dim oEd As Editor With ActiveDocument For Each oPar In .Paragraphs If oPar.Range.Style = "Body Text" Then Set oEd = oPar.Range.Editors.Add(wdEditorEveryone) End If Next .SelectAllEditableRanges (wdEditorEveryone) .DeleteAllEditableRanges (wdEditorEveryone) End With lbl_Exit: Exit Sub End Sub
dear Greg;
thank you for your reply.
I do really appreciate your help.
best wishes