Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2007

Tip: Looking for answers? Try searching our database.

Why does .extendmode not stay True at end of VBA Sub?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christopher@rath.ca - 19 Feb 2007 11:23 GMT
If .extendmode is True when I enter a VBA Sub, it is always set to
False sometime between the final End Sub and control being returned to
Word.  Here is an example:

Public Sub MoveForward4()
' Move point forward 4 characters
       Selection.MoveRight Unit:=wdCharacter, Count:=4,
Extend:=wdExtend
End Sub

If .extendmode is True when this Sub is called (it is assigned to
shortcut key), then .extendmode is set to False after the End Sub.

Any suggestions on how I can avoid .extendmode being set to False;
since I don't want the Sub to affect .extendmode.

I also tried implementing this with the .moveend method; but, it too
suffers the same side effect.  Lastly, when .extendmode is True, the
cursor keys can be pressed multiple times without .extendmode becoming
set to False; which is the behaviour I'm trying to emulate.

thanks,
Christopher
Christopher@rath.ca - 19 Feb 2007 20:24 GMT
On Feb 19, 5:23 am, Christop...@rath.ca wrote:
> If .extendmode is True when I enter a VBA Sub, it is always set to
> False sometime between the final End Sub and control being returned to
[quoted text clipped - 19 lines]
> thanks,
> Christopher

In answer to my own question, I found the following article at
Microsoft today: http://support.microsoft.com/kb/182257 wherein MS
states that this behaviour is "by design".

The knowledgebase article provides no rationale, and no workaround;
so, I would be obliged if someone _in the know_ was able to provide
some insight.  This feature (read "bug") is very frustrating.
Rob - 20 Feb 2007 16:08 GMT
Not sure what you're trying to accomplish.
Christopher@rath.ca - 26 Feb 2007 16:04 GMT
> Not sure what you're trying to accomplish.

When extendmode is true I want to be able to change the selection area
and then when the Sub returns control to the user I want the user to
be able to continue to change the selection area (without having to
use the shift key to eidt the selection; since shift was not required
prior to the Sub being called).
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.