Microsoft® Excel® based database addin

 

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Alex Maghen Guest

    Default Global "Paste Special" Unformatted Text Key

    Sorry if I am abusing this board, but it may be relevant here. I need to
    create a key combination which works EVERYWHERE (including in Outlook Email
    Composition) which will perform a "Paste Special->Unformatted Unicode Text"
    in ALL applications within MS Office 2007. I am having a difficult time
    finding a way to do this.

    Alex

  2. #2
    Tim Li - MSFT Guest

    Default RE: Global "Paste Special" Unformatted Text Key

    Hello Alex,

    Because you are posting in VBA newsgroup, my understanding to this question
    is you need to create a VBA macro in each office application(because one
    VBA macro is only works in one Office application) and assign a hotkey to
    this macro to perform "paste
    unformatted unicode text" action.If I have any misunderstanding there,
    please feel free to tell me.

    If I understand correctly, I think there's a previous post will work for you
    http://www.microsoft.com/communities...ault.aspx?dg=m
    icrosoft.public.office.developer.automation&tid=28 84f8d3-9a7c-43fc-b20a-06a6
    4c256478&p=1

    However, I have some words to say about the Outlook 2007 solution, as I
    know, Outlook 2007 doesn't support custom shortcut, this means we could not
    assign a shortcut to a macro in Outlook 2007 like other Office applications
    mentioned in above link, but there's a work around, we could add a macro in
    Quick Access Toolbar, in this way Outlook will automatically assign a
    shortcut to this macro
    and the shortcut will always be "Alt + [number]", the number depends the
    order of the macro in Quick Access Toolbar.

    The steps of adding a macro into Quick Access Toolbar is as below:
    In Outlook Email Composition window ->Office Button->Editor
    Options->Customize->In the left dropdown we choose Macros.

    The VBA code for Outlook to paste Unfomatted Unicode Text is as below:
    In order to use Word namespace we first need to add reference to "Microsoft
    Word 12.0 Object Library".

    Sub PasteTest()
    Dim doc As Word.Document
    Set doc = Application.ActiveInspector.WordEditor
    doc.Application.Selection.PasteSpecial Link:=False, DataType:=20, _
    Placement:=wdInLine, DisplayAsIcon:=False
    End Sub

    If you will accept to built a shard add-In for all the Office Applications
    in managed code such as c# I'm also researching a work around on this.
    My idea is build a shard add-in so it will be load at every Office
    Application starts, then we could use hook to monitor the keyboard, when a
    certain key combination is pressed, we replace the clipboard with the
    Unformatted Unicode Text we need, after, use SendKeys.Send method to send a
    paste commend to Office Application, thus, we achieve the goal.The
    disadvantage is we may break the original data on the clipboard.
    The advantage to this method is we use just one code snippet that can works
    for all Office Applications.

    I'll follow up with the detailed code of this work around in my later
    reply, if you have any comments, please do let me know.


    Best regards,
    Tim Li
    Microsoft Online Community Support

    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    msdnmg@microsoft.com.


  3. #3
    Tim Li - MSFT Guest

    Default RE: Global "Paste Special" Unformatted Text Key

    Hello Alex,

    Because you are posting in VBA newsgroup, my understanding to this question
    is you need to create a VBA macro in each office application(because one
    VBA macro is only works in one Office application) and assign a hotkey to
    this macro to perform "paste
    unformatted unicode text" action.If I have any misunderstanding there,
    please feel free to tell me.

    If I understand correctly, I think there's a previous post will work for you
    http://www.microsoft.com/communities...ault.aspx?dg=m
    icrosoft.public.office.developer.automation&tid=28 84f8d3-9a7c-43fc-b20a-06a6
    4c256478&p=1

    However, I have some words to say about the Outlook 2007 solution, as I
    know, Outlook 2007 doesn't support custom shortcut, this means we could not
    assign a shortcut to a macro in Outlook 2007 like other Office applications
    mentioned in above link, but there's a work around, we could add a macro in
    Quick Access Toolbar, in this way Outlook will automatically assign a
    shortcut to this macro
    and the shortcut will always be "Alt + [number]", the number depends the
    order of the macro in Quick Access Toolbar.

    The steps of adding a macro into Quick Access Toolbar is as below:
    In Outlook Email Composition window ->Office Button->Editor
    Options->Customize->In the left dropdown we choose Macros.

    The VBA code for Outlook to paste Unfomatted Unicode Text is as below:
    In order to use Word namespace we first need to add reference to "Microsoft
    Word 12.0 Object Library".

    Sub PasteTest()
    Dim doc As Word.Document
    Set doc = Application.ActiveInspector.WordEditor
    doc.Application.Selection.PasteSpecial Link:=False, DataType:=20, _
    Placement:=wdInLine, DisplayAsIcon:=False
    End Sub

    If you will accept to built a shard add-In for all the Office Applications
    in managed code such as c# I'm also researching a work around on this.
    My idea is build a shard add-in so it will be load at every Office
    Application starts, then we could use hook to monitor the keyboard, when a
    certain key combination is pressed, we replace the clipboard with the
    Unformatted Unicode Text we need, after, use SendKeys.Send method to send a
    paste commend to Office Application, thus, we achieve the goal.The
    disadvantage is we may break the original data on the clipboard.
    The advantage to this method is we use just one code snippet that can works
    for all Office Applications.

    I'll follow up with the detailed code of this work around in my later
    reply, if you have any comments, please do let me know.


    Best regards,
    Tim Li
    Microsoft Online Community Support

    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    msdnmg@microsoft.com.


  4. #4
    Tim Li - MSFT Guest

    Default RE: Global "Paste Special" Unformatted Text Key

    Hello Alex,

    Because you are posting in VBA newsgroup, my understanding to this question
    is you need to create a VBA macro in each office application(because one
    VBA macro is only works in one Office application) and assign a hotkey to
    this macro to perform "paste
    unformatted unicode text" action.If I have any misunderstanding there,
    please feel free to tell me.

    If I understand correctly, I think there's a previous post will work for you
    http://www.microsoft.com/communities...ault.aspx?dg=m
    icrosoft.public.office.developer.automation&tid=28 84f8d3-9a7c-43fc-b20a-06a6
    4c256478&p=1

    However, I have some words to say about the Outlook 2007 solution, as I
    know, Outlook 2007 doesn't support custom shortcut, this means we could not
    assign a shortcut to a macro in Outlook 2007 like other Office applications
    mentioned in above link, but there's a work around, we could add a macro in
    Quick Access Toolbar, in this way Outlook will automatically assign a
    shortcut to this macro
    and the shortcut will always be "Alt + [number]", the number depends the
    order of the macro in Quick Access Toolbar.

    The steps of adding a macro into Quick Access Toolbar is as below:
    In Outlook Email Composition window ->Office Button->Editor
    Options->Customize->In the left dropdown we choose Macros.

    The VBA code for Outlook to paste Unfomatted Unicode Text is as below:
    In order to use Word namespace we first need to add reference to "Microsoft
    Word 12.0 Object Library".

    Sub PasteTest()
    Dim doc As Word.Document
    Set doc = Application.ActiveInspector.WordEditor
    doc.Application.Selection.PasteSpecial Link:=False, DataType:=20, _
    Placement:=wdInLine, DisplayAsIcon:=False
    End Sub

    If you will accept to built a shard add-In for all the Office Applications
    in managed code such as c# I'm also researching a work around on this.
    My idea is build a shard add-in so it will be load at every Office
    Application starts, then we could use hook to monitor the keyboard, when a
    certain key combination is pressed, we replace the clipboard with the
    Unformatted Unicode Text we need, after, use SendKeys.Send method to send a
    paste commend to Office Application, thus, we achieve the goal.The
    disadvantage is we may break the original data on the clipboard.
    The advantage to this method is we use just one code snippet that can works
    for all Office Applications.

    I'll follow up with the detailed code of this work around in my later
    reply, if you have any comments, please do let me know.


    Best regards,
    Tim Li
    Microsoft Online Community Support

    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    msdnmg@microsoft.com.


Bookmarks

Posting Permissions

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