jonascbaoth
Member
- Outlook version
- Outlook 365 64 bit
- Email Account
- Exchange Server
This was bugging me and there were not many good directions online but I found part of a thread about this from a few years ago on this forum and thought I would update it (can't post there since it's closed), and for posterity.
Use Case
I write a lot of emails in Outlook and frequently am copying/pasting info from other places, but want to paste unformatted so that the text doesn't have wonky formatting. Even if I change the paste option to default to "unformatted text" in Outlook settings, for whatever reason (thanks Microsoft), Outlook rarely if ever actually respects that. And because Outlook also lacks the ability to set custom keyboard shortcuts for specific commands like Word (again, thanks Microsoft), there's no way to set a custom shortcut for built-in "paste unformatted text" in Outlook. So here's a workaround:
Step 1: Enable Developer mode in Outlook. (File > Options > Customize Ribbon > check the "Developer" box)
Step 2: Compose a new message in Outlook, then go to the Developer tab > click "Macros" > then click "Macros" again. A dialog box will pop up. Type a name (it doesn't matter what) and then click "Create." A new window will open.
Step 3: In the new window, copy and paste the following code:
Sub Paste_Special_Unformatted()
Dim objDoc As Word.Document
Dim objSel As Word.Selection
On Error Resume Next
' get a Word.Selection from the open Outlook item
Set objDoc = Application.ActiveInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
' now do what you want with the Selection
objSel.PasteSpecial Link:=False, DataType:=wdPasteText
Set objDoc = Nothing
Set objSel = Nothing
End Sub
Step 4: Test it by clicking the little "play" (RUN) button in the code creation window. If you have the compose draft window open in the background, clicking "Run" should paste whatever you have copied to your clipboard into your compose window (which will be the code you just pasted if you previously copied it to the clipboard). That confirms it works.
Step 5: In the Compose window, click the Quick Access Toolbar right underneath the ribbon and click "Customize the Ribbon." Click "Quick Access Toolbar" on the left side. in the dropdown menu, choose "Macros." Find your Macro and add it to the right side box. I suggest moving it to the very top of that list.
This adds the macro to your Quick Access Toolbar so you can click it easily. You can also press "Alt+1" when composing a message and it'll trigger the first item in your QAT (which is the macro you created if you placed it where I said to). But we're not done.
Step 6: Install Microsoft PowerToys. If you have a work computer, you may not be able to do this unfortunately, but depending on your IT policy, they may allow this software to be installed as it is official first-party Microsoft software. Explain that it will greatly increase your efficiency and productivity workflow.
Step 7: Open PowerToys. Go to Keyboard Manager. Go to Shortcuts. Click "Remap a Shortcut." Under "Physical shortcut" click "Type" and then type whatever shortcut you'd like to use to paste unformatted text in Outlook. Under "Mapped to" click "Type" and then type "Alt 1". Then in the "Target app" box type "outlook". Then click OK at the top. Close PowerToys.
You should now be able to paste unformatted text into any Outlook email draft using your preferred tool! Just make sure you don't move the macro you created from your #1 Quick Access Toolbar, or that will break. You can of course move it elsewhere in the QAT, but be sure to map the key accordingly (if it's the 2nd item in the QAT instead of the first, the shortcut would be Alt+2).
Happy Outlooking!
Use Case
I write a lot of emails in Outlook and frequently am copying/pasting info from other places, but want to paste unformatted so that the text doesn't have wonky formatting. Even if I change the paste option to default to "unformatted text" in Outlook settings, for whatever reason (thanks Microsoft), Outlook rarely if ever actually respects that. And because Outlook also lacks the ability to set custom keyboard shortcuts for specific commands like Word (again, thanks Microsoft), there's no way to set a custom shortcut for built-in "paste unformatted text" in Outlook. So here's a workaround:
Step 1: Enable Developer mode in Outlook. (File > Options > Customize Ribbon > check the "Developer" box)
Step 2: Compose a new message in Outlook, then go to the Developer tab > click "Macros" > then click "Macros" again. A dialog box will pop up. Type a name (it doesn't matter what) and then click "Create." A new window will open.
Step 3: In the new window, copy and paste the following code:
Sub Paste_Special_Unformatted()
Dim objDoc As Word.Document
Dim objSel As Word.Selection
On Error Resume Next
' get a Word.Selection from the open Outlook item
Set objDoc = Application.ActiveInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
' now do what you want with the Selection
objSel.PasteSpecial Link:=False, DataType:=wdPasteText
Set objDoc = Nothing
Set objSel = Nothing
End Sub
Step 4: Test it by clicking the little "play" (RUN) button in the code creation window. If you have the compose draft window open in the background, clicking "Run" should paste whatever you have copied to your clipboard into your compose window (which will be the code you just pasted if you previously copied it to the clipboard). That confirms it works.
Step 5: In the Compose window, click the Quick Access Toolbar right underneath the ribbon and click "Customize the Ribbon." Click "Quick Access Toolbar" on the left side. in the dropdown menu, choose "Macros." Find your Macro and add it to the right side box. I suggest moving it to the very top of that list.
This adds the macro to your Quick Access Toolbar so you can click it easily. You can also press "Alt+1" when composing a message and it'll trigger the first item in your QAT (which is the macro you created if you placed it where I said to). But we're not done.
Step 6: Install Microsoft PowerToys. If you have a work computer, you may not be able to do this unfortunately, but depending on your IT policy, they may allow this software to be installed as it is official first-party Microsoft software. Explain that it will greatly increase your efficiency and productivity workflow.
Step 7: Open PowerToys. Go to Keyboard Manager. Go to Shortcuts. Click "Remap a Shortcut." Under "Physical shortcut" click "Type" and then type whatever shortcut you'd like to use to paste unformatted text in Outlook. Under "Mapped to" click "Type" and then type "Alt 1". Then in the "Target app" box type "outlook". Then click OK at the top. Close PowerToys.
You should now be able to paste unformatted text into any Outlook email draft using your preferred tool! Just make sure you don't move the macro you created from your #1 Quick Access Toolbar, or that will break. You can of course move it elsewhere in the QAT, but be sure to map the key accordingly (if it's the 2nd item in the QAT instead of the first, the shortcut would be Alt+2).
Happy Outlooking!