Removing a para

G

Guest

I put the following line in my macro:

ActiveDocument.Paragraphs(68).Range.Delete

And it does not work. It does not seem to do anything.

So how do I delete that para?

Sergey
 
K

Klaus Linke

Hi Sergey,

Maybe there's something special about the paragraph mark you're trying to
delete...

Is it right before a table?
Can you select and delete it in the user interface?

Regards,
Klaus
 
G

Guest

Hello Klaus,

OK, here it goes.

When I first added this instruction:
ActiveDocument.Paragraphs(68).Range.Delete
It did delete the para. Then for no reason known to me it stopped doing it.
So I thought maybe it is just another word vba bug.

As for the para there's nothing special about it.

And before replying to the previous suggestion I played around with it a bit
as follows:
ActiveDocument.Paragraphs(67).Range.Text = ""
ActiveDocument.Paragraphs(70).Range.Text = ""

This did not bother adjacent paras either.

Sergey
 
K

Klaus Linke

So if you run
ActiveDocument.Paragraphs(68).Range.Select
then go into the document and hit the delete button, the paragraph is
deleted, but if you undo that (Ctrl+Z) and run
ActiveDocument.Paragraphs(68).Range.Delete
nothing happens?

That would be extremely strange, and it's difficult for me to believe that
there is a bug like that.

Regards,
Klaus
 
G

Guest

I had a workaround for the problem before posting the query. So let's wrap
it up here. Thanks for your input.

Sergey
 

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