Re: Restore Find box settings by Klaus
Klaus
Fri Apr 15 09:23:01 CDT 2005
Hi,
Something you might try:
-- Use Range.Find instead of Selection.Find in your macro. That =
shouldn't mess with the current settings in the Find dialog, and you =
don't need to reset anything.
Not sure why your code didn't work... Probably "Set fFind =3D =
Selection.Find" sets fFind as a reference to the object =
"Selection.Find", and if you mess with Selection.Find, fFind also gets =
changed.
Unfortunately, not all objects in VBA have a .Duplicate method to avoid =
this... You'd probably need to iterate over anything in .Find until you =
get at the elementary stuff or objects that do have a .Duplicate method, =
and store it ("fFindFont=3DSelection.Find.Font.Duplicate ..."). That =
might get terribly convoluted.
Regards,
Klaus
=20
"netloss" <netloss@metacrawler.com> schrieb im Newsbeitrag =
news:1113502028.465337.148590@l41g2000cwc.googlegroups.com...
> What I'm trying to do is save the settings before the procedure
> 'MessWithFindBox2' is run. So say for example, that the style I was
> searching for before I run MessWIthFindBox2 is called 'style x'. I
> declare a Find object called fFind, then set it equal to the current
> settings of the find box (set fFind =3D Selection.find). Then the code
> betw/ the lines of ********** runs. When that is done, I want to
> restore the .style setting in the Find box to 'style x', so from the
> user's point of view, nothing has changed.
> Thanks.
>