C#代码:
private void button1_Click(object sender, RibbonControlEventArgs e)
{
// PictureContentControl myPictureContentControl = null;
foreach (Microsoft.Office.Interop.Word.ContentControl c in Globals.ThisDocument.ContentControls)
{
if (c.Type == WdContentControlType.wdContentControlPicture && c.Tag == "tag1") // looking for the picture content control i want to update
{
c.Range.Select();
Dialog dialogBox = Globals.ThisDocument.Application.Dialogs[WdWordDialog.wdDialogInsertPicture];
dialogBox.Show();
}
}
}