PDA

View Full Version : Macro to close Find and Replace dialog when a drag is started



wardw
08-29-2016, 10:33 AM
In Word 2007, if the Find and Replace dialog is open, text can't be dragged/dropped. So I have to close the dialog first, then do the dragging. This has been an annoyance through many versions of Word.

I'd like to write a macro that would detect when selected text has begun to be dragged, and close the Find/Replace dialog in time to allow the drag/drop to proceed.

Has anyone an idea of what VBA terms would apply to this situation? (Or, for that matter, whether I'm dreaming the impossible dream.)

gmaxey
08-29-2016, 01:15 PM
I believe you are dreaming. There is no StartDrag event. Why do you leave the find and replace dialog displayed in the first place?

wardw
08-29-2016, 02:58 PM
I believe you are dreaming. There is no StartDrag event. Why do you leave the find and replace dialog displayed in the first place?

Thanks for your answer, gmaxey. I'm doing freelance copyediting of manuscripts that require lots of search/replace operations, so I just leave the F/R dialog open on my second monitor for convenience. The drag prevention isn't a big issue for most users, but time is money. . . .

Hmmm. . . I wonder whether there's some way to intercept the several Find/Replace dialog boxes (item not found, reached the end of the document, etc.) and substitute my own db, where OK would close the db, but Close FR Box would close both boxes?

gmaxey
08-29-2016, 04:24 PM
Maybe you could do make a list of your Find and Replace requirements and do them all at one time.

http://gregmaxey.mvps.org/word_tip_pages/vba_find_and_replace.html

wardw
08-31-2016, 10:00 AM
Maybe you could do make a list of your Find and Replace requirements and do them all at one time.



Thanks for the link, gmaxey; I've installed the add-in you linked to, and I'm testing its usefulness for my situation.