Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Applications / Word / February 2006



Tip: Looking for answers? Try searching our database.

Missing Paste Command

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rafael Montserrat - 25 Feb 2006 00:25 GMT
OS 10.4.5
Word 2004

Hi

I was given this Macro code some time ago in order to resolve the "Missing
Paste Command".  Now that I am in OS 10 I am trying to install it and I get
error messages:

"Sub PasteUnformattedText()" at the top is highlighted in yellow.

"Paste and Match the Formatting in the Destination Document" is in red type.

One of the articles I am using is HOW TO INSTALL A MACRO by By John McGhie
and Daiya Mitchell, in which it is suggested I go back to the newsgrooup for
a corrected phrasing (?) or help in creating this macro.

Right now, when I do Word>Close and return to word> I get a message:
MICROSOFT VISUAL BASIC "This Command Will Stop The Debugger"

All help appreciated.

Rafael

Sub PasteUnformattedText()
'
' equivalent to Edit>Paste Special>Unformatted Text and to using
' the smart button in Word 2004 to select "keep text only"
'
Selection.PasteSpecial datatype:=wdPasteText
End Sub

Paste and Match the Formatting in the Destination Document

Sub PasteDestFormat()
'
' equivalent to using the paste options smart button in Word 2004 to
' select "match destination formatting" after pasting
'
Selection.PasteAndFormat (wdFormatSurroundingFormattingWithEmphasis)
End Sub
John McGhie [MVP - Word and Word Macintosh] - 25 Feb 2006 07:03 GMT
Hi Rafael:

You¹re getting a compile error, probably caused by extra characters in the
code.  In the code below, the RED line should not be in your code, and the
GREEN line should be a single line.

I tested your code with those changes, and it runs fine here.

If you need to split a line in VBA, use ³space, underscore² at the end of
each line, like this:

Selection.PasteAndFormat _
   (wdFormatSurroundingFormattingWithEmphasis)

I try not to split lines, there¹s a dozen ³exceptions² where splitting of
lines is just not allowed under any circumstances :-)

Sub PasteUnformattedText()
'
' equivalent to Edit>Paste Special>Unformatted Text and to using
' the smart button in Word 2004 to select "keep text only"
'
Selection.PasteSpecial datatype:=wdPasteText
End Sub

Paste and Match the Formatting in the Destination Document

Sub PasteDestFormat()
'
' equivalent to using the paste options smart button in Word 2004 to
' select "match destination formatting" after pasting
'
Selection.PasteAndFormat(wdFormatSurroundingFormattingWithEmphasis)
End Sub

On 25/2/06 11:25 AM, in article
C024E3E0.1565%rafaelmontserrat@sbcglobal.net, "Rafael Montserrat"
<rafaelmontserrat@sbcglobal.net> wrote:

> Sub PasteUnformattedText()
> '
[quoted text clipped - 13 lines]
> Selection.PasteAndFormat (wdFormatSurroundingFormattingWithEmphasis)
> End Sub

Signature

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

John McGhie <john@mcghie.name>
Microsoft MVP, Word and Word for Macintosh.  Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410

Rafael Montserrat - 25 Feb 2006 19:16 GMT
Hi John,

I went back today to make the correction and to record(?) the macro...put it
in the toolbar ready for use.

But I¹m stuck.  I don¹t know if I¹ve got it right below because some thing
got added to the description, and because I don¹t know how to proceed from
here to record the macro, make it a text or icon in the toolbar.

Also, there are three commands, ³PasteUnformattedText², ³PasteDestFormat²,
and now ³Macro1², ³Macro1² having appeared after I did something, not
knowing what I was doing.

I recognize these: ³PasteUnformattedText², ³PasteDestFormat² from the
original ³Paste Special² from ³All Commands².  There can also be 4 or 5
other choices in the paste special box.

Anyway I¹m stuck at this point.  I know that in the past, before I moved
from OS 9 to OS 10 I got through all this and created the macro.  Now I¹ve
forgotton how to complete the process.

Rafael

Below: What¹s now in the VBE(?) window.

And yes.  What I got before was a ³compile error².

Sub PasteUnformattedText()
'
' equivalent to Edit>Paste Special>Unformatted Text and to using
' the smart button in Word 2004 to select "keep text only"
'
Selection.PasteSpecial datatype:=wdPasteText
End Sub
Sub PasteDestFormat()
'
' equivalent to using the paste options smart button in Word 2004 to
' select "match destination formatting" after pasting
'
Selection.PasteAndFormat (wdFormatSurroundingFormattingWithEmphasis)
End Sub
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 2/25/06 by Rafael Montserrat
'
   Application.Run MacroName:="PasteDestFormat"
   ShowVisualBasicEditor = True
End Sub

On 2/24/06 11:03 PM, in article C0264C58.2F84B%john@mcghie.name, "John
McGhie [MVP - Word and Word Macintosh]" <john@mcghie.name> wrote:

> Hi Rafael:
>
[quoted text clipped - 50 lines]
>> > Selection.PasteAndFormat (wdFormatSurroundingFormattingWithEmphasis)
>> > End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.