![]() |
|
#1
|
|||
|
|||
![]()
Wonderful, thank you very much! It works great!
I made a few changes. These are mostly personal preferences, but I'm pasting them here in case someone else might be interested in applying them. Otherwise, they can easily be removed. Here they are, together with the code: 1) i need double-paragraphs to be replaced by a single paragraph, not entirely removed; 2) links are now blue and underlined; 3) during testing with various other content, I found some links that still had some large vertical space in between them, but that was only because of the 'ParagraphFormat.SpaceAfter' property, which is now set to 0; 4) I also found some links that had no anchor text at all - these will get deleted. Code:
Dim aHL As Hyperlink, sText As String For Each aHL In ActiveDocument.Hyperlinks sText = aHL.Range.Text sText = Replace(sText, Chr(13), "") aHL.TextToDisplay = sText + Chr(13) aHL.Range.Font.Color = vbBlue aHL.Range.Font.Underline = wdUnderlineSingle aHL.Range.ParagraphFormat.SpaceAfterAuto = False aHL.Range.ParagraphFormat.SpaceAfter = 0 If sText = "" Then aHL.Delete End If Next aHL With ActiveDocument.Content.Find .Execute FindText:="^p^p", ReplaceWith:="^p", Wrap:=wdFindStop, Replace:=wdReplaceAll End With |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
alex100 | Word VBA | 3 | 05-16-2020 08:43 AM |
double spaced within paragraph 2 blank lines between paragraphs | BigOldArt | Word | 1 | 08-24-2017 09:08 AM |
![]() |
eduzs | Word VBA | 25 | 07-01-2017 04:04 PM |
![]() |
jcw | Word | 1 | 11-18-2011 11:47 AM |
![]() |
GWBDIRECT | Outlook | 3 | 04-06-2011 11:29 AM |