Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-26-2017, 06:05 PM
eduzs eduzs is offline Cmbine two underline types? Windows 10 Cmbine two underline types? Office 2010 32bit
Expert
Cmbine two underline types?
 
Join Date: May 2017
Posts: 262
eduzs is on a distinguished road
Default Cmbine two underline types?

Is there a way to combine two underlines like:

selection.Font.underline =wdUnderlineWavy + wdUnderlineWords

Thanks
__________________
Backup your original file before doing any modification.
Reply With Quote
  #2  
Old 05-28-2017, 08:03 AM
gmaxey gmaxey is offline Cmbine two underline types? Windows 7 32bit Cmbine two underline types? Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,427
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

No, but you can fudge:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim orng As Range
  Set orng = Selection.Range
  orng.Underline = wdUnderlineWavy
  With orng.Find
    .Text = "[ .,:;\!\?" & Chr(9) + Chr(160) & "]"
    .MatchWildcards = True
    .Font.Underline = wdUnderlineWavy
    .Replacement.Font.Underline = wdUnderlineNone
    .Execute Replace:=wdReplaceAll
  End With
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 05-28-2017, 02:37 PM
eduzs eduzs is offline Cmbine two underline types? Windows 10 Cmbine two underline types? Office 2010 32bit
Expert
Cmbine two underline types?
 
Join Date: May 2017
Posts: 262
eduzs is on a distinguished road
Default

Superb! Many thanks.

I have this code, how I can change it to instead of turning the font color blue apply a wavy + words underline based on your code?

(ps. I didn't use the find/found because the strange behaviors of this instruction)

Quote:
For oWord = 1 To Selection.Paragraphs(1).Range.Words.Count

If Len(Trim(Selection.Paragraphs(1).Range.Words(oWord ).Text)) > 4 Then

If InStr(1, PalsRep, Trim(Selection.Paragraphs(1).Range.Words(oWord).Te xt), vbTextCompare) > 1 Then

With Selection.Paragraphs(1).Range.Words(oWord).Font.Co lorIndex = wdBlue

End If

End If

Next oWord
__________________
Backup your original file before doing any modification.
Reply With Quote
  #4  
Old 05-29-2017, 09:32 AM
gmaxey gmaxey is offline Cmbine two underline types? Windows 7 32bit Cmbine two underline types? Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,427
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

I have no idea what a PalsRep is.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cmbine two underline types? Automatic Formatting/Types SteveHebburn Word 1 07-18-2015 03:55 PM
Cmbine two underline types? Task types with no Resources assigned mtaylor Project 1 05-24-2014 12:37 PM
Data types Jennifer Murphy Word VBA 0 01-05-2013 04:12 PM
Cmbine two underline types? Page numbering (two types in one doc) alexb123 Word 1 03-05-2012 04:11 PM
multiple types of alignment on one line? uoficowboy Word 1 03-06-2010 08:54 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:33 AM.


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