controlling paste format (from browser copy)

M

msiegel

Hello,
I am using Firefox on Max and get an undesired text format (Lucida
Grande size13). When I paste from Safari, I get something different
(Tahoma size 11, also undesired.

Is there an easy way to force the formatting of any browser-copied
text into a standard font of my choosing?

When I searched these forums for an answer, I found some complex
process using macros which would allow the paste so that it matched
existing text, but I couldn't get it to work. I imagined there must be
an easier way to simply specify the format of pasted text regardless
of the source. Please let me know if there is.

Thanks in advance for any help.
Yours, Marc
 
E

Elliott Roper

Hello,
I am using Firefox on Max and get an undesired text format (Lucida
Grande size13). When I paste from Safari, I get something different
(Tahoma size 11, also undesired.

Is there an easy way to force the formatting of any browser-copied
text into a standard font of my choosing?

Yes. Edit » Paste Special... then choose paste unformatted.
The text will appear in the same style as that which was at the
insertion point, exactly as you asked.
When I searched these forums for an answer, I found some complex
process using macros which would allow the paste so that it matched
existing text, but I couldn't get it to work. I imagined there must be
an easier way to simply specify the format of pasted text regardless
of the source. Please let me know if there is.

See above. It is so useful that it is worth assigning a keyboard
shortcut to it. Set the style, font, whatever at the insertion point
before you paste unformatted.

Be aware that not all web content in every browser makes its way into
the clipboard in a form that Word can use.
 
M

msiegel

Hi Elliott,
Yes. Edit » Paste Special... then choose paste unformatted.
The text will appear in the same style as that which was at the
insertion point, exactly as you asked.

Wow! Thanks for your timely and spot-on answer. You've been a great
help!
I owe you two tacos and a beer (will virtual do?).
I did indeed set up a keyboard shortcut.

One last question (perhaps I'm getting greedy now). The process
defaults to the paste special at "styled text". Is there a way to
change the default to "unformatted" to save yet another clcik.

Yours,Marc
 
E

Elliott Roper

Hi Elliott,

Wow! Thanks for your timely and spot-on answer. You've been a great
help!
I owe you two tacos and a beer (will virtual do?).
I did indeed set up a keyboard shortcut.

One last question (perhaps I'm getting greedy now). The process
defaults to the paste special at "styled text". Is there a way to
change the default to "unformatted" to save yet another clcik.

That too is easy. That's where the macro comes in.
Record yourself doing it, remembering to assign a keyboard shortcut as
you set up the recording. I chose ctrl-shift-v since it was sort of
similar to cmd-V for paste. Mine ended up like this, probably after
cleaning it up a little:
Sub PasteUnformatted()
'
' PasteUnformatted Macro
' Macro recorded 13-08-2004 by Elliott Roper
'
Selection.PasteSpecial Link:=False, DataType:=wdPasteText,
Placement:= _
wdInLine, DisplayAsIcon:=False
End Sub

Watch the wrapping. "Selection to Placement:=_" is a single line.

You could copy this into the Macros editor, but it is just as easy, and
far more fun to learn how to record macros. Compare yours to the muck
above.
 
M

msiegel

Hi Elliott,
That too is easy. That's where the macro comes in.
Record yourself doing it, remembering to assign a keyboard shortcut as
you set up the recording. I chose ctrl-shift-v since it was sort of
similar to cmd-V for paste. Mine ended up like this, probably after
cleaning it up a little:
Sub PasteUnformatted()
'
' PasteUnformatted Macro
' Macro recorded 13-08-2004 by Elliott Roper
'
Selection.PasteSpecial Link:=False, DataType:=wdPasteText,
Placement:= _
wdInLine, DisplayAsIcon:=False
End Sub

Watch the wrapping. "Selection to Placement:=_" is a single line.

You could copy this into the Macros editor, but it is just as easy, and
far more fun to learn how to record macros. Compare yours to the muck
above.

Awesome. Thanks again for the speedy response. I'll try this later
when I have a chance.
I am so grateful for all of the help. I've been annoyed by this for a
while and I'm glad I finally turned to the forum for help; I surely
would not have figured this out on my own.
Your biggest fan,
Marc

PS Thanks also to Clive Huggan who sent me a similarly helpful
response (I think though private email).
 
C

Clive Huggan

Hi Elliott,


Awesome. Thanks again for the speedy response. I'll try this later
when I have a chance.
I am so grateful for all of the help. I've been annoyed by this for a
while and I'm glad I finally turned to the forum for help; I surely
would not have figured this out on my own.
Your biggest fan,
Marc

PS Thanks also to Clive Huggan who sent me a similarly helpful
response (I think though private email).
Aha! That might explain why I couldn't find my post! (I sent it rather late
at night). Thanks, Marc. :-\

Clive Huggan
============
 
C

Carl Witthoft

Hello,
I am using Firefox on Max and get an undesired text format (Lucida
Grande size13). When I paste from Safari, I get something different
(Tahoma size 11, also undesired.

Is there an easy way to force the formatting of any browser-copied
text into a standard font of my choosing?

When I searched these forums for an answer, I found some complex
process using macros which would allow the paste so that it matched
existing text, but I couldn't get it to work. I imagined there must be
an easier way to simply specify the format of pasted text regardless
of the source. Please let me know if there is.

Thanks in advance for any help.
Yours, Marc

Can't be all that tough: after you've copied the text, bring Word to
the front, start recording a macro, and select PasteSpecial, then click
on Unformatted Text. Stop recording. Now you can use that macro to
paste text and it'll pick up the format of whatever style you paste it
into. I do something like this; also created a button in a toolbar for
the macro.
 
J

John McGhie

Guys:

Here you go: this one is rather more elegant in that it has error detection
and handling built in. The one you can record will occasionally blow up if
the thing on the clipboard cannot be pasted as plain text...

Be careful if you paste out of a browser. Browsers turn the leading spaces
on the nine into non-breaking spaces, which is not the "space" character to
the compiler, so it can't compile. If tat happens, paste into TextEdit,
then paste from there into the Visual Basic Editor.

Sub EditPaste()
'
' Macro1 Macro
' Macro recorded 20/12/00 by John McGhie
'
On Error GoTo JustPaste

If ActiveDocument.Kind <> wdDocumentEmail And _
(Selection.Type = wdSelectionIP Or _
Selection.Information(wdWithInTable) = False) Then
Selection.PasteSpecial DataType:=wdPasteText
Else
PasteNormal
End If
End

JustPaste:
Selection.Paste
End Sub



Can't be all that tough: after you've copied the text, bring Word to
the front, start recording a macro, and select PasteSpecial, then click
on Unformatted Text. Stop recording. Now you can use that macro to
paste text and it'll pick up the format of whatever style you paste it
into. I do something like this; also created a button in a toolbar for
the macro.

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Consultant Technical Writer
McGhie Information Engineering Pty Ltd
http://jgmcghie.fastmail.com.au/
Sydney, Australia. S33°53'34.20 E151°14'54.50
+61 4 1209 1410, mailto:[email protected]
 

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