Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Nov 2002
    Location
    London, Gtr London, England
    Posts
    496
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Replacing standard Paste with Paste Special (Word

    Dear Loungers,
    I want to interrupt the Paste command and use Paste Special instead. Because what is being pasted varies I wnat to choose the method of pasting.

    thanks liz

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Replacing standard Paste with Paste Special (Word

    You could select Tools | Customize... and remove the Paste item from the Edit menu and from the Standard toolbar. Then add Paste Special... from the Edit category to the Standard toolbar and change it to look the way you like. That way, both menu and toolbar would only have the Paste Special... item. But Ctrl+V would still execute the Paste command.

    If you really want to replace Paste entirely, you can create a macro named EditPaste in a module in your Normal.dot:

    Sub EditPaste()
    On Error GoTo ErrHandler
    Application.Dialogs(wdDialogEditPasteSpecial).Show
    Exit Sub
    ErrHandler:
    Select Case Err
    Case 4605
    ' can't paste - ignore
    Case Else
    MsgBox Err.Description, vbExclamation
    End Select
    End Sub

    But I don't think it would be a good idea to do this - it would very quickly become annoying. Better to have both Paste and Paste Special available.

  3. #3
    4 Star Lounger
    Join Date
    Nov 2002
    Location
    London, Gtr London, England
    Posts
    496
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Re: Replacing standard Paste with Paste Special (W

    Hans

    Thkyou/ Yes, I am nervous about doing this but the situation that the template will be used in is very particular and I think, in these circumstances it will be fine. I am trying to persuad the clinet to have a Paste Unformatted Text and a Paste Picture menu option or button but he is adamant!

    I don't tink this traps the user selecting Cancel does it so I should add that?

    Thnak you..... liz

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Replacing standard Paste with Paste Special (W

    Application.Dialogs(wdDialogEditPasteSpecial).Show returns a value to indicate which button the user clicked in the dialog:
    0 (False) = Cancel
    -1 (True) = OK
    So you could use

    If Application.Dialogs(wdDialogEditPasteSpecial).Show Then
    ' user clicked OK
    ....
    Else
    ' user clicked Cancel
    ...
    End If

  5. #5
    4 Star Lounger
    Join Date
    Nov 2002
    Location
    London, Gtr London, England
    Posts
    496
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Re: Replacing standard Paste with Paste Special (W

    Hans,

    Yes just done that works fine

    thank you...... liz

    ps what I should say is I've used the following which is the same idea:

    ErrHandler:
    Select Case Err
    Case 4605
    ' can't paste - ignore
    Case vbCancel
    Exit Sub
    Case Else
    MsgBox Err.Description, vbExclamation
    End Select

    Is there any reason that I shouldn't do it this way?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Replacing standard Paste with Paste Special (W

    I don't think that would work. Canceling the Paste Special dialog doesn't cause an error, and if it did, the error code wouldn't have been equal to vbCancel (=2).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •