Re: delete the last paragragh or section using VBA by Tony
Tony
Fri Mar 10 06:58:41 CST 2006
I'm not a lot wiser after that I'm afraid. If you want to delete it you've
got to know where it is - precisely. My guess is that it starts at what was
content.end before the insert and runs to what is now the end of the
document (content.end again) so you'll need to save the start position and
delete the appropriate range, perhaps ....
Activedocument.range(whateveroldendwas, whatevernewendis).delete
But you haven't said why you can't use Undo - what do you do between
inserting it and wanting to delete it?
--
Enjoy,
Tony
"VBA Novice" <VBANovice@discussions.microsoft.com> wrote in message
news:7451B35C-2989-46B3-A7A4-29CB68466C0F@microsoft.com...
> Let me clarify my question.
>
> I have a control button which pulls in some data off Excel using
> content.insert.after in coding. I need to know what code I can use to
clear
> the data I just pulled in, something like activedocuments.content.delete.
My
> problem is that I do not want to delete everything on the page.
>
> Thanks.
>
> "Tony Jollans" wrote:
>
> > Rather vague question but I would consider using Undo.
> >
> > --
> > Enjoy,
> > Tony
> >
> >
> > "VBA Novice" <VBANovice@discussions.microsoft.com> wrote in message
> > news:8ED52FC8-D43E-438C-BB16-203076E9F16B@microsoft.com...
> > > Let's say I pulled some data into word and decided to delete it. What
VBA
> > > code I can use to delete the data I just pulled, not knowing exactly
the
> > > paragrah or section #?
> > >
> > > Thank you for your input.
> >
> >
> >