Missing Paste Command

Posted: 02-24-2006, 11:25 PM
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

Reply With Quote

Responses to "Missing Paste Command"

John McGhie [MVP - Word and Word Macintosh]
Guest
Posts: n/a
 
Re: Missing Paste Command
Posted: 02-25-2006, 06:03 AM
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(wdFormatSurroundingFormat tingWithEmphasis)
End Sub




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

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


Reply With Quote
Rafael Montserrat
Guest
Posts: n/a
 
Re: Missing Paste Command
Posted: 02-25-2006, 06:16 PM
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:
>
> 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(wdFormatSurroundingFormat tingWithEmphasis)
> End Sub
>
>
>
>
> On 25/2/06 11:25 AM, in article C024E3E0.1565%rafaelmontserrat@sbcglobal.net,
> "Rafael Montserrat" <rafaelmontserrat@sbcglobal.net> wrote:
>
>> > 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
>> >


Reply With Quote
 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste Into command in Indesign CS3 doesn't remember X/Y coordinates Gavin_M@adobeforums.com Mac Indesign 19 04-08-2008 10:55 PM
How do you 'extract' or remove the 'paste into' command? Michael_Trout@adobeforums.com Mac Indesign 4 12-22-2006 12:36 PM
Daiya Missing Paste Commands Montserrat Mac Ofice Word 1 10-24-2005 07:22 PM
Keyboard command for Paste UNFORMATTED text? Tony Mac Ofice Word 2 08-13-2004 12:48 PM
Drag 'n' paste missing in OS X Ann Onymous Apple Macintosh 3 07-22-2003 10:06 PM