Walentyn
07-06-2021, 07:39 PM
Is there a way to open the Find/Replace dialog such that the Wild Card option is selected?
I have got it to open with the Find box populated with the contents of a selection, as follows.
Sub WildCardFind()
' Paul Beverley - Version 22.02.11
' Call up Advanced Find dialog box
' 7/7/2021 CG modification: set the dialog to Wild Card search, and populate Find box with the selected text
Dim rSelect As Range
Dim sSelect As String
Set rSelect = Selection.Range
sSelect = rSelect.Text
Selection.TypeText "DONE"
With Dialogs(wdDialogEditReplace)
.Find = sSelect
With Selection.Find
.MatchWildcards = True
End With
.Show
End With
End Sub
I just haven't been able to track down a solution to this anywhere.
Thanks.
I have got it to open with the Find box populated with the contents of a selection, as follows.
Sub WildCardFind()
' Paul Beverley - Version 22.02.11
' Call up Advanced Find dialog box
' 7/7/2021 CG modification: set the dialog to Wild Card search, and populate Find box with the selected text
Dim rSelect As Range
Dim sSelect As String
Set rSelect = Selection.Range
sSelect = rSelect.Text
Selection.TypeText "DONE"
With Dialogs(wdDialogEditReplace)
.Find = sSelect
With Selection.Find
.MatchWildcards = True
End With
.Show
End With
End Sub
I just haven't been able to track down a solution to this anywhere.
Thanks.