Results 1 to 5 of 5

Thread: Return Word wdDialogEditFind options

Threaded View

  1. #5
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,638

    Re: Return Word wdDialogEditFind options

    For the record, I'm using an older version of Word than you, since I have fewer checkboxes in my Search dialog.

    This code worked as far as returning the accurate state of the Match case and Find whole words only checkbox provided that a search was done (if I changed the state of those checkboxes and then just clicked cancel the "updated" state of the checkbox was not properly returned).

    That being said, I can't get it to return the proper state for PatternMatch or SoundsLike no matter what I tried.

    Code:
    Private Sub CommandButton1_Click()
    
    Dim dlgFind As Dialog
     
    Set dlgFind = Dialogs(wdDialogEditFind)
     
    With dlgFind
     .Display
     .Update
     .Execute
    End With
    
    MsgBox dlgFind.MatchCase
    MsgBox dlgFind.WholeWord
    MsgBox dlgFind.PatternMatch
    MsgBox dlgFind.SoundsLike
    
    End Sub
    Edit: I got it to return the proper state of PatternMatch and SoundsLike only when a search found a result in the document. YMMV
    Last edited by OptionBase1; Jul 23rd, 2020 at 06:49 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width