Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
cblocher cblocher is offline
external usenet poster
 
Posts: 4
Default How Can I Leave Pasted Text Selected?

Whenever I paste copied text into a Word document, the insertion point moves
to the end of the pasted text. How can I get Word to paste the text and leave
it selected?

Typically after pasting, I select the pasted text and do a Search and
Replace to remove unnecessary paragraphs/line breaks from the pasted text.

Thanks,

Chris
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
cblocher cblocher is offline
external usenet poster
 
Posts: 4
Default How Can I Leave Pasted Text Selected?

I've tried everything...Paste Special doesn't remove the line breaks and I
have a macro to remove those, but I wanted to preceed that macro with one
that would select the pasted text.

Since the pasted text is always a different size, I can't standardize the
macro and prompting to count lines isn't reasonable, so if there was a way to
force Word to keep the pasted text selected, that's the golden ticket.

Sounds like the only way out is to have a macro create a new document, paste
the text, select all, run the line-break-removal macro, select all, copy,
close the new doc without saving and then paste the results into the
destination.

Thanks for trying though.

"CyberTaz" wrote:

Don't know of any way to do so - "selection" isn't a concept with which the
clipboard is familiar... all it knows is "content":-) Have you tried using
Edit Paste Special - Unformatted Text (or Unformatted Unicode Text) rather
than just slapping the stuff in?

If this is content being copied from the web you may find the following to
be useful:

http://word.mvps.org/FAQs/Formatting/CleanWebText.htm
--
HTH |:)
Bob Jones
[MVP] Office:Mac

"cblocher" wrote in message
...
Whenever I paste copied text into a Word document, the insertion point
moves
to the end of the pasted text. How can I get Word to paste the text and
leave
it selected?

Typically after pasting, I select the pasted text and do a Search and
Replace to remove unnecessary paragraphs/line breaks from the pasted text.

Thanks,

Chris




  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Lene Fredborg Lene Fredborg is offline
external usenet poster
 
Posts: 1,291
Default How Can I Leave Pasted Text Selected?

If you use a macro to paste the text anyway, you could try to use something
like the following to paste the text. Before pasting, the code stores the
position of the selection start. After pasting, the start of the selection is
set to the stored position, i.e. the selection is extended to include all you
have pasted.

Dim nPos As Long
With Selection
nPos = .Start
.Paste
.Start = nPos
End With

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"cblocher" wrote:

I've tried everything...Paste Special doesn't remove the line breaks and I
have a macro to remove those, but I wanted to preceed that macro with one
that would select the pasted text.

Since the pasted text is always a different size, I can't standardize the
macro and prompting to count lines isn't reasonable, so if there was a way to
force Word to keep the pasted text selected, that's the golden ticket.

Sounds like the only way out is to have a macro create a new document, paste
the text, select all, run the line-break-removal macro, select all, copy,
close the new doc without saving and then paste the results into the
destination.

Thanks for trying though.

"CyberTaz" wrote:

Don't know of any way to do so - "selection" isn't a concept with which the
clipboard is familiar... all it knows is "content":-) Have you tried using
Edit Paste Special - Unformatted Text (or Unformatted Unicode Text) rather
than just slapping the stuff in?

If this is content being copied from the web you may find the following to
be useful:

http://word.mvps.org/FAQs/Formatting/CleanWebText.htm
--
HTH |:)
Bob Jones
[MVP] Office:Mac

"cblocher" wrote in message
...
Whenever I paste copied text into a Word document, the insertion point
moves
to the end of the pasted text. How can I get Word to paste the text and
leave
it selected?

Typically after pasting, I select the pasted text and do a Search and
Replace to remove unnecessary paragraphs/line breaks from the pasted text.

Thanks,

Chris




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
CyberTaz CyberTaz is offline
external usenet poster
 
Posts: 1,291
Default How Can I Leave Pasted Text Selected?

Don't know of any way to do so - "selection" isn't a concept with which the
clipboard is familiar... all it knows is "content":-) Have you tried using
Edit Paste Special - Unformatted Text (or Unformatted Unicode Text) rather
than just slapping the stuff in?

If this is content being copied from the web you may find the following to
be useful:

http://word.mvps.org/FAQs/Formatting/CleanWebText.htm
--
HTH |:)
Bob Jones
[MVP] Office:Mac

"cblocher" wrote in message
...
Whenever I paste copied text into a Word document, the insertion point
moves
to the end of the pasted text. How can I get Word to paste the text and
leave
it selected?

Typically after pasting, I select the pasted text and do a Search and
Replace to remove unnecessary paragraphs/line breaks from the pasted text.

Thanks,

Chris



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
CyberTaz CyberTaz is offline
external usenet poster
 
Posts: 1,291
Default How Can I Leave Pasted Text Selected?

One alternative I did just happen to think of: Once you paste, click the
Paste Options button & select "Apply Style or formatting..." - that will
select what you just pasted (but brings up the Styles & Formatting Task
Pane, which you don't need). How you might work that into a macro I'm not
sure.
--
HTH |:)
Bob Jones
[MVP] Office:Mac

"cblocher" wrote in message
news
I've tried everything...Paste Special doesn't remove the line breaks and I
have a macro to remove those, but I wanted to preceed that macro with one
that would select the pasted text.

Since the pasted text is always a different size, I can't standardize the
macro and prompting to count lines isn't reasonable, so if there was a way
to
force Word to keep the pasted text selected, that's the golden ticket.

Sounds like the only way out is to have a macro create a new document,
paste
the text, select all, run the line-break-removal macro, select all, copy,
close the new doc without saving and then paste the results into the
destination.

Thanks for trying though.

"CyberTaz" wrote:

Don't know of any way to do so - "selection" isn't a concept with which
the
clipboard is familiar... all it knows is "content":-) Have you tried
using
Edit Paste Special - Unformatted Text (or Unformatted Unicode Text)
rather
than just slapping the stuff in?

If this is content being copied from the web you may find the following
to
be useful:

http://word.mvps.org/FAQs/Formatting/CleanWebText.htm
--
HTH |:)
Bob Jones
[MVP] Office:Mac

"cblocher" wrote in message
...
Whenever I paste copied text into a Word document, the insertion point
moves
to the end of the pasted text. How can I get Word to paste the text and
leave
it selected?

Typically after pasting, I select the pasted text and do a Search and
Replace to remove unnecessary paragraphs/line breaks from the pasted
text.

Thanks,

Chris








  #6   Report Post  
Posted to microsoft.public.word.docmanagement
cblocher cblocher is offline
external usenet poster
 
Posts: 4
Default How Can I Leave Pasted Text Selected?

That worked beautifully...pastes and selects!

The only thing that remains, and it's very minor, is to dismiss the Find and
Replace dialog box...it asks me if I want to search the rest of the document.
I want the macro to respond with "No" to close the dialog box, but I don't
know how to get the macro to dismiss the prompt. Any ideas?

"Lene Fredborg" wrote:

If you use a macro to paste the text anyway, you could try to use something
like the following to paste the text. Before pasting, the code stores the
position of the selection start. After pasting, the start of the selection is
set to the stored position, i.e. the selection is extended to include all you
have pasted.

Dim nPos As Long
With Selection
nPos = .Start
.Paste
.Start = nPos
End With

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"cblocher" wrote:

I've tried everything...Paste Special doesn't remove the line breaks and I
have a macro to remove those, but I wanted to preceed that macro with one
that would select the pasted text.

Since the pasted text is always a different size, I can't standardize the
macro and prompting to count lines isn't reasonable, so if there was a way to
force Word to keep the pasted text selected, that's the golden ticket.

Sounds like the only way out is to have a macro create a new document, paste
the text, select all, run the line-break-removal macro, select all, copy,
close the new doc without saving and then paste the results into the
destination.

Thanks for trying though.

"CyberTaz" wrote:

Don't know of any way to do so - "selection" isn't a concept with which the
clipboard is familiar... all it knows is "content":-) Have you tried using
Edit Paste Special - Unformatted Text (or Unformatted Unicode Text) rather
than just slapping the stuff in?

If this is content being copied from the web you may find the following to
be useful:

http://word.mvps.org/FAQs/Formatting/CleanWebText.htm
--
HTH |:)
Bob Jones
[MVP] Office:Mac

"cblocher" wrote in message
...
Whenever I paste copied text into a Word document, the insertion point
moves
to the end of the pasted text. How can I get Word to paste the text and
leave
it selected?

Typically after pasting, I select the pasted text and do a Search and
Replace to remove unnecessary paragraphs/line breaks from the pasted text.

Thanks,

Chris



  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Lene Fredborg Lene Fredborg is offline
external usenet poster
 
Posts: 1,291
Default How Can I Leave Pasted Text Selected?

I don't know how your code looks but check the Find property and the Execute
method of Find (especially Wrap and Replace) in the VBA help. I think that
you only need to set Selection.Find.Wrap = wdFindStop.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"cblocher" wrote:

That worked beautifully...pastes and selects!

The only thing that remains, and it's very minor, is to dismiss the Find and
Replace dialog box...it asks me if I want to search the rest of the document.
I want the macro to respond with "No" to close the dialog box, but I don't
know how to get the macro to dismiss the prompt. Any ideas?

"Lene Fredborg" wrote:

If you use a macro to paste the text anyway, you could try to use something
like the following to paste the text. Before pasting, the code stores the
position of the selection start. After pasting, the start of the selection is
set to the stored position, i.e. the selection is extended to include all you
have pasted.

Dim nPos As Long
With Selection
nPos = .Start
.Paste
.Start = nPos
End With

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"cblocher" wrote:

I've tried everything...Paste Special doesn't remove the line breaks and I
have a macro to remove those, but I wanted to preceed that macro with one
that would select the pasted text.

Since the pasted text is always a different size, I can't standardize the
macro and prompting to count lines isn't reasonable, so if there was a way to
force Word to keep the pasted text selected, that's the golden ticket.

Sounds like the only way out is to have a macro create a new document, paste
the text, select all, run the line-break-removal macro, select all, copy,
close the new doc without saving and then paste the results into the
destination.

Thanks for trying though.

"CyberTaz" wrote:

Don't know of any way to do so - "selection" isn't a concept with which the
clipboard is familiar... all it knows is "content":-) Have you tried using
Edit Paste Special - Unformatted Text (or Unformatted Unicode Text) rather
than just slapping the stuff in?

If this is content being copied from the web you may find the following to
be useful:

http://word.mvps.org/FAQs/Formatting/CleanWebText.htm
--
HTH |:)
Bob Jones
[MVP] Office:Mac

"cblocher" wrote in message
...
Whenever I paste copied text into a Word document, the insertion point
moves
to the end of the pasted text. How can I get Word to paste the text and
leave
it selected?

Typically after pasting, I select the pasted text and do a Search and
Replace to remove unnecessary paragraphs/line breaks from the pasted text.

Thanks,

Chris



  #8   Report Post  
Posted to microsoft.public.word.docmanagement
cblocher cblocher is offline
external usenet poster
 
Posts: 4
Default How Can I Leave Pasted Text Selected?

Thanks for your continued support! It works PERFECTLY! You have saved me at
least two hours a week! My code looks like this:

Sub PasteAndReplaceParasInSelection()
'
' PasteAndReplaceParasInSelection Macro
' For pasting text from a Web page into Word
'

'
Dim nPos As Long
With Selection
nPos = .Start
.PasteSpecial DataType:=wdPasteText
.Start = nPos
End With

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Wrap = wdFindStop
End With
Selection.Find.Execute Replace:=wdReplaceAll

End Sub



"Lene Fredborg" wrote:

I don't know how your code looks but check the Find property and the Execute
method of Find (especially Wrap and Replace) in the VBA help. I think that
you only need to set Selection.Find.Wrap = wdFindStop.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"cblocher" wrote:

That worked beautifully...pastes and selects!

The only thing that remains, and it's very minor, is to dismiss the Find and
Replace dialog box...it asks me if I want to search the rest of the document.
I want the macro to respond with "No" to close the dialog box, but I don't
know how to get the macro to dismiss the prompt. Any ideas?

"Lene Fredborg" wrote:

If you use a macro to paste the text anyway, you could try to use something
like the following to paste the text. Before pasting, the code stores the
position of the selection start. After pasting, the start of the selection is
set to the stored position, i.e. the selection is extended to include all you
have pasted.

Dim nPos As Long
With Selection
nPos = .Start
.Paste
.Start = nPos
End With

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"cblocher" wrote:

I've tried everything...Paste Special doesn't remove the line breaks and I
have a macro to remove those, but I wanted to preceed that macro with one
that would select the pasted text.

Since the pasted text is always a different size, I can't standardize the
macro and prompting to count lines isn't reasonable, so if there was a way to
force Word to keep the pasted text selected, that's the golden ticket.

Sounds like the only way out is to have a macro create a new document, paste
the text, select all, run the line-break-removal macro, select all, copy,
close the new doc without saving and then paste the results into the
destination.

Thanks for trying though.

"CyberTaz" wrote:

Don't know of any way to do so - "selection" isn't a concept with which the
clipboard is familiar... all it knows is "content":-) Have you tried using
Edit Paste Special - Unformatted Text (or Unformatted Unicode Text) rather
than just slapping the stuff in?

If this is content being copied from the web you may find the following to
be useful:

http://word.mvps.org/FAQs/Formatting/CleanWebText.htm
--
HTH |:)
Bob Jones
[MVP] Office:Mac

"cblocher" wrote in message
...
Whenever I paste copied text into a Word document, the insertion point
moves
to the end of the pasted text. How can I get Word to paste the text and
leave
it selected?

Typically after pasting, I select the pasted text and do a Search and
Replace to remove unnecessary paragraphs/line breaks from the pasted text.

Thanks,

Chris



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Selected Style gets updated from selected text wordspinster Page Layout 3 May 20th 06 07:41 PM
Can Word overflow text to leave pages with pics/tables text-free? Struggling Student Tables 4 March 10th 06 01:21 AM
Can outline headings be dropped to leave only body text? Baggins99 Page Layout 4 October 3rd 05 08:12 AM
On outlined document,how to remove the text but leave the outline Frustrated Microsoft Word Help 2 August 10th 05 05:05 PM
Replace Static with Variable but leave alone text between them Deborah K Microsoft Word Help 1 June 29th 05 09:33 AM


All times are GMT +1. The time now is 12:57 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"