![]() |
#1
|
|||
|
|||
![]()
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? |
#2
|
||||
|
||||
![]()
Have you tried restarting your PC?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Restarting Windows has no effect.
![]() |
#4
|
||||
|
||||
![]()
I would try rebuilding the Registry key for Word. Although if you are getting the same issue while running three versions of Word on the same machine then it might be hard to find the right section of the registry.
If you code your macro to extend a Range and then select that range does it work?
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
![]() |
Tags |
extendselection, macros, vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
VBAFiddler | Word VBA | 4 | 03-07-2021 12:38 PM |
![]() |
aerophil | Word | 6 | 09-12-2018 07:51 PM |
![]() |
judyn | Word | 5 | 10-18-2012 03:09 PM |
![]() |
jgriffin | Word | 2 | 06-24-2009 04:05 PM |
![]() |
TomC | Excel | 4 | 05-26-2006 11:40 PM |