Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-10-2022, 03:26 PM
EditorJack EditorJack is offline Extending a selection has stopped working in VBA Windows 10 Extending a selection has stopped working in VBA Office 2016
Novice
Extending a selection has stopped working in VBA
 
Join Date: May 2019
Posts: 2
EditorJack is on a distinguished road
Default

I develop Word add-ins for copyeditors and such. Many of my macros depend on being able to extend a text selection. However, the following commands no longer work at all, even if the add-in isn't loaded:

Selection.Extend
Application.Run MacroName:="ExtendSelection"
Selection.ExtendMode = True

This problem started after I assigned ExtendSelection to a custom keyboard shortcut in my add-in. At first it worked. Then it didn't. Now it actually crashes Word. Again, this is true even if no add-ins are loaded, and even after deleting the Normal.dotm template and starting again from scratch.

If I just press the F8 key, *then* ExtendSelection is turned on and works. But if I try to use the feature in a macro, using any of the above commands, I get nothing.



I've been writing macros for many years, so I know my way around VBA pretty well, but this is one of the weirdest things I've ever seen.

I know all about using Ranges vs. Selections, but sometimes I want the user to interact with the text, which means using Selection is sometimes necessary. When the macro has done its thing, I want to end the macro with Extend turned on for the user.

I really need to be able to use the feature using a macro. Any ideas about how to solve the problem? Thanks very much for any help.

Update: I see the same problem even if I start Word in Safe Mode.

I've been working mainly in Word 365, but I just tested in Word 10 and in Word 2003, with the same problem: Selection.Extend doesn't work. Maybe this is a Windows problem?
Reply With Quote
 

Tags
extendselection, macros, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extending a selection has stopped working in VBA extending a selection VBAFiddler Word VBA 4 03-07-2021 12:38 PM
Extending a selection has stopped working in VBA MS Word has stopped working aerophil Word 6 09-12-2018 07:51 PM
Extending a selection has stopped working in VBA Word stopped working judyn Word 5 10-18-2012 03:09 PM
Extending a selection has stopped working in VBA Tab key stopped working in Word jgriffin Word 2 06-24-2009 04:05 PM
Excell stopped working TomC Excel 4 05-26-2006 11:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:37 PM.


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