Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-25-2025, 08:54 AM
brucemc777 brucemc777 is offline Select text, click button, hyphens replace spaces Windows 10 Select text, click button, hyphens replace spaces Office 2019
Advanced Beginner
Select text, click button, hyphens replace spaces
 
Join Date: Jul 2014
Location: Fredericksburg, VA
Posts: 48
brucemc777 is on a distinguished road
Default Select text, click button, hyphens replace spaces

I must be trying to achieve something rather useless because the only code i can find for this is:
Code:
Sub HyphenateSelection()
    Dim rng As Range
    Set rng = Selection.Range
    rng.Text = Replace(rng.Text, " ", "-")
End Sub
Whereupon i find Outlook does not use the Range Type. Either someone coded without testing or MS has once again "improved" their Outlook product.

Though i have a bit of a grasp with VBA in Excel, it looks like i'm blind in a forest bumping into trees when it comes to Outlook. Would any of you good folks help me out here?

Thank you for your consideration!

Best Regards,
-Bruce
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Select text, click button, hyphens replace spaces How to get rid of Hyphens and spaces in result using dollartext switch Strogg Word 1 01-29-2019 01:43 PM
Select Cell Text to paste into Find/Replace CBarry Word VBA 2 02-16-2017 04:37 AM
Select text, click button, hyphens replace spaces Find, select, and replace part of text with bold paik1002 Word VBA 4 12-07-2015 11:24 PM
Select text, click button, hyphens replace spaces Vba with three click button help poem Excel Programming 15 09-22-2015 09:49 PM
Animations on Button Click dvogler PowerPoint 1 03-01-2012 12:46 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:41 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft