![]() |
|
#5
|
|||
|
|||
|
Instead of adding a shape and a bunch of empty paragraphs it would be better to create two new styles - Journal Date with a top border set above the paragraph by a suitable distance (20pts in the screenshot) and a suitable space before (12pt in the screenshot), and Journal Date with a suitable space after (12pt in the screenshot).
Screenshot 2025-04-13 195654.png Your code can then be: Code:
Sub NewJournalEntry()
With ActiveDocument.Paragraphs
With .Last.Range
'ensure that there is an empty paragraph at the end of the document
.InsertParagraphAfter
End With
With .Last.Range
.InsertDateTime DateTimeFormat:="dddd, MMMM d, yyyy", _
InsertAsField:=False, DateLanguage:=wdEnglishUS, CalendarType:= _
wdCalendarWestern, InsertAsFullWidth:=False
.Style = "Journal Date"
End With
.Last.Range.InsertParagraphAfter
With .Last.Range
.InsertDateTime DateTimeFormat:="h:mm am/pm", InsertAsField:= _
False, DateLanguage:=wdEnglishUS, CalendarType:=wdCalendarWestern, _
InsertAsFullWidth:=False
.Style = "Journal Time"
End With
.Last.Range.InsertParagraphAfter
.Last.Style = wdStyleNormal
End With
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Creating a horizontal line in a document
|
jjjoverthere | Word | 2 | 11-03-2018 05:39 PM |
Horizontal line I can't delete
|
goingvirtual | Word | 2 | 09-09-2018 02:58 AM |
MS Word Horizontal Line Disappears after pressing Enter from end of line
|
MikeWhite | Word | 5 | 01-20-2017 03:39 PM |
| How to change the default features for AutoShape horizontal line (button 'Insert horizontal line') | 534tomasz | Word | 6 | 10-13-2016 02:33 AM |
Putting a horizontal line in a Word Document -- should be simple, right?
|
biotechguy | Word | 4 | 05-10-2010 11:58 AM |