When I am adding a comment in Office 365 PowerPoint using Interop, it gives an error
> Comments (unknown member): Invalid value.
My code was working for a long time, but in the last few days after the release of the latest version(2310) of Microsoft Office 365, it is not working due to this error. Is there are some change in `Microsoft.Office.Interop.PowerPoint.Slide.Comments.Add()`?
try
{
Microsoft.Office.Interop.PowerPoint.Presentation doc = Globals.ThisAddIn.Application.ActivePresentation;
Microsoft.Office.Core.DocumentProperties properties = doc.BuiltInDocumentProperties as Microsoft.Office.Core.DocumentProperties;
Microsoft.Office.Interop.PowerPoint.TextRange rng = Globals.ThisAddIn.Application.ActiveWindow.Selection.TextRange;
Microsoft.Office.Interop.PowerPoint.Slide sld = Globals.ThisAddIn.Application.ActivePresentation.Slides[Globals.ThisAddIn.Application.ActiveWindow.Selection.SlideRange.SlideIndex];
string timestamp = System.DateTime.Now.ToString("yyyyMMddHHmmssFFF");
string commentText = timestamp + ":" + text + ": ";
string userName = System.Environment.GetEnvironmentVariable("UserName");
sld.Comments.Add(900, rng.BoundLeft, userName, "", commentText); // code break at this line
System.Windows.Forms.SendKeys.Send("{END}");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
sld.Comments.Add(900, rng.BoundLeft, userName, "", commentText);