Macro question: "Select text"?

R

Rodney Dangerfield

Hi. I'm new to using the MS-Word Macro function. (So far, all I've been
doing is using "record macro" feature . . . and I have no code programming
skills . . . so if you can keep your answer SIMPLE I'd sure appreciate
it,guys and gals!)

Ok, here goes . . .

I have a document with around 400 short lines of text. It looks like this:

Susan Jones
George Smith
Harry Belefonte Harris
Mikey
Bambi L. Peters

WHAT I NEED:
A macro I can put on my toolbar, that will do the following:

(a) "GO-TO" line 260
(thisbrings the cursor to the start of line 260)

(b) "SELECT" (or whatever it's called) all of those 260 lines (reason: so
they can then be "copied" to the clipboard in the final step)

(c) "COPY" into Windows Clipboard

Does anyone know how to do this?

PS: I need SIMPLE instructions, ok guys? Like: "Just turn on the macro
recorder and do such-and-such".

I sure appreciate anybody's help!

Bye

Rodney Dangerfield

("I don't get no respect. No respect at all! Why, when I was born, I was
real ugly. How ugly? Well,let me tell you. I was SO ugly when I was born,
that my mother slapped the doctor!)
 
R

Rodney Dangerfield

OOops. I forgot to say this . . (probably important info.) . . .

The purpose of the macro will always be the same: To SELECT and COPY the
*FIRST* 260 LINES of text into the Windows clipboard.

In other words, we want the *TOP* 260 lines of text in the document. (They
will never be anywhere else in the document . . . rather, they will ALWAYS
start at the BEGINNING of the document).

- Rodney
 
H

Helmut Weber

Hi Rodney,
the thing with simple answers is,
that the world and word douments
are often not simple. As a technical writer,
I am always confronted with the challenge
"... must be able, to explain complicated matters
in an easily understandable way." No way!
Either things are simple, or not, then they are complicated.
But I'm getting talkative.
Have a look at this very basic one:
Sub Test777()
With Selection
.ExtendMode = False
.HomeKey unit:=wdStory
.ExtendMode = True
.GoTo _
what:=wdGoToLine, _
which:=wdGoToAbsolute, _
Count:=21 ' plus 1
.Copy
End With
End Sub
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 
R

Rodney Dangerfield

Thanks Helmut

Well, I think you are probably right! (and I'm sure you know LOTS more
about Word programming than I do).

So, thank you very much.

Rodney
("I don't get no respect!")
 

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