![]() |
#1
|
|||
|
|||
![]()
I've been trying to get this macro to work correctly.
It's for adding a new journal entry. It is suppose to go to the end of the document, insert a horizontal line, and then the date and time. The date and time work correctly, but for some reason I can only get it to insert the line at the top of the document instead of the end. I imagine that it has something to do with the range parameter of AddHorizontalLineStandard. But for the life of me, no matter what VBA reference or example I look at, I can not find what the values of 'range" can or is suppose to be. Thanks, Paul Code:
Sub New_Journal_Entry() ' ' Macro2 Macro ' ' Selection.EndKey Unit:=wdStory ActiveDocument.InlineShapes.AddHorizontalLineStandard Selection.TypeParagraph Selection.TypeParagraph Selection.InsertDateTime DateTimeFormat:="dddd, MMMM d, yyyy", _ InsertAsField:=False, DateLanguage:=wdEnglishUS, CalendarType:= _ wdCalendarWestern, InsertAsFullWidth:=False Selection.TypeParagraph Selection.InsertDateTime DateTimeFormat:="h:mm am/pm", InsertAsField:= _ False, DateLanguage:=wdEnglishUS, CalendarType:=wdCalendarWestern, _ InsertAsFullWidth:=False Selection.TypeParagraph Selection.TypeParagraph End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
jjjoverthere | Word | 2 | 11-03-2018 05:39 PM |
![]() |
goingvirtual | Word | 2 | 09-09-2018 02:58 AM |
![]() |
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 |
![]() |
biotechguy | Word | 4 | 05-10-2010 11:58 AM |