I want to delete a fixed number of characters of a paragraph in MS Word. I came across a situation where the paragraph starts with some character as the first character and a space as the second character. When I select the paragraph range and execute Range.Characters.First.Delete
the second character (space) also gets deleted instead of only the first one.
Does anyone know why this behaviour is taking place?
CodePudding user response:
You could use:
Selection.Range.Delete Unit:=wdCharacter, Count:=1
CodePudding user response:
You could use:
.Range.Characters.First.Text = vbNullstring
or:
.Range.Words.First.Text = " "