Activate vs. Select

R

Rob Kime

I have been testing some features from one version of Word to the next to
see what is still valid, and if not, then what is the remediation to fix it.

One of the things I can't understand is the difference between
expression.Activate and expression.Select. Can anyone explain the
difference to me? I haven't been able to find an adequate description....I
know what the Select Method does, but Activate escapes me, and then to
compare them both, it seems like they do the same thing..so confused.

TIA
 
J

Jay Freedman

Rob said:
I have been testing some features from one version of Word to the
next to see what is still valid, and if not, then what is the
remediation to fix it.
One of the things I can't understand is the difference between
expression.Activate and expression.Select. Can anyone explain the
difference to me? I haven't been able to find an adequate
description....I know what the Select Method does, but Activate
escapes me, and then to compare them both, it seems like they do the
same thing..so confused.
TIA

expression.Select applies to a long list of object that could be the
'expression', and most of them are Range objects, similar to Range objects,
or things that have a Range property. When you call it, it moves the
insertion point (the Selection) to that object, so whatever you do next
(formatting, copying, deleting, etc.) applies to that object.

expression.Activate applies to these objects: Application, Document,
InlineShape, OLEFormat, Pane, Shape, ShapeRange, Task, and Window.

For the Application, Document, Pane, Task, and Window objects, the Activate
method moves the focus from some other object to the one in 'expression' but
doesn't move the insertion point the way Select does. For example, if you
use the splitter to make two panes that view the same document, you can use
Activate to switch the focus from one to the other. If you have two
documents open, you can switch the focus from one document to the other.

For the InlineShape, OLEFormat, Shape, and ShapeRange objects, Active opens
the appropriate editor (for example, the picture editor, or Excel or some
other program for an OLEFormat object).

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
R

Rob Kime

Thanks, Jay. That was very helpful.


Jay Freedman said:
expression.Select applies to a long list of object that could be the
'expression', and most of them are Range objects, similar to Range
objects, or things that have a Range property. When you call it, it moves
the insertion point (the Selection) to that object, so whatever you do
next (formatting, copying, deleting, etc.) applies to that object.

expression.Activate applies to these objects: Application, Document,
InlineShape, OLEFormat, Pane, Shape, ShapeRange, Task, and Window.

For the Application, Document, Pane, Task, and Window objects, the
Activate method moves the focus from some other object to the one in
'expression' but doesn't move the insertion point the way Select does. For
example, if you use the splitter to make two panes that view the same
document, you can use Activate to switch the focus from one to the other.
If you have two documents open, you can switch the focus from one document
to the other.

For the InlineShape, OLEFormat, Shape, and ShapeRange objects, Active
opens the appropriate editor (for example, the picture editor, or Excel or
some other program for an OLEFormat object).

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup
so all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top