Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How can I make a shortcut or macro to paste text only format?
When I copy from a web page, and do a regular paste to Word, Word has an
error and closes. I need to use "paste special" as text. I tried to record a macro to paste as unformated text, but it didn't work. How can I write visual basic macro to do this? |
#2
|
|||
|
|||
This one has worked for me:
Sub PasteSpecial() Selection.PasteSpecial Link:=False, DataType:=wdPasteText, Placement:= _ wdInLine, DisplayAsIcon:=False End Sub I then assigned it to a keyboard shortcut to call it up easily. I actually got this by recording it as a macro, but there may have been something about the web page that interfered with your attempt to do so. You may want to change or eliminate some of the optional statements (e.g., "DisplayAsIcon:"); they came in recording the macro. "ray" wrote: When I copy from a web page, and do a regular paste to Word, Word has an error and closes. I need to use "paste special" as text. I tried to record a macro to paste as unformated text, but it didn't work. How can I write visual basic macro to do this? |
#3
|
|||
|
|||
Actually, all of the optional statements specify default conditions, so you
could just shorten this to: Sub PasteSpecial() Selection.PasteSpecial End Sub "Chris@PDX" wrote: This one has worked for me: Sub PasteSpecial() Selection.PasteSpecial Link:=False, DataType:=wdPasteText, Placement:= _ wdInLine, DisplayAsIcon:=False End Sub I then assigned it to a keyboard shortcut to call it up easily. I actually got this by recording it as a macro, but there may have been something about the web page that interfered with your attempt to do so. You may want to change or eliminate some of the optional statements (e.g., "DisplayAsIcon:"); they came in recording the macro. "ray" wrote: When I copy from a web page, and do a regular paste to Word, Word has an error and closes. I need to use "paste special" as text. I tried to record a macro to paste as unformated text, but it didn't work. How can I write visual basic macro to do this? |
#4
|
|||
|
|||
The default datatype depends on what's actually in the clipboard at the
time, so you need to specify text if that's what you want the macro to do -- selection.PasteSpecial datatype:=wdPasteText "Chris@PDX" wrote in message ... Actually, all of the optional statements specify default conditions, so you could just shorten this to: Sub PasteSpecial() Selection.PasteSpecial End Sub "Chris@PDX" wrote: This one has worked for me: Sub PasteSpecial() Selection.PasteSpecial Link:=False, DataType:=wdPasteText, Placement:= _ wdInLine, DisplayAsIcon:=False End Sub I then assigned it to a keyboard shortcut to call it up easily. I actually got this by recording it as a macro, but there may have been something about the web page that interfered with your attempt to do so. You may want to change or eliminate some of the optional statements (e.g., "DisplayAsIcon:"); they came in recording the macro. "ray" wrote: When I copy from a web page, and do a regular paste to Word, Word has an error and closes. I need to use "paste special" as text. I tried to record a macro to paste as unformated text, but it didn't work. How can I write visual basic macro to do this? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to highlight text and paste new text in it's place? | Microsoft Word Help | |||
End/FootNote text style | Page Layout | |||
How to paste text which looks like I'm typing? | Microsoft Word Help | |||
How to paste text which looks like I'm typing? | Microsoft Word Help | |||
I cannot cut and paste text from word to another applicarion | Microsoft Word Help |