Philip Rose
New Member
- Outlook version
- Email Account
- Exchange Server 2007
Hello,
This is a simple VBA macro which I wrote to use in Word 2007. It addresses the problem of long sentences. The macro operates by replacing the first character in the selected text with a full stop and the last character is raised to a capital letter. Everything between these two is deleted and replaced with a double space.
The macro works perfectly in Word 2007 and I would like to be able to use it when I am composing an email (Outlook 2007). Unfortunately I cannot work out how to alter this code so that I can run it in inspector, mode to edit the text that I have highlighted/selected. What I need to know is…
I imagine that the answer to these questions is stunningly obvious but I have been unable to discover it for myself and for that reason I thank you in anticipation of your help.
Philip
This is a simple VBA macro which I wrote to use in Word 2007. It addresses the problem of long sentences. The macro operates by replacing the first character in the selected text with a full stop and the last character is raised to a capital letter. Everything between these two is deleted and replaced with a double space.
Sub MakeSentance()
Dim FirstChar, LastChar, NewString As String
FirstChar = Left(Selection, 1)
LastChar = UCase(Right(Selection, 1))
NewString = FirstChar & ". " & LastChar
Selection = NewString
End Sub
Dim FirstChar, LastChar, NewString As String
FirstChar = Left(Selection, 1)
LastChar = UCase(Right(Selection, 1))
NewString = FirstChar & ". " & LastChar
Selection = NewString
End Sub
The macro works perfectly in Word 2007 and I would like to be able to use it when I am composing an email (Outlook 2007). Unfortunately I cannot work out how to alter this code so that I can run it in inspector, mode to edit the text that I have highlighted/selected. What I need to know is…
- How do I set the code to operate with the email that I am creating?
- How do I acquire the selected ('Selection') text?
- When I have made the alterations, how do I 'put back' the new version of the selection?
I imagine that the answer to these questions is stunningly obvious but I have been unable to discover it for myself and for that reason I thank you in anticipation of your help.
Philip