1
こんにちは現在、私はopen xmlを使って画像を自分のワード文書に追加しました。画像にハイパーリンクを追加する必要があります。だから、誰かが文書内の画像をクリックすると、特定のWeb URLに移動します。どのように私はこれを達成することができます。誰か助けてください。画像コードの追加は以下に追加されています。Open xml文書の画像付きハイパーリンクを追加
var run1 = new Run();
var picture1 = new Picture();
var shape1 = new Shape() { Id = "_x0000_i1025" + x};
string rId = "rId" + x ;
var imageData1 = new ImageData() { RelationshipId = rId };
shape1.Append(imageData1);
picture1.Append(shape1);
run1.Append(picture1);
mainPart.AddExternalRelationship("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
new System.Uri(matchString, System.UriKind.RelativeOrAbsolute), rId);
DocumentFormat.OpenXml.Wordprocessing.TableRow tr1 = new DocumentFormat.OpenXml.Wordprocessing.TableRow();
DocumentFormat.OpenXml.Wordprocessing.TableCell Name1 = new DocumentFormat.OpenXml.Wordprocessing.TableCell(new Paragraph(new Run(new Text(item.FirstName))));
DocumentFormat.OpenXml.Wordprocessing.TableCell Message1 = new DocumentFormat.OpenXml.Wordprocessing.TableCell(new Paragraph(run1));
DocumentFormat.OpenXml.Wordprocessing.TableCell Time1 = new DocumentFormat.OpenXml.Wordprocessing.TableCell(new Paragraph(new Run(new Text(item.CreatedDate))));
tr1.Append(Name1, Message1, Time1);
table.AppendChild(tr1);
x++;
の可能性のある重複した[オープンXMLを使用してDOCX Wordにハイパーリンクを追加する方法?](http://stackoverflow.com/questions/16085754/how-to-add-hyperlinks-into-word-docx-using -open-xml) – lokusking