Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-22-2025, 02:49 PM
nonno nonno is offline Add en-dash as the beginning of every paragraph Windows 11 Add en-dash as the beginning of every paragraph Office 2021
Novice
Add en-dash as the beginning of every paragraph
 
Join Date: Mar 2023
Posts: 13
nonno is on a distinguished road
Default

As I mentioned, I'm going to incorporate this with other macros, so it would be nice to do this with a macro as well.

I recorded a macro and updated it to get this, but it skips the very first paragraph of the Word document.



Code:
Sub Macro9()
    
    Selection.HomeKey Unit:=wdStory, Extend:=wdMove
    
    With Selection.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Text = "^p"
        .Replacement.Text = "^p ^= "
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add en-dash as the beginning of every paragraph VBA Bold text at beginning of paragraph Shelley Lou Word VBA 6 11-18-2024 03:15 PM
Add en-dash as the beginning of every paragraph Replace paragraph with style and add an em dash jeffreybrown Word VBA 1 05-08-2021 04:01 PM
Add en-dash as the beginning of every paragraph Space tab at the beginning of each paragraph in a chapter village Word 3 07-20-2018 01:48 AM
Add en-dash as the beginning of every paragraph Need Word to change -- (dash,dash) into one long dash. Bobosmite Word 2 05-06-2011 04:21 AM
Dash in the beginning of a new line Wakinyan Word 0 07-11-2010 07:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:25 AM.


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