Reply
 
Thread Tools Display Modes
  #1   Report Post  
Pan0912
 
Posts: n/a
Default How do I adjust the pasted text to Word from Notepad or similar p.

I tried to copy a text from Notepad and paste it into Word. Often time after
pasting, I had to readjust its width in Word in order to make it "stretch"
out on the page. Is there any other way I can do it without the adjustment,
so the pasted text can automatically stretch out itself in Word?

Thanks.
  #2   Report Post  
Steve Yandl
 
Posts: n/a
Default

The subroutine below will probably do what you want. I wish I could recall
who to credit as the author but I don't.

Sub ClearXtraCarriageReturns()
'
Dim rngStartMarker As Word.Range
Set rngStartMarker = Selection.Range

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "([!^13])(^13)([!^13])"
.Replacement.Text = "\1 \3"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

rngStartMarker.Select
End Sub


Steve



"Pan0912" wrote in message
...
I tried to copy a text from Notepad and paste it into Word. Often time
after
pasting, I had to readjust its width in Word in order to make it "stretch"
out on the page. Is there any other way I can do it without the
adjustment,
so the pasted text can automatically stretch out itself in Word?

Thanks.



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
In typing dates in Word, i.e. "January 12" how do you keep the "1. Carol Microsoft Word Help 2 January 12th 05 08:09 PM
word xp crashes after macros are recorded kharris0405 Microsoft Word Help 3 January 11th 05 10:50 PM
WP Delay Code - Word Equiv Mike G - Milw, WI Microsoft Word Help 6 January 10th 05 04:12 PM
Continuous breaks convert to next page breaks Jennifer Hunt Microsoft Word Help 2 December 30th 04 05:45 PM
How to change merge forms from Word Perfect to Microsoft Word dollfindance Microsoft Word Help 2 December 30th 04 03:35 PM


All times are GMT +1. The time now is 06:43 AM.

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"