Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-25-2013, 08:02 AM
kjworduser kjworduser is offline Using EditFind in VBA on Word 2010 Windows 7 32bit Using EditFind in VBA on Word 2010 Office 2010 32bit
Novice
Using EditFind in VBA on Word 2010
 
Join Date: Mar 2013
Posts: 5
kjworduser is on a distinguished road
Default Using EditFind in VBA on Word 2010

I believe this is a question for Microsoft programmers. I am trying to incorporate an EditFind command within a VBA procedure in Word 2010. It should exactly equal what would happen if you chose View, Macros, View Macros, Word Commands (under "Macros in"), EditFind, Run. (This could also be performed in Word 2010 by using "Advanced Find" on the dropdown choice for the Navigation bar, or by typing Alt-E, F.)

In 2007 or earlier, I could do this with either of the following

With Selection.Find
.MatchWholeWord = True
End With
On Error Resume Next
Application.Run MacroName:="EditFind"



_________________
- OR -
_________________

On Error Resume Next

With Dialogs(wdDialogEditFind)
.Find = ""
.WholeWord = True
.Display
End With



However, when I try using this code in Word 2010, the following results:
  • The Find dialog box comes up with a message "Word found no items matching these criteria" (even though I have not entered any criteria).
  • If I put in my own criteria and press "Enter," nothing happens. I have to click on "Find Next." It would be much preferable to be able to press "Enter," which is how the normal EditFind used to work.
Is there any way in Word 2010 to accomplish the EditFind function as it used to work in Word 2007 and earlier?

Thank you.
Reply With Quote
  #2  
Old 03-26-2013, 05:48 PM
fumei fumei is offline Using EditFind in VBA on Word 2010 Windows 7 64bit Using EditFind in VBA on Word 2010 Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

1. you have cross-posted this. http://www.vbaexpress.com/forum/showthread.php?t=45553

For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184

2. you are not even giving the same information that you (eventually) posted elsewhere - i.e. you want to use special characters

And just to reiterate, yes you are correct the find dialog acts a little bit differently in 2010 - go figure. The Find Next (which gets you the Enter action you want) does not appear to be the same. In pre-2010 the Next button has the default focus; 2010 does not.

You are going to have to live with it. Use a userform and try to code the actions you want.
Reply With Quote
  #3  
Old 04-02-2013, 09:44 AM
KevinJ KevinJ is offline Using EditFind in VBA on Word 2010 Windows 7 64bit Using EditFind in VBA on Word 2010 Office 2010 32bit
Novice
 
Join Date: Oct 2011
Posts: 4
KevinJ is on a distinguished road
Default Using EditFind in VBA on Word 2010

Fumei,

I have posted an apology on the VBAExpress forum for cross-posting (http://www.vbaexpress.com/forum/showthread.php?t=45553). The reason I posted here was I thought this was a Microsoft website, and that Microsoft programmers might pick up on this. Nevertheless, I was inconsiderate in cross-posting without letting you know. Just wasn't thinking.

I did come up with a workaround using CommandBars.FindControl, which I've shared on the linked address above. Actually, I had tried it before but just didn't follow through on it.

Thank you. All the best!

As to the msofficeforums forum, my apologies to you also - please consider this post closed.
Reply With Quote
Reply

Tags
2010, advanced find, editfind

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using EditFind in VBA on Word 2010 Graphics Created in Word 2003 Cannot Be Displayed in Word 2010 mwildem Drawing and Graphics 3 02-14-2013 10:59 AM
Are user customizations transferable from Word 2003 to Word 2010 (2013)? New Daddy Word 3 01-14-2013 07:25 AM
Word auto-repair differences between word 2007 - 2010. Svekris Word 2 05-13-2012 03:12 AM
Using EditFind in VBA on Word 2010 Problem saving in Word 2007 a dotm Addin developed in Word 2010 RichardP Word VBA 6 04-26-2012 04:22 AM
Using EditFind in VBA on Word 2010 Word 2010 and Excel 2010 Mail merge - multiple headers robby Word 3 04-18-2012 06:37 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft