View Single Post
 
Old 11-24-2023, 04:45 PM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

RobiNew,


Firstly, what is LastChr? It is not declared as a variable.
Secondly, if it is intended as a range, then stop treating it like a selection.


Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  oRng.Collapse wdCollapseEnd
  oRng.Start = oRng.Start - 1
  oRng.Font.Underline = wdUnderlineNone
  oRng.InsertAfter vbCr & "First Part - End"
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote