J
JsJ_Slim
Hi,
I've got some code that allows user to select a shape by name
(source-shape), and use its contents to generate a new table shape object
(result-shape). Each time the user changes the value in the source-shape, the
result-shape is deleted, and a new table is insert in place with the updated
value.
The problem that I'm facing however is if the user deletes the source-shape
object (in which case, the result-shape is removed, and a new shape is put in
place with an error message), then undos the deletion, I end up getting
0x800A01A8 exception whenever I access the source-shape's properties, eg, in
this scenario:
foreach(Slide slide in _app.Slides) {
foreach(Shape shape in slide.Shapes) {
if (shape.Name!=null && !shape.Name.Equals(string.Empty)) {
namedShapes.Add(shape.Name, shape); // Adds entry that maps shape name
to shape object
}
}
}
When executed, the source-shape causes problems when I try to access its
Name property. I've no idea what exactly is causing this problem, because I
have some other functions that involves 2 normal text shape (both source and
result), and the result shape is never removed once created (only updated).
Hence, I suspect the problem might be caused by constantly deleting the
table-result-shape, but I can't be sure.
Please help.
Thanks!
JsJ
p.s.
For my scenario, you can assume that no shape names will ever collide.
I've got some code that allows user to select a shape by name
(source-shape), and use its contents to generate a new table shape object
(result-shape). Each time the user changes the value in the source-shape, the
result-shape is deleted, and a new table is insert in place with the updated
value.
The problem that I'm facing however is if the user deletes the source-shape
object (in which case, the result-shape is removed, and a new shape is put in
place with an error message), then undos the deletion, I end up getting
0x800A01A8 exception whenever I access the source-shape's properties, eg, in
this scenario:
foreach(Slide slide in _app.Slides) {
foreach(Shape shape in slide.Shapes) {
if (shape.Name!=null && !shape.Name.Equals(string.Empty)) {
namedShapes.Add(shape.Name, shape); // Adds entry that maps shape name
to shape object
}
}
}
When executed, the source-shape causes problems when I try to access its
Name property. I've no idea what exactly is causing this problem, because I
have some other functions that involves 2 normal text shape (both source and
result), and the result shape is never removed once created (only updated).
Hence, I suspect the problem might be caused by constantly deleting the
table-result-shape, but I can't be sure.
Please help.
Thanks!
JsJ
p.s.
For my scenario, you can assume that no shape names will ever collide.