Hard Returns when copying and pasting between apps

M

Martin Nelson

microsoft.public.mac.office.word is so useful I often want to copy what I
learn into a "Tech Notes" document. Unfortunately when I copy in Entourage
and then paste into Word I get hard returns wherever the lines ended in the
original document regardless of whether this fills my line in my Word
document or not. This happens when copying text from web sites and elsewhere
as well. Is there a quick and easy way of cleaning up?

Thanks,
Martin
 
E

Elliott Roper

Martin Nelson said:
microsoft.public.mac.office.word is so useful I often want to copy what I
learn into a "Tech Notes" document. Unfortunately when I copy in Entourage
and then paste into Word I get hard returns wherever the lines ended in the
original document regardless of whether this fills my line in my Word
document or not. This happens when copying text from web sites and elsewhere
as well. Is there a quick and easy way of cleaning up?

Of course. Find and replace. Search for ^p, replace with a space.
It is worth recording a macro and assigning a keystroke to it.

You could make a more interesting one to preserve double ^p to deal
with multi-paragraph copy 'n paste. Then embellish it with something to
lose consecutive spaces.

If you have never recorded a macro before, this is a good one to play
with.
 
B

Beth Rosengard

Of course. Find and replace. Search for ^p, replace with a space.
It is worth recording a macro and assigning a keystroke to it.

You could make a more interesting one to preserve double ^p to deal
with multi-paragraph copy 'n paste. Then embellish it with something to
lose consecutive spaces.

If you have never recorded a macro before, this is a good one to play
with.

Or if you want to be a wimp (I speak from personal experience :), you can
purchase an application like textSOAP ($24.99 at
<http://www.unmarked.com/textsoap/index.html>) which will clean it up for
you in no time.

--
***Please always reply to the newsgroup!***

Beth Rosengard
MacOffice MVP

Mac Word FAQ: <http://word.mvps.org/MacWordNew/index.htm>
(If using Safari, hit Refresh once or twice ­ or use another browser.)
Entourage Help Page: <http://www.entourage.mvps.org>
 
M

Martin Nelson

If you have never recorded a macro before, this is a good one to play
with.

Thanks Elliott, that's great. As it turns out, I was trying macros for the
first time while waiting for that very quick reply. I was following the
"Date & Time Default Doesn¹t Stay Defaulted" thread on this news server and
was trying to do Daiya's macro to map a default date button.

I'm afraid I got a little lost doing it, though I seemed to have managed to
set one up using menus instead of her text (we'll see if it works after I
quit and restart). Is there a document a little more robust and
novice-friendly than Microsoft Office Help's macro explanation?

Martin

--
I'm running
Macintosh G4
Dual 800
1 GB RAM
OS X.2.8
Service Release 1
 
M

Martin Nelson

Of course. Find and replace. Search for ^p, replace with a space.
It is worth recording a macro and assigning a keystroke to it.

OK, Elliott, I did the following on a Word transcript of your reply: I went
to "Find and Replace," I put "^p" in the "Find what" window and a space in
the "Replace with" window. I then selected "Replace All."

Everything became one big paragraph. This wouldn't be awful if I could
"Replace All Highlighted," but that doesn't seem to be an option.
You could make a more interesting one to preserve double ^p to deal
with multi-paragraph copy 'n paste. Then embellish it with something to
lose consecutive spaces.

I'm afraid I really haven't a clue how to even begin this part.

Anything?
Martin
 
D

Daiya Mitchell

Actually, Word's horrible AutoFormat will fix some of this. In Tools |
AutoCorrect, AutoFormat tab (*not* as you type). I have just "other
paragraphs" checked, and also "preserve: styles". Then if you copy and
paste, and run Format | AutoFormat, it will rewrap the text. Except I just
noticed it only rewraps unquoted text, not lines that begin with >.

However, you can delete the >>> easily by holding down option as you select,
which allows you to select in columns instead of lines.

This article has more info, and also the directions for the F&R that Elliot
suggests, or a similar one, anyhow.

http://word.mvps.org/faqs/formatting/CleanWebText.htm
(hit refresh a few times in Safari, or use a different browser)

Gotta say, I just created a folder in Entourage for WordTips and copy the
message into there.
 
E

Elliott Roper

Martin Nelson said:
OK, Elliott, I did the following on a Word transcript of your reply: I went
to "Find and Replace," I put "^p" in the "Find what" window and a space in
the "Replace with" window. I then selected "Replace All."

Everything became one big paragraph. This wouldn't be awful if I could
"Replace All Highlighted," but that doesn't seem to be an option.
Yes, it should be standard behavior for find and replace. At the end of
dealing with the selected text, it will annoyingly ask if you wish to
wreck your whole document, but not in so many words.
I'm afraid I really haven't a clue how to even begin this part.

Anything?

OK. I'll feed it to you slowly ;-) (At some point real soon now, you
will 'get' recording macros and be off like a rabbit, and I don't want
to spoil your fun)

Choose a sequence unlikely to be in your document. Say /\

Step1 find and replace ^p^p with /\ (to squirrel away the real
paragraph ends)
Step 2 find and replace ^p with space (lose the 'hard' returns)
Step 3 find and replace /\ with ^p (restore the real paragraph ends)
Step 4 find and replace space^w with space (scrunch spaces to a single
space)

Now wrap that all in a macro (just record it) and assign a keystroke to
it.
Note that you must disable wild card search to permit ^p and ^w magic
to occur.

heh!
 
M

Martin Nelson

Choose a sequence unlikely to be in your document. Say /\

Step1 find and replace ^p^p with /\ (to squirrel away the real
paragraph ends)
Step 2 find and replace ^p with space (lose the 'hard' returns)
Step 3 find and replace /\ with ^p (restore the real paragraph ends)
Step 4 find and replace space^w with space (scrunch spaces to a single
space)

Elliott,

That's real pertty. I can't wait to try it.

Martin
 
C

Clive Huggan

Elliott,

That's real pertty. I can't wait to try it.

Martin
Try this if you like. I put it on my Format menu as "Newsgroup cleanup":

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sub NewsgroupCleanup()
'
' NewsgroupCleanup Macro
' Macro recorded 26 May 2002 by Clive Huggan
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "->"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = ">>>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = ">>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = ">"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = ""
.Replacement.Text = "->"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "^p^p"
.Replacement.Text = "§"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "§"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "--"
.Replacement.Text = "‹"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = """"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "'"
.Replacement.Text = "'"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Cheers,

Clive Huggan
Canberra, Australia
(My time zone is at least 7 hours different from the US and Europe, so my
follow-on responses to those regions can be delayed)
============================================================

* A SUGGESTION ‹ WAIT FOR CONSIDERED ADVICE: If you post a question, keep
re-visiting the newsgroup for several days after the first response comes
in. Sometimes it takes a few responses before the best or complete solution
is proposed; sometimes you'll be asked for further information so that a
better answer can be provided. Good tips about getting the best out of
posting are at http://word.mvps.org/FindHelp/Posting.htm (if you use Safari
and it gives you a blank page the first time, you may need to hit the
circular arrow icon -- "Reload the current page" -- a few times).

* AND ONE MORE ‹ AVOID SPAM: To avoid spam directed at contributors of
newsgroups, you can set up a "send-only" dummy e-mail account. Full
instructions are at http://www.entourage.mvps.org/tips/tip019.html

============================================================
 
D

Daiya Mitchell

If you have never recorded a macro before, this is a good one to play
Thanks Elliott, that's great. As it turns out, I was trying macros for the
first time while waiting for that very quick reply. I was following the
"Date & Time Default Doesn¹t Stay Defaulted" thread on this news server and
was trying to do Daiya's macro to map a default date button.

I'm afraid I got a little lost doing it, though I seemed to have managed to
set one up using menus instead of her text (we'll see if it works after I
quit and restart). Is there a document a little more robust and
novice-friendly than Microsoft Office Help's macro explanation?

So I assume you just recorded it from scratch? That works fine.

Re using my code, supposedly we have an article on that
http://word.mvps.org/MacWordNew/InstallMacroMac.htm
(hit refresh a few times in Safari, or use a different browser)

But I think John wrote it at a *leetle* too high a level--it's educational
but not necessary in that context. So Beth, let's add that to the "edit
someday" list?

The general one is actually much better:
http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm
(hit refresh a few times in Safari, or use a different browser)

Quoting:
Select Tools + Macro + Macros, where it says Macros in, select the template
you want to store the macro in; where it says Macro name, type a name, and
click Create.  You will see something like 
Sub MyMacroName()
'
' MyMacroName Macro
' Macro created 03/08/00 by Me'
[cursor will be here, ready for you to paste the code in]
End Sub
You can safely delete the lines in the middle, and add your own code, or
paste in the code sent to you by others. 

The code in question was:

Selection.InsertDateTime DateTimeFormat:="yyyy-MM-dd h:mm AM/PM",
InsertAsField:=False

This code is a bit long--when I just tried this, it came out in red, because
the line breaks were wrong, so I deleted back from the second line and let
the VB Editor wrap it naturally, and that's often necessary.

So then use File | Return to MS Word, test the macro via Tools | Macros...
Run, and then add a shortcut so that it is actually useful, via Tools |
Customize.

And this is also a *very* good article, just added:
How to modify a recorded macro (by Jay Freedman)
http://word.mvps.org/FAQs/MacrosVBA/ModifyRecordedMacro.htm

DM
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Daiya:

Fascinating! I have never used that other method of creating a macro :) I
clean forgot about it.

Tools + Macro + Macros always places the new sub in the NewMacros module,
which neatly solves the problem of working out how to create a module and
name it :)

I'm not sure I would describe that method as "better", though: you still
have to know how to clean up the Sub statement and the comments, or you will
get a compile error :) Using that method, there is just as much for the
user to do, but you do it in different places, and the article doesn't
explicitly tell you what or where :)

Cheers

Re using my code, supposedly we have an article on that
http://word.mvps.org/MacWordNew/InstallMacroMac.htm
(hit refresh a few times in Safari, or use a different browser)

But I think John wrote it at a *leetle* too high a level--it's educational
but not necessary in that context. So Beth, let's add that to the "edit
someday" list?

The general one is actually much better:
http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm
(hit refresh a few times in Safari, or use a different browser)

Quoting:
Select Tools + Macro + Macros, where it says Macros in, select the template
you want to store the macro in; where it says Macro name, type a name, and
click Create.  You will see something like 
Sub MyMacroName()
'
' MyMacroName Macro
' Macro created 03/08/00 by Me'
[cursor will be here, ready for you to paste the code in]
End Sub
You can safely delete the lines in the middle, and add your own code, or
paste in the code sent to you by others. 

The code in question was:

Selection.InsertDateTime DateTimeFormat:="yyyy-MM-dd h:mm AM/PM",
InsertAsField:=False

This code is a bit long--when I just tried this, it came out in red, because
the line breaks were wrong, so I deleted back from the second line and let
the VB Editor wrap it naturally, and that's often necessary.

So then use File | Return to MS Word, test the macro via Tools | Macros...
Run, and then add a shortcut so that it is actually useful, via Tools |
Customize.

And this is also a *very* good article, just added:
How to modify a recorded macro (by Jay Freedman)
http://word.mvps.org/FAQs/MacrosVBA/ModifyRecordedMacro.htm

DM

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 4 1209 1410
 
D

Daiya Mitchell

Better only in the sense of a being more user-friendly response to "what do
I do with this incomprehensible gibberish?"
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Daiya:

Yeah, take your point. The problem I have with it is that it is simplistic:
it makes a LOT of assumptions about the state of the user's environment, and
doesn't work if things are not "according to Hoyle...".

This is, of course, a hobby-horse of mine. Currently we have a whole user
base out there who *cannot* learn to use Word. That's because the Help is
not "helpful". And that, in turn, is because they left out three quarters
of the information that used to be in there. Which they did in an attempt
to make it "simple". Yep: It's now simple.

Regrettably, Word's help is now also "inadequate".

Of course, I am not suggesting that your post was the same: it wasn't. But
the reason I wrote a "different" article to Dave's is because I felt that it
needed more information. Looking back over it, it probably also needs "less
words", and I should perhaps encourage Beth to speak sternly to it :)

Cheers


Better only in the sense of a being more user-friendly response to "what do
I do with this incomprehensible gibberish?"

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 4 1209 1410
 
D

Daiya Mitchell

I think I was going to try to merge the two, so that your info was still all
there but not the first thing introduced--they are copied into my folder of
multiple articles in progress, which I should really make a commitment to
actually finish some day soon. :) that one should be easy, all copying and
pasting...

Daiya
 

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