Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-30-2016, 12:31 AM
diracsbracket diracsbracket is offline How to avoid find.execute moving focus and restore exact view after search Windows 7 64bit How to avoid find.execute moving focus and restore exact view after search Office 2010 64bit
Novice
How to avoid find.execute moving focus and restore exact view after search
 
Join Date: Aug 2014
Posts: 5
diracsbracket is on a distinguished road
Default How to avoid find.execute moving focus and restore exact view after search

Hi,
I have a sub that inserts a hyperlink to the heading matching the selected text in MS Word 2013.
The header's range is found using:

HTML Code:
Selection.Find.Execute
Before doing that, I save the current range (i.e. that of the selected text) in order to restore it after the search has found the heading's range.

Although the range is restored correctly (and I'm back at the selected text), usually the view of the page is shifted, as if it was scrolled up or down a bit.

Since these shifts are sometimes large, I find them annoying enough to want to avoid this.

Is that possible?
I tried this by saving/restoring various built-in MS Word bookmark ranges, for example:

HTML Code:
ActiveDocument.Bookmarks("\page").Range
But this still causes shifts....

The thing is that the find.execute moves the focus to the heading found. Is there a way to disable this focus change?

Thanks!
Reply With Quote
 

Tags
find focus



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to avoid find.execute moving focus and restore exact view after search How to find exact matches only in an excel spreadsheet zhead Excel 6 09-09-2016 07:52 AM
Outlook restore from backup didn't seem to find the Calendar. BudVitoff Outlook 0 09-08-2015 01:04 PM
How to avoid find.execute moving focus and restore exact view after search Moving focus to format style box from keyboard lawrencehare Word 4 11-08-2012 01:08 PM
How to avoid find.execute moving focus and restore exact view after search How to find exact phrase CabbageTree Outlook 2 05-14-2012 11:24 AM
How to avoid find.execute moving focus and restore exact view after search Find and Execute cksm4 Word VBA 1 10-22-2011 11:36 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:37 AM.


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