macro for PasteSpecial Unformatted

Discussion in 'Word VBA' started by Beth Mc, Jun 20, 2005.

  1. Beth Mc

    Beth Mc Guest

    I've tried to create a macro for paste-special -- unformatted. I used the
    "record new macro" option, but this is what my macro looks like. What do I
    need to put instead of "(wdPasteDefault)"?

    Sub UnformattedPaste()
    '
    ' UnformattedPaste Macro
    '
    Selection.PasteAndFormat (wdPasteDefault)
    End Sub

    --
    Thanks,
    Beth
     
    Beth Mc, Jun 20, 2005
    #1
    1. Advertisements

  2. Beth Mc

    Anne Troy Guest

    Try this, Beth:
    http://www.vbaexpress.com/kb/getarticle.php?kb_id=18

    *******************
    ~Anne Troy

    www.OfficeArticles.com
    www.MyExpertsOnline.com


    "Beth Mc" <.(donotspam)> wrote in message
    news:D...
    > I've tried to create a macro for paste-special -- unformatted. I used the
    > "record new macro" option, but this is what my macro looks like. What do I
    > need to put instead of "(wdPasteDefault)"?
    >
    > Sub UnformattedPaste()
    > '
    > ' UnformattedPaste Macro
    > '
    > Selection.PasteAndFormat (wdPasteDefault)
    > End Sub
    >
    > --
    > Thanks,
    > Beth
     
    Anne Troy, Jun 20, 2005
    #2
    1. Advertisements

  3. Beth Mc

    Jay Freedman Guest

    Beth Mc wrote:
    > I've tried to create a macro for paste-special -- unformatted. I used
    > the "record new macro" option, but this is what my macro looks like.
    > What do I need to put instead of "(wdPasteDefault)"?
    >
    > Sub UnformattedPaste()
    > '
    > ' UnformattedPaste Macro
    > '
    > Selection.PasteAndFormat (wdPasteDefault)
    > End Sub


    This is one of several situations where the recorder gets it completely
    wrong. It isn't just the wdPasteDefault that's wrong, but PasteAndFormat is
    the wrong method. Replace the whole line with this:

    Selection.PasteSpecial DataType:=wdPasteText

    --
    Regards,
    Jay Freedman
    Microsoft Word MVP
     
    Jay Freedman, Jun 20, 2005
    #3
  4. Beth Mc

    Beth Mc Guest

    Anne:
    Thanks! I just found that one, but it didn't work for me. I'm not sure why?
    BUT I did find this other one and it works perfectly!!

    Sub PasteUnformatted()
    '
    Selection.PasteSpecial Link:=False, DataType:=wdPasteText

    End Sub

    from http://www.latext.com/pm/comments/P1107_0_1_0

    Thanks! Have a great day!
    Beth

    "Anne Troy" wrote:

    > Try this, Beth:
    > http://www.vbaexpress.com/kb/getarticle.php?kb_id=18
    >
    > *******************
    > ~Anne Troy
    >
    > www.OfficeArticles.com
    > www.MyExpertsOnline.com
    >
    >
    > "Beth Mc" <.(donotspam)> wrote in message
    > news:D...
    > > I've tried to create a macro for paste-special -- unformatted. I used the
    > > "record new macro" option, but this is what my macro looks like. What do I
    > > need to put instead of "(wdPasteDefault)"?
    > >
    > > Sub UnformattedPaste()
    > > '
    > > ' UnformattedPaste Macro
    > > '
    > > Selection.PasteAndFormat (wdPasteDefault)
    > > End Sub
    > >
    > > --
    > > Thanks,
    > > Beth

    >
    >
    >
     
    Beth Mc, Jun 20, 2005
    #4
  5. Beth Mc

    Anne Troy Guest

    LOL, Beth. That's the exact one I pointed you to. :)

    *******************
    ~Anne Troy

    www.OfficeArticles.com
    www.MyExpertsOnline.com


    "Beth Mc" <.(donotspam)> wrote in message
    news:D...
    > Anne:
    > Thanks! I just found that one, but it didn't work for me. I'm not sure

    why?
    > BUT I did find this other one and it works perfectly!!
    >
    > Sub PasteUnformatted()
    > '
    > Selection.PasteSpecial Link:=False, DataType:=wdPasteText
    >
    > End Sub
    >
    > from http://www.latext.com/pm/comments/P1107_0_1_0
    >
    > Thanks! Have a great day!
    > Beth
    >
    > "Anne Troy" wrote:
    >
    > > Try this, Beth:
    > > http://www.vbaexpress.com/kb/getarticle.php?kb_id=18
    > >
    > > *******************
    > > ~Anne Troy
    > >
    > > www.OfficeArticles.com
    > > www.MyExpertsOnline.com
    > >
    > >
    > > "Beth Mc" <.(donotspam)> wrote in message
    > > news:D...
    > > > I've tried to create a macro for paste-special -- unformatted. I used

    the
    > > > "record new macro" option, but this is what my macro looks like. What

    do I
    > > > need to put instead of "(wdPasteDefault)"?
    > > >
    > > > Sub UnformattedPaste()
    > > > '
    > > > ' UnformattedPaste Macro
    > > > '
    > > > Selection.PasteAndFormat (wdPasteDefault)
    > > > End Sub
    > > >
    > > > --
    > > > Thanks,
    > > > Beth

    > >
    > >
    > >
     
    Anne Troy, Jun 20, 2005
    #5
  6. Beth Mc

    kafkaroo

    Joined:
    Sep 12, 2013
    Messages:
    1
    Likes Received:
    0
    This is only eight years old and I just did something that worked. Instead of [Selection.PasteAndFormat (wdPasteDefault)], try [Selection.PasteAndFormat (wdFormatPlainText)].
     
    kafkaroo, Sep 12, 2013
    #6
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.