Adding Lines and Deleting using VBA in powerpoint

  • Thread starter Thread starter kiersarama
  • Start date Start date
K

kiersarama

Hi all,

Im a VBA newbie but cannot get it to do something really simple. I
want to add a line to my powerpoint, which i have done using a couple
of methods: Shapes.Addline and DrawLine but i cannot get these to
delete easily once i have added them.

The DrawLine works but it then doesnt allow the lines to stay on the
screen when a function is called, and doesnt seem to have the same
functionality as the .Addline, ie there are no dashes allowed.

I want a line to be drawn on a button press, and then it to be redrawn
on the next button press essentially, with no trace of the previous
line.

Can anyone help please!?
 
You have several options for this. The best option might be to have the
line already drawn and just hide and show it. This works well if the line
is in a preset location. Alternatively, if you want to add a line and
later delete, you should use an object variable to store the line, so
that later you can oLine.Delete.

There are examples of hiding and showing objects as well as adding and
deleting objects on my site:

http://www.PowerfulPowerPoint.com/

You might start with Examples 6.5 and 6.6 under "Examples by Chapter."

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

(e-mail address removed) wrote in @d55g2000hsg.googlegroups.com:
 
Back
Top