Thu Feb 27, 2020 8:17 am
Hello Rachel,
Thanks for a quick response.
This code works well when i execute with a predefined ppt template with an smart art already placed. However, when i try to add smartart at run time in blank template and then if i try to assign hyperlink to one of its node then it throw NullException Erorr. I am attaching a screen shot and sample code for that. Could you please help me on this.
Please see the code below which i am using.
Dim ppt As Presentation = New Presentation()
ppt.LoadFromFile("Presentation1.pptx")
ppt.Slides(0).Shapes.AppendSmartArt(50, 50, 3000, 3000, SmartArtLayoutType.OrganizationChart)
Dim shapes As ShapeCollection = ppt.Slides(0).Shapes
For Each shape As IShape In shapes
If (TypeOf shape Is ISmartArt) Then
'Get the SmartArt
Dim smartArt As ISmartArt = CType(shape, ISmartArt)
Dim node As ISmartArtNode = smartArt.Nodes(0)
node.Click = New ClickHyperlink("https://www.e-iceblue.com")
End If
Next
ppt.SaveToFile("result.pptx", FileFormat.Pptx2013)
Thanks in Advance. Looking for a positive response.
Thanks & Regards,
Anil Kumar
Login to view the files attached to this post.