![]() |
|
#9
|
|||
|
|||
|
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 |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Word macro for deleting a line that starts with a specific character + deleting the line before
|
eduardb | Word | 1 | 08-10-2022 03:17 AM |
| Search Word for specific strings and replace with hyperlinks from a list | jlive24 | Word VBA | 2 | 06-26-2022 08:14 PM |
| Extracting Specific Text Strings | PWH68 | Word VBA | 6 | 10-08-2019 02:07 AM |
Deleting Characters in a specific location in Word 2010
|
ppayaw | Word VBA | 8 | 12-13-2016 08:11 AM |
update style of all strings available between two specific strings
|
vikrantkale | Word | 1 | 03-28-2011 06:13 PM |