Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Fixing Table Size | Microsoft Word Help | |||
Fixing Mail Merge soon? | Mailmerge | |||
Fixing the Normal Template | Microsoft Word Help | |||
fixing a row height | Tables | |||
Fixing an Auto Date | New Users |