PowerPoint shapeId/ShapeName property changes/Increments automatic

A

Abhishek Bagga

Hi!
I am accessing the properties of the borders of a table inserted within ppt
presentation but facing this very annoying problem.
Whenever i access any property related to the borders of the table it
changes/Increments the ID as well as the shape of the current cell.
This has become a major problem since i am refering to the current shape
thru a variable and when the id changes the my code gives me a com exception.
I am facing this problem with both off2k (Only shape name as Shape Id does
not exists) and off XP
I am posting a small sample code to better explain my problem
You can create a simple 3X3 table and select the table and chk this code
thru VB editor inside PPT
I am actually creating my app in .net but for testing purposes i am posting
the vba code

Sub Testing()
With ActiveWindow.Selection.ShapeRange(1).Table.Cell(1, 1)
MsgBox ActiveWindow.Selection.ShapeRange(1).Id
MsgBox ActiveWindow.Selection.ShapeRange(1).Name
MsgBox .Borders(ppBorderTop).Visible
MsgBox ActiveWindow.Selection.ShapeRange(1).Id
MsgBox ActiveWindow.Selection.ShapeRange(1).Name
MsgBox .Borders(ppBorderTop).Visible
MsgBox ActiveWindow.Selection.ShapeRange(1).Id
MsgBox ActiveWindow.Selection.ShapeRange(1).Name
MsgBox .Borders(ppBorderTop).Visible
MsgBox ActiveWindow.Selection.ShapeRange(1).Id
MsgBox ActiveWindow.Selection.ShapeRange(1).Name
MsgBox .Borders(ppBorderTop).Visible
MsgBox ActiveWindow.Selection.ShapeRange(1).Id
MsgBox ActiveWindow.Selection.ShapeRange(1).Name
End With
End Sub

Kindly give some suggestion or a solution to this or a link to some other
similar post that would be of some help
 
S

Shyam Pillai

Hello Abhishek,
While I've encountered the issue you've mentioned in the past, I haven't
experieced in refering to the shape if the reference is stored in a shape
type variable even when the shape name/id changes.
 
A

Abhishek Bagga

Thanks Shyam
I agree with what u r saying, reference is stored in a shape type variable
Nor do i but the problem arises in case of the tables when i am excessing
the rows and columns of a particular table
Since the id changes and may be there are some other changes to it as well
which result in a com exception in my code.
Basically when i start accessing the rows and columns i assign them to the
cell type variable but since it changes the id/name and may be some other
properties as well,
It raises a com exception

Regards,
Abhishek
 

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