View Single Post
 
Old 04-14-2025, 06:00 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

As an alternative, you can use a buildingblock and be macro free.


Select an existing Journal entry or better yet create a new one along the lines suggested by Italophile (with or without creating styles), select it, press ALT+F3 to create the BuildingBlock.


Now you can insert a new journal entry header by simply typing "jour..." and pressing Enter when the autocomplete tip text line appears.


Advantages:
Macro free
No shapes
No empty paragraphs


Disadvantages:
If you share the document with others, you must share the template as well


If you want to use some keyboard shortcut with a macro:


Code:
Sub InsertJE()
  On Error GoTo Err_NotFound
  ActiveDocument.AttachedTemplate.BuildingBlockEntries("journalentry").Insert _
               Selection.Range, RichText:=True
  Exit Sub
lbl_Exit:
  Exit Sub
Err_NotFound:
  MsgBox "The building block ""journalentry"" was not found in " _
          & ThisDocument.Name & " attached template.", vbInformation + vbOKOnly, _
          "MISSING BUILDING BLOCK"
  Resume lbl_Exit
End Sub
Attached Images
File Type: jpg BB Text.jpg (39.1 KB, 9 views)
File Type: jpg BB Definition.jpg (52.4 KB, 9 views)
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote