Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 05-20-2020, 06:16 AM
MrBill51 MrBill51 is offline Unindent Initial Chapter and Section Paragraphs in Novel Windows 10 Unindent Initial Chapter and Section Paragraphs in Novel Office 2010
Novice
Unindent Initial Chapter and Section Paragraphs in Novel
 
Join Date: May 2020
Posts: 2
MrBill51 is on a distinguished road
Default

Thanks for your suggestion. It didn't work, but I managed to tweak it and now it works great, without the need to create any styles. Here's the code:


Sub FixNovelFormat()

'Fix the first-line indentation of Scrivener Word output file

Set myRange = ActiveDocument.Content

'Remove indentation from third paragraph below the word "CHAPTER"
With myRange.Find
.Text = "CHAPTER"
While .Execute
myRange.Collapse Direction:=wdCollapseStart
myRange.Move Unit:=wdParagraph, Count:=3
myRange.ParagraphFormat.FirstLineIndent = InchesToPoints(0)
myRange.Collapse wdCollapseEnd
Wend
End With

'Remove indentation from the paragraph below the hashtag
Set myRange = ActiveDocument.Content

With myRange.Find
.Text = "#"
While .Execute
myRange.Collapse Direction:=wdCollapseStart
myRange.Move Unit:=wdParagraph, Count:=1
myRange.ParagraphFormat.FirstLineIndent = InchesToPoints(0)
myRange.Collapse wdCollapseEnd
Wend
End With
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter page references in paragraphs kenking Word 12 02-07-2020 03:33 PM
Adding chapter or section numbers to 'Page Number' JStephens3 Word 2 07-02-2019 01:45 PM
Unindent Initial Chapter and Section Paragraphs in Novel Footer: chapter and section names tropaj Word 7 05-22-2019 03:56 PM
Need "Section 1" numbering which is followed by 1.1 Chapter titles and 1.2.3 subs xmlgirl Word 1 02-26-2014 12:31 AM
using odd-Even chapter footers with page number and chapter titles Fossils13 Word 0 07-17-2010 06:49 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:54 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