Replace hard returns with soft returns on selected text and button to QAT

Not open for further replies.


Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Spent quite some time on searching for an Outlook add-in that automatically replaced hard returns with soft ones.
AFAIK there are none, which is astonishing considering this problem probably exists already since Outlook was introduced.

There are some 3rd party workarounds, like Autohotkey-script, Powertoys Keyboard Manager (mapping the 'Enter'-key)
The Powertoys Keyboard Manager mapping the 'Enter'-key is 'global', hence may affect how the enter-key responds in other applicatons.
For instance, in Excel, where I set up the enter-key to move to the right. With Powertoys enabled, it moves to the left.

FWIW... I have yet found another workaround.

1. add a macro to Outlook replacing hard returns with soft ones on selected text and
2. add a button to the Quick Access Toolbar.

1. Macro reads as follows:

Sub ReplaceHardReturns()
Dim wdSelection As Word.Selection
Dim wdDoc As Word.Document

    Set wdDoc = Application.ActiveInspector.WordEditor
    Set wdSelection = wdDoc.Windows(1).Selection

    With wdSelection.Find
        .Text = "^p"
        .Replacement.Text = "^l"
        .Forward = True
        .Wrap = wdFindStop
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    wdSelection.Find.Execute Replace:=wdReplaceAll
End Sub

Note: the .Wrap = wdFindStop
Instead of: .Wrap = wdFindAsk, or .Wrap = wdFindContinue
AFAIK, whilst using either one of the latter two, the graphical message separator (the line) is being removed as well.

1. Add a button to the QAT: Create a button for a macro - HowTo-Outlook

There is an older thread on this matter ("Run macro automatically at sending an email") but that did not work after all.
Don't know why, I thought it would work, I gave up on trying to make it work. Maybe running a macro that edits an email before sending is not possible.
Anyway, as long as there are no dedicated Outlook add-ins mapping the Enter-key (only within Outlook), we have to resort to this kind of relatively poor workarounds.

SnagIt-24082022 103537.png
Don't spend too much time on it Diane. Reason is that the macro works fine on selected text, as per above example.
However, a "ctrl-a" and run the macro will remove the message separator (graphic line), which, I assume, is not ideal.

IF..IF.. at all it would be possible to run this macro when sending a mail, then likely removing any separator will likely take place.

FYI: I've been sending back and forth a number of times of test messages to my gmail account, running the macro on selected text each time. Works fine.
Just as a short 'follow up' and FWIW: I have been using this macro for almost a year now. Before sending the mail: select text that needs to be corrected - run macro. Where necessary this also works on previously sent parts. In my opinion, the macro is really the best and easiest solution so far.
The advantage is you can see that it 1) worked and 2) didn't screw it up. Automated macros save a step but you wont see that it worked like it should until after its sent and you look at the sent item.
Its the macro at the first post in this thread - copy and paste into the VBA editor in outlook.
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
Beeto Replace a string in body Outlook VBA and Custom Forms 2
O How to find and replace a word in Outlook-Agenda-Subject and Message? Using Outlook 0
S HTML Code Embedded in String Within Open Outlook Email Preventing Replace(Application.ActiveInspector.CurrentItem.HTMLBody From Working Outlook VBA and Custom Forms 4
M Outlook 2013 Replace Subject with Conversation (a "hidden" value). Outlook VBA and Custom Forms 0
F Copy and replace not update contact in another pst Using Outlook 0
B Automatically Forward Emails and Remove/Replace All or Part of Body Outlook VBA and Custom Forms 8
C How to replace or delete first instance of sentence in mail body? Outlook VBA and Custom Forms 1
C replace subject line generated by converting a word document to PDF and sending it to an email Using Outlook 8
Diane Poremsky How to perform a global search and replace Using Outlook 0
B Delete/replace old files and save new attachments Using Outlook 1
Diane Poremsky Replace Display Names with Email Addresses Using Outlook 0
mrje1 Is there a Find and Replace feature in Outlook 2016? Using Outlook 4
J Pull an email address from body and replace reply-to address Outlook VBA and Custom Forms 4
divan Outlook 2007 - Replace email body with custom text Using Outlook 9
E VBScript to replace module? Using Outlook 3
A How to replace column title in address book Using Outlook 1
V Replace only part of subject in OUTLOOK 2003 Outlook VBA and Custom Forms 1
A Replace olFolderContacts for Sharepoint lists in Outlook Outlook VBA and Custom Forms 5
P replace default outlook form with custom form Outlook VBA and Custom Forms 1
A How to replace getcontactsfolder (ol2007) in Outlook 2003 Outlook VBA and Custom Forms 2
K vba code to auto download email into a specific folder in local hard disk as and when any new email arrives in Inbox/subfolder Outlook VBA and Custom Forms 0
J Saving attachments from specific sender (phone number) to specific folder on hard drive Using Outlook 3
mikolajek Random message selected after hard delete Using Outlook 4
Diane Poremsky Save Attachments to the Hard Drive Using Outlook 2
P Saving All Messages to the Hard Drive Using VBA Outlook VBA and Custom Forms 5
D How to copy yahoo email folders to hard drive Using Outlook 2
C connecting to recent outlook file on new hard drive Using Outlook 2
R Move sent items emails to hard disk Using Outlook 10
B OUTLOOK 2013: How Do I Move Emails to Folders stored on my Hard Drive? Using Outlook 3
A How to open .msg file from Hard disk folder? Using Outlook 3
B importing Outlook from a backup on an external hard drive Using Outlook 5
T Move archive file to new hard drive and still be ablse to access it Using Outlook 1
B How to: Open .MSG File from Hard Drive via Code Outlook VBA and Custom Forms 2
J Hard drive won't boot--can I rescue my BCM contacts? BCM (Business Contact Manager) 2
Aussie Outlook 365 Rule runs manually but returns the error code "an unexpected error has occurred" when incoming mail arrives Using Outlook 1
D Outlook 2016 IMAP Connection Returns All Email but does NOT Using accounts in Outlook 2
G email returns after running macro to move emails Outlook VBA and Custom Forms 1
G Content Lost From Draft, Returns Upon Refocus? Using Outlook 0
S Send receive with ATT returns this error: 0x800CCC92 . My password is correct. Using Outlook 2
C Namespace.CurrentUser.Address returns unknown Outlook VBA and Custom Forms 1
A Outlook Advanced Search Problems...returns with an Error: Argument Outlook VBA and Custom Forms 1
V "A program has attachment filename open" Message returns Outlook VBA and Custom Forms 4
D Application.ActiveInspector().CurrentItem Returns Wrong(Old) Value Outlook VBA and Custom Forms 3
P Inspector.WordEditor always returns null Outlook VBA and Custom Forms 3

Similar threads