current slide show comments
-
Sunday, August 05, 2012 10:25 PM
hi all, I share with all my application, I need a single detail.
The idea is that when I change my PowerPoint slide show me the comments slide in my current
works perfect in each slide just shows me the message 2 times andI need to display the message once.
any ideas?
public partial class ThisAddIn
I need it for powerpoint 2007
{
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
Application.SlideShowNextSlide +=new PowerPoint.EApplication_SlideShowNextSlideEventHandler(Application_SlideShowNextSlide);
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
void Application_SlideShowNextSlide(Microsoft.Office.Interop.PowerPoint.SlideShowWindow Wn)
{
Microsoft.Office.Interop.PowerPoint.Slide currentSlide = Wn.View.Slide;
foreach (PowerPoint.Comment comment in currentSlide.Comments)
{
MessageBox.Show(comment.Text);
}
}
}
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
#endregion
}
All Replies
-
Monday, August 06, 2012 3:04 PM
It would seem that the same text is present in two comments.
You could get around that by changing the loop to:
string lastComment = ""; foreach (PowerPoint.Comment comment in currentSlide.Comments) { if (comment.text != lastComment) MessageBox.Show(comment.Text); lastComment = comment.text }- Marked As Answer by Quist ZhangMicrosoft Contingent Staff, Moderator Thursday, August 16, 2012 10:14 AM

