change the default from HTML paste special

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do you change the default HTML to one of the other options in paste
special.
 
Generally speaking, you would record a macro and then run it whenever
you wanted to paste in a particular format. Note, however, that the
available paste formats depend on what is on the clipboard. Therefore
you would have to add an error-handling routine to the macro.

The most common request is to paste as plain text, which this macro
does:

Sub PasteUnformatted()
On Error Resume Next
Selection.PasteSpecial Link:=False, DataType:=wdPasteText, _
Placement:= wdInLine, DisplayAsIcon:=False
End Sub

It is always possible to paste in text format, assuming that there is
something on the clipboard. If the clipboard is empty the PasteSpecial
method fails; the On Error Resume Next statement then says the macro
should continue with the next statement, which is End Sub. In other
words, if the clipboard is empty, the macro just quits without
performing an action. (If the macro has more than one command, or if you
want a more complex task performed when an error occurs, you cannot use
On Error Resume Next.)

If you need assistance on how to install a macro, see
http://www.gmayor.com/installing_macro.htm.

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
Thank you for your help


Stefan Blom said:
Generally speaking, you would record a macro and then run it whenever
you wanted to paste in a particular format. Note, however, that the
available paste formats depend on what is on the clipboard. Therefore
you would have to add an error-handling routine to the macro.

The most common request is to paste as plain text, which this macro
does:

Sub PasteUnformatted()
On Error Resume Next
Selection.PasteSpecial Link:=False, DataType:=wdPasteText, _
Placement:= wdInLine, DisplayAsIcon:=False
End Sub

It is always possible to paste in text format, assuming that there is
something on the clipboard. If the clipboard is empty the PasteSpecial
method fails; the On Error Resume Next statement then says the macro
should continue with the next statement, which is End Sub. In other
words, if the clipboard is empty, the macro just quits without
performing an action. (If the macro has more than one command, or if you
want a more complex task performed when an error occurs, you cannot use
On Error Resume Next.)

If you need assistance on how to install a macro, see
http://www.gmayor.com/installing_macro.htm.

--
Stefan Blom
Microsoft Word MVP


in message
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top