Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    I'm trying to come up with some code that will open up "Find/Replace" on a word 2007 .docm
    Here what code I was able to come up with so far, I no it's a shot in the dark, I believe i'm close. I'm missing something and I'm not sure what......
    Code:
    Dim sFileName As String
    	Dim Find As Replacement
       
    	 With Dialogs(wdDialogReplacement)
    		.Display
    		
    	Selection.Find.ClearFormatting
    	Selection.Find.Replacement.ClearFormatting
    	With Selection.Find
    		.Text = ""
    		.Replacement.Text = ""
    		.Forward = True
    		.Wrap = wdFindContinue
    		.Format = False
    		.MatchCase = True
    		.MatchWholeWord = True
    		.MatchWildcards = False
    		.MatchSoundsLike = False
    		.MatchAllWordForms = True
    	
    	Exit Sub
    	End With

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    If you want to display the Replace dialog and let Word execute the action selected by the user, use

    Application.Dialogs(wdDialogEditReplace).Show

    You don't need any Selection.Find code after that.

  3. #3
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    [quote name='HansV' post='784999' date='16-Jul-2009 17:32']If you want to display the Replace dialog and let Word execute the action selected by the user, use

    Application.Dialogs(wdDialogEditReplace).Show

    You don't need any Selection.Find code after that.[/quote]
    Hi Hans
    Once again I thank you....

Posting Permissions

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