Delete line using a bookmark

K

Keith74

Hi All

I have a word document where i update certain bookmarks using values
taken from a database. Sometime for a particular bookmark there is no
data to enter so i want to delete that bookmark and the entire line
that bookmark is on i.e. remove gaps in a persons address. The problem
i'm having is this is all done via other program, none of the code is
in the document so i have to refer to the document through objects and
because the user can open other documents while this whole process is
running using activedocument.selection is out. Can anyone point me in
the right direction using vba.

cheers

keith
 
K

Keith74

Just for the interest of anyone else who has this problem

objWordDoc.Bookmarks("line1").Range.Paragraphs(1).Range.Delete

seems to sort it
 

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