Skip to content

Commit ba8c380

Browse files
Addressed the feedback
1 parent 69f12df commit ba8c380

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed
Binary file not shown.

Slides/Iterate-slide-elements/.NET/Iterate-slide-elements/Program.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ public static void Main(string[] args)
1414
// Iterate through each slide in the presentation
1515
foreach (ISlide slide in presentation.Slides)
1616
{
17+
// Iterate through each shape in the master slide shapes.
18+
foreach (IShape shape in slide.LayoutSlide.MasterSlide.Shapes)
19+
{
20+
// Modify the shape properties (text, size, hyperlinks, etc.)
21+
ModifySlideElements(shape, presentation);
22+
}
23+
// Iterate through each shape in the layout slide shapes.
24+
foreach (IShape shape in slide.LayoutSlide.Shapes)
25+
{
26+
// Modify the shape properties (text, size, hyperlinks, etc.)
27+
ModifySlideElements(shape, presentation);
28+
}
1729
// Iterate through each shape in the slide
1830
foreach (IShape shape in slide.Shapes)
1931
{
@@ -122,8 +134,11 @@ private static void ModifySlideElements(IShape shape, IPresentation presentation
122134
{
123135
// Modify SmartArt content
124136
ISmartArt smartArt = shape as ISmartArt;
125-
ISmartArtNode smartArtNode = smartArt.Nodes[0];
126-
smartArtNode.TextBody.Text = "Requirement";
137+
//Traverse through all nodes inside SmartArt
138+
foreach (ISmartArtNode node in smartArt.Nodes)
139+
{
140+
ModifyTextPart(node.TextBody);
141+
}
127142
break;
128143
}
129144

0 commit comments

Comments
 (0)