I created WPF app for some fight tournament. Input is from excel file and output is random generated names (matches) in word file.
I would like to programmatically create required elements add these names in elements that looks like this :
I was trying updating existing code using Microsoft.Office.Interop.Word smartArt but it's not going very well.. :)
Problem is in Nodes.Insert part having exception System.ArgumentException:
The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
var myLayout = objDoc.Application.SmartArtLayouts; var smartArtShape = objDoc.Shapes.AddSmartArt(myLayout, 50, 50, 200, 200); Microsoft.Office.Core.MsoSegmentType msoSegment = Microsoft.Office.Core.MsoSegmentType.msoSegmentLine; Microsoft.Office.Core.MsoEditingType msoEditingType = Microsoft.Office.Core.MsoEditingType.msoEditingAuto; smartArtShape.Nodes.Insert(0, msoSegment, msoEditingType, 50, 50);
User contributions licensed under CC BY-SA 3.0