Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Joe McGuire Joe McGuire is offline
external usenet poster
 
Posts: 121
Default Getting a Macro to Work Right

I recorded a simple macro for using paste Special. With the macro recorded
running I clicked on Edit|Paste Special|Unformatted Text and then ended the
macro recording. But when the macro runs it returns formatted rather than
unformatted text. When I click Edit this seems to be what the macro really
is:

Sub pasteSpec()
'
' pasteSpec Macro
' Macro recorded 1/27/2007 by Joseph McGuire
'
Selection.PasteAndFormat (wdPasteDefault)
End Sub

The object is to end up with a button on my toolbar that I can merely click
and have unformatted text pasted into my Word document. I already have a
button that does this part-way, leaving me to then click "Unformatted Text".
Is there a way to do what I want?


  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Getting a Macro to Work Right

Use

Sub PasteUnfText()
On Error GoTo oops
Selection.PasteSpecial DataType:=wdPasteText, Placement:= _
wdInLine
End
oops:
Beep
End Sub

instead


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Joe McGuire wrote:
I recorded a simple macro for using paste Special. With the macro
recorded running I clicked on Edit|Paste Special|Unformatted Text and
then ended the macro recording. But when the macro runs it returns
formatted rather than unformatted text. When I click Edit this seems
to be what the macro really is:

Sub pasteSpec()
'
' pasteSpec Macro
' Macro recorded 1/27/2007 by Joseph McGuire
'
Selection.PasteAndFormat (wdPasteDefault)
End Sub

The object is to end up with a button on my toolbar that I can merely
click and have unformatted text pasted into my Word document. I
already have a button that does this part-way, leaving me to then
click "Unformatted Text". Is there a way to do what I want?



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Joe McGuire Joe McGuire is offline
external usenet poster
 
Posts: 121
Default Getting a Macro to Work Right

Works great! Thanks!

"Graham Mayor" wrote in message
...
Use

Sub PasteUnfText()
On Error GoTo oops
Selection.PasteSpecial DataType:=wdPasteText, Placement:= _
wdInLine
End
oops:
Beep
End Sub

instead


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Joe McGuire wrote:
I recorded a simple macro for using paste Special. With the macro
recorded running I clicked on Edit|Paste Special|Unformatted Text and
then ended the macro recording. But when the macro runs it returns
formatted rather than unformatted text. When I click Edit this seems
to be what the macro really is:

Sub pasteSpec()
'
' pasteSpec Macro
' Macro recorded 1/27/2007 by Joseph McGuire
'
Selection.PasteAndFormat (wdPasteDefault)
End Sub

The object is to end up with a button on my toolbar that I can merely
click and have unformatted text pasted into my Word document. I
already have a button that does this part-way, leaving me to then
click "Unformatted Text". Is there a way to do what I want?





  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Joe McGuire Joe McGuire is offline
external usenet poster
 
Posts: 121
Default Getting a Macro to Work Right

Thanks!

"Graham Mayor" wrote in message
...
Use

Sub PasteUnfText()
On Error GoTo oops
Selection.PasteSpecial DataType:=wdPasteText, Placement:= _
wdInLine
End
oops:
Beep
End Sub

instead


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Joe McGuire wrote:
I recorded a simple macro for using paste Special. With the macro
recorded running I clicked on Edit|Paste Special|Unformatted Text and
then ended the macro recording. But when the macro runs it returns
formatted rather than unformatted text. When I click Edit this seems
to be what the macro really is:

Sub pasteSpec()
'
' pasteSpec Macro
' Macro recorded 1/27/2007 by Joseph McGuire
'
Selection.PasteAndFormat (wdPasteDefault)
End Sub

The object is to end up with a button on my toolbar that I can merely
click and have unformatted text pasted into my Word document. I
already have a button that does this part-way, leaving me to then
click "Unformatted Text". Is there a way to do what I want?





  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Getting a Macro to Work Right

You are welcome ... twice.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Joe McGuire wrote:
Thanks!

"Graham Mayor" wrote in message
...
Use

Sub PasteUnfText()
On Error GoTo oops
Selection.PasteSpecial DataType:=wdPasteText, Placement:= _
wdInLine
End
oops:
Beep
End Sub

instead


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Joe McGuire wrote:
I recorded a simple macro for using paste Special. With the macro
recorded running I clicked on Edit|Paste Special|Unformatted Text
and then ended the macro recording. But when the macro runs it
returns formatted rather than unformatted text. When I click Edit
this seems to be what the macro really is:

Sub pasteSpec()
'
' pasteSpec Macro
' Macro recorded 1/27/2007 by Joseph McGuire
'
Selection.PasteAndFormat (wdPasteDefault)
End Sub

The object is to end up with a button on my toolbar that I can
merely click and have unformatted text pasted into my Word
document. I already have a button that does this part-way, leaving
me to then click "Unformatted Text". Is there a way to do what I
want?



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
Reading Layout View Andrea Microsoft Word Help 38 December 26th 06 07:37 AM
Macro not working on other pc's akkrug New Users 15 August 22nd 06 01:07 PM
FilePrint macro didn't work after all... janice Microsoft Word Help 11 March 28th 06 06:26 PM
macro doesn't work when I unprotect form mary Formatting Long Documents 1 May 3rd 05 07:35 PM
Getting Spell Check Macro to work Tom Hyland Microsoft Word Help 8 January 14th 05 06:45 PM


All times are GMT +1. The time now is 08:47 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"