View Single Post
 
Old 02-26-2024, 02:53 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,600
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

That is working to do what you told it to do "Insert a tab after the the last character in paragraph 1. If you want it at the end of the "current" paragraph then you can use:


Code:
Sub ScratchMacro()
  'A basic Word Macro coded by Gregory K. Maxey
  Selection.Paragraphs(1).Range.InsertAfter vbTab
lbl_Exit:
  Exit Sub
End Sub

By the way, you don't ever have to use:
"With Active Document
...
End With


Especially when you are only doing one thing. Simply use:
ActiveDocument.Paragraphs(1).Range.InsertAfter vbTab
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote