Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
computerkiller computerkiller is offline
external usenet poster
 
Posts: 29
Default Help with fixing my macro

I created this macro to paste items of the web, but when the paste macro runs
the formating is wrong. How can I correct this? (I want the text to be the
same as on the page, Times New Roman 12 and at the end of the paste.)

Sub PasteSpecial()
'
' PasteSpecial Macro
' Macro recorded 5/21/2007 by Dennis
'
Selection.TypeParagraph
Selection.PasteAndFormat (wdPasteDefault)
End Sub
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Help with fixing my macro

What you really need is

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


--

Graham Mayor - Word MVP

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




computerkiller wrote:
I created this macro to paste items of the web, but when the paste
macro runs the formating is wrong. How can I correct this? (I want
the text to be the same as on the page, Times New Roman 12 and at the
end of the paste.)

Sub PasteSpecial()
'
' PasteSpecial Macro
' Macro recorded 5/21/2007 by Dennis
'
Selection.TypeParagraph
Selection.PasteAndFormat (wdPasteDefault)
End Sub



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
computerkiller computerkiller is offline
external usenet poster
 
Posts: 29
Default Help with fixing my macro

Sorry I do not understand, are you making a joke? Thank you for the reply
though.

"Graham Mayor" wrote:

What you really need is

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


--

Graham Mayor - Word MVP

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




computerkiller wrote:
I created this macro to paste items of the web, but when the paste
macro runs the formating is wrong. How can I correct this? (I want
the text to be the same as on the page, Times New Roman 12 and at the
end of the paste.)

Sub PasteSpecial()
'
' PasteSpecial Macro
' Macro recorded 5/21/2007 by Dennis
'
Selection.TypeParagraph
Selection.PasteAndFormat (wdPasteDefault)
End Sub




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Help with fixing my macro

The macro posted does what you asked - it inserts text from web pages with
the formatting of the surrounding text - and includes error trapping for
those occasions when you have not selected anything. You can rename it if
you want. If that is not what you wanted, then please clarify. If, for
example, you want to paste the original web format intact, this may not be
possible.

--

Graham Mayor - Word MVP

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


computerkiller wrote:
Sorry I do not understand, are you making a joke? Thank you for the
reply though.

"Graham Mayor" wrote:

What you really need is

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


--

Graham Mayor - Word MVP

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




computerkiller wrote:
I created this macro to paste items of the web, but when the paste
macro runs the formating is wrong. How can I correct this? (I want
the text to be the same as on the page, Times New Roman 12 and at
the end of the paste.)

Sub PasteSpecial()
'
' PasteSpecial Macro
' Macro recorded 5/21/2007 by Dennis
'
Selection.TypeParagraph
Selection.PasteAndFormat (wdPasteDefault)
End Sub



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
computerkiller computerkiller is offline
external usenet poster
 
Posts: 29
Default Help with fixing my macro

No I wanted the macro to paste something from the web site, but have the same
formating (text, font size, colour) as the document I pasted it into. I have
to appologies my first remarks came out a little to strong. I ment to just
ask a question. Could you explain what is happening in your macro. Thank you
for your help.

"Graham Mayor" wrote:

The macro posted does what you asked - it inserts text from web pages with
the formatting of the surrounding text - and includes error trapping for
those occasions when you have not selected anything. You can rename it if
you want. If that is not what you wanted, then please clarify. If, for
example, you want to paste the original web format intact, this may not be
possible.

--

Graham Mayor - Word MVP

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


computerkiller wrote:
Sorry I do not understand, are you making a joke? Thank you for the
reply though.

"Graham Mayor" wrote:

What you really need is

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


--

Graham Mayor - Word MVP

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




computerkiller wrote:
I created this macro to paste items of the web, but when the paste
macro runs the formating is wrong. How can I correct this? (I want
the text to be the same as on the page, Times New Roman 12 and at
the end of the paste.)

Sub PasteSpecial()
'
' PasteSpecial Macro
' Macro recorded 5/21/2007 by Dennis
'
Selection.TypeParagraph
Selection.PasteAndFormat (wdPasteDefault)
End Sub






  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Help with fixing my macro

The macro traps errors and bleeps the PC speaker. The most likely error is
having nothing in the clipboard when the macro is run. The macro then pastes
the content of the clipboard as plain unformatted text, so by placing it in
line at the cursor position it adopts the formatting at that position. I
would guess that you used the macro recorder to record much the same thing -
as you have now found the macro recorder does not always record what you
think it will record.

--

Graham Mayor - Word MVP

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



computerkiller wrote:
No I wanted the macro to paste something from the web site, but have
the same formating (text, font size, colour) as the document I pasted
it into. I have to appologies my first remarks came out a little to
strong. I ment to just ask a question. Could you explain what is
happening in your macro. Thank you for your help.

"Graham Mayor" wrote:

The macro posted does what you asked - it inserts text from web
pages with the formatting of the surrounding text - and includes
error trapping for those occasions when you have not selected
anything. You can rename it if you want. If that is not what you
wanted, then please clarify. If, for example, you want to paste the
original web format intact, this may not be possible.

--

Graham Mayor - Word MVP

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


computerkiller wrote:
Sorry I do not understand, are you making a joke? Thank you for the
reply though.

"Graham Mayor" wrote:

What you really need is

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


--

Graham Mayor - Word MVP

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




computerkiller wrote:
I created this macro to paste items of the web, but when the paste
macro runs the formating is wrong. How can I correct this? (I want
the text to be the same as on the page, Times New Roman 12 and at
the end of the paste.)

Sub PasteSpecial()
'
' PasteSpecial Macro
' Macro recorded 5/21/2007 by Dennis
'
Selection.TypeParagraph
Selection.PasteAndFormat (wdPasteDefault)
End Sub



  #7   Report Post  
Posted to microsoft.public.word.docmanagement
computerkiller computerkiller is offline
external usenet poster
 
Posts: 29
Default Help with fixing my macro

Thank you for your help greatly appreciated.

Dennis

"Graham Mayor" wrote:

The macro traps errors and bleeps the PC speaker. The most likely error is
having nothing in the clipboard when the macro is run. The macro then pastes
the content of the clipboard as plain unformatted text, so by placing it in
line at the cursor position it adopts the formatting at that position. I
would guess that you used the macro recorder to record much the same thing -
as you have now found the macro recorder does not always record what you
think it will record.

--

Graham Mayor - Word MVP

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



computerkiller wrote:
No I wanted the macro to paste something from the web site, but have
the same formating (text, font size, colour) as the document I pasted
it into. I have to appologies my first remarks came out a little to
strong. I ment to just ask a question. Could you explain what is
happening in your macro. Thank you for your help.

"Graham Mayor" wrote:

The macro posted does what you asked - it inserts text from web
pages with the formatting of the surrounding text - and includes
error trapping for those occasions when you have not selected
anything. You can rename it if you want. If that is not what you
wanted, then please clarify. If, for example, you want to paste the
original web format intact, this may not be possible.

--

Graham Mayor - Word MVP

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


computerkiller wrote:
Sorry I do not understand, are you making a joke? Thank you for the
reply though.

"Graham Mayor" wrote:

What you really need is

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


--

Graham Mayor - Word MVP

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




computerkiller wrote:
I created this macro to paste items of the web, but when the paste
macro runs the formating is wrong. How can I correct this? (I want
the text to be the same as on the page, Times New Roman 12 and at
the end of the paste.)

Sub PasteSpecial()
'
' PasteSpecial Macro
' Macro recorded 5/21/2007 by Dennis
'
Selection.TypeParagraph
Selection.PasteAndFormat (wdPasteDefault)
End Sub




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
Fixing Table Size Michele Microsoft Word Help 3 December 5th 06 08:17 PM
Fixing Mail Merge soon? gkoval Mailmerge 4 August 11th 06 06:11 AM
Fixing the Normal Template Kristen Microsoft Word Help 2 July 3rd 06 05:06 PM
fixing a row height Jackie D Tables 3 October 5th 05 11:41 AM
Fixing an Auto Date Wooding New Users 7 March 8th 05 02:32 PM


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