Delete a Line

M

matt

Hello,
Is there a way to delete the first line (or just remove whatever is on the
first line) in a word document?
I have four commandButtons on the first line in my word doc that I want to
be removed when I run a macro I have that sends the document in the body of
an email message.
I was searching through the object browser and came accross
wdUnits(wdLines). Was I on the right path with that?
 
G

Greg Maxey

Hello,
Is there a way to delete the first line (or just remove whatever is on the
first line) in a word document?
I have four commandButtons on the first line in my word doc that I want to
be removed when I run a macro I have that sends the document in the body of
an email message.
I was searching through the object browser and came accross
wdUnits(wdLines). Was I on the right path with that?

Sub ScratchMacro()
Dim oRng As Word.Range
With ActiveDocument
'Move IP to the start of the document
.Range(0, 0).Select
Set oRng = .Bookmarks("\line").Range
oRng.Delete
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top