Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-11-2014, 02:08 AM
NobodysPerfect NobodysPerfect is offline Toggle Button takes focus and thus changes selection Windows 8 Toggle Button takes focus and thus changes selection Office 2010 32bit
Competent Performer
Toggle Button takes focus and thus changes selection
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default Toggle Button takes focus and thus changes selection

Hi to all,

I'm using an ActiveX toggle button in one of my documents. The problem is: toggle buttons do not have a TakeFocusOnClick = False property like command buttons do.

So clicking the toggle button means a selection change, but I'd like to continue working at (former) cursor position.

Application.GoBack at the end of the tgl_Click procedure does not work the way it should (for my purpose).

I even tried an app_WindowSelectionChange event, but I simply did not succeed in saving the selection.range before clicking the toggle button.

Do you have an idea?

Any help appreciated ... thanks


NP
Reply With Quote
  #2  
Old 10-11-2014, 04:20 AM
NobodysPerfect NobodysPerfect is offline Toggle Button takes focus and thus changes selection Windows 8 Toggle Button takes focus and thus changes selection Office 2010 32bit
Competent Performer
Toggle Button takes focus and thus changes selection
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

Code:
If Selection.Range.InlineShapes.Count > 0 Then
    If Not Selection.Range.InlineShapes(1).Type = 5 Then RSel = Selection.Range
Else
    Set RSel = Selection.Range
End If
Seems to work in app_WindowSelectionChange.

Cheers
NP
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Toggle Button takes focus and thus changes selection Toggle Button Squibble Word VBA 2 06-11-2014 05:36 PM
Toggle Button takes focus and thus changes selection Circling your selection on word vs check box or radio button NBuckley Word 2 04-04-2014 03:17 AM
Toggle Button takes focus and thus changes selection Selection of all Text for a specific page in word is spanning selection across pages ramsgarla Word VBA 9 12-05-2012 03:23 AM
Toggle Button takes focus and thus changes selection MS WORD takes forever to open .. dflockyer Word 2 06-25-2012 05:24 PM
Toggle Button takes focus and thus changes selection mail merge takes and age williebear Outlook 1 05-27-2009 11:32 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:15 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