コード例 #1
0
 public void Write(TextWriter writer)
 {
     writer.Write("<w:bookmarkStart w:id=\"");
     writer.Write(this._id);
     writer.Write("\" w:name=\"");
     writer.Write(OpenXmlBookmarkModel.CleanseBookmarkName(this._name));
     writer.Write("\"/><w:bookmarkEnd w:id=\"");
     writer.Write(this._id);
     writer.Write("\"/>");
 }
コード例 #2
0
 public void Write(TextWriter writer)
 {
     writer.Write("<w:r><w:fldChar w:fldCharType=\"begin\" w:fldLock=\"0\" w:dirty=\"0\"/></w:r><w:r><w:rPr><w:noProof/></w:rPr>");
     if (this._bookmarkLink)
     {
         writer.Write("<w:instrText xml:space=\"preserve\"> HYPERLINK \\l &quot;");
         writer.Write(OpenXmlBookmarkModel.CleanseBookmarkName(this._target));
     }
     else
     {
         writer.Write("<w:instrText xml:space=\"preserve\"> HYPERLINK &quot;");
         writer.Write(OpenXmlFieldGenerators.Escape(this._target));
     }
     writer.Write("&quot; </w:instrText></w:r><w:r><w:fldChar w:fldCharType=\"separate\" w:fldLock=\"0\" w:dirty=\"0\"/></w:r>");
 }
コード例 #3
0
        public static string CleanseBookmarkName(string name)
        {
            StringBuilder stringBuilder = OpenXmlBookmarkModel.EscapeBookmarkText(name);

            return(stringBuilder.ToString(0, Math.Min(40, stringBuilder.Length)));
        }