Sharepoint文档库的word文档项中的OpenXmlUnknownElement问题 [英] OpenXmlUnknownElement issue in word document item of sharepoint document library

查看:131
本文介绍了Sharepoint文档库的word文档项中的OpenXmlUnknownElement问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在Sharepoint客户端DLL和OpenXML.dll(2.5)的帮助下开发了一个控制台应用程序。在这个应用程序中,我试图首先删除一个表(文档的最后一个表)然后实际创建一个表并在word文档的末尾添加此表。但是当我在Open XML SDK 2.5生产力工具中打开文档完成操作后,它显示了OpenXmlUnknownElement。下面是行

OpenXmlUnknownElement openXmlUnknownElement1 = OpenXmlUnknownElement.CreateOpenXmlUnknownElement(< w:tbl xmlns:w =\http:=schemas.openxmlformats.org =wordprocessingml = 2006 =main \=>< w:tblpr>< w:tblw w:w =\10030 \=w:type =\dxa \=>< w:tblcellspacing w:w =\36 \=w:type =\dxa \=>< w:tblind w:w =\435 \=w:type =\dxa \=>< w:tbllayout w:type =\ fixed \=>< w:tblcellmar>< w:left w:w =\115 \=w:type =\dxa \ =>< w:右w:w =\115 \=w:type =\dxa \=>< w:tbllook w :val =\01e0 \=>< w:tblgrid>< w:gridcol w:w =\2186 \=>< w: gridcol w:w =\7844 \=>< w:tr w:rsidr =\000110da \=w:rsidtr =\00aa570b \\ \\=w14:paraid =\501bf0ef \=w14:textid = \77777777 \=xmlns:w14 =\http:=schemas.microsoft.com =office =word =2010 =wordml \= >< w:trpr>< w:tblcellspacing w:w =\36 \=w:type =\dxa \=>< ; w:tc>< w:tcpr>< w:tcw w:w =\2078 \=w:type =\dxa \=> < w:tcborders>< w:top w:val =\single \=w:color =\c0c0c0 \=w:sz =\ 2 \=w:space =\0 \=>< w:left w:val =\single \=w: color =\c0c0c0 \=w:sz =\2 \=w:space =\0 \=>< w:bottom w:val =\single \=w:color =\c0c0c0 \=w:sz =\2 \= w:space =\0 \=>< w:右w:val =\single \=w:color =\c0c0c0 \\ \\=w:sz =\2 \=w:space =\0 \=>< w:shd w:val = \clear \=w:color =\auto \=w:fill =\>< w: valign w:val =\center \=>< w:pw:rsidrpr =\008e0e2e \\=w:rsidr =\000110da \ =w:rsidp =\00aa570b \=w:rsidrdefault =\w14:paraid =\0356805a \=w14:textid = \77777777 \=>< w:ppr>< w:jc w:val =\right \=>< w:rpr>< w:b>< w:rw:rsidrpr =\008e0e2e \=>< w:rpr>< w:b>< w:t>员工评论:< w :bookmarkstart w:name =\_goback \=w:displacedbycustomxml =\next \=w:id =\0 \= >< w:bookmarkend w:displacedbycustomxml =\next \=w:id =\0 \=>< w:sdt>< w :sdtpr>< w:text w:multiline =\true \=>< w:sdtcontent>< w:tc>< w:tcpr>< w:tcw w :w =\7736 \=w:type =\dxa \=>< w:tcborders>< w:top w:val =\\ \\single \=w:color =\c0c0c0 \=w:sz =\2 \ =w:space =\0 \=>< w:left w:val =\single \=w:color =\\ \\c0c0c0 \=w:sz =\2 \=w:space =\0 \=>< w:bottom w :val =\single \=w:color =\c0c0c0 \=w:sz =\2 \=w:空格=\0 \=>< w:右w:val =\single \=w:color =\c0c0c0 \= w:sz =\2 \=w:space =\0 \=>< w:shd w:val =\清除\=w:color =\auto \=w:fill =\eaf1dd \=>< w:valign w:val = \center \=>< w:pw:rsidr =\000110da \=w:rsidp =\00ee0340 \= w:rsidrdefault =\00ce7b7b \=w14:paraid =\2886a2b0 \=w14:textid =\0aa781c0 \=> < w:r>< w:t>由nabhendu测试< w:r>< w:br>< w:permend w:id =\1680364608 \=> );

我也附上了我的代码块。



Body bd = doc.MainDocumentPart.Document.Body;

DocumentFormat.OpenXml.Wordprocessing.Table table = doc.MainDocumentPart.Document.Body。元素< documentformat.openxml.wordprocessing.table>()。Last();

table.RemoveAllChildren();



doc.MainDocumentPart .Document.Body.Elements< documentformat.openxml.wordprocessing.table>()。Last()。Append(CreateEmployeeCommentMetaTag(table));



段落第51段=新段落(){RsidParagraphAddition =00C207B3,RsidParagraphProperties =00C207B3,RsidRunAdditionDefault =00C207B3,ParagraphId =103C3DDD,TextId =77777777};



ParagraphProperties paragraphProperties41 = new ParagraphProperties();

ParagraphStyleId paragraphStyleId10 = new ParagraphStyleId(){Val =Heading3};

SpacingBetweenLines spacingBetweenLines3 = new SpacingBetweenLines(){Before =0};



ParagraphMarkRunProperties paragraphMarkRunProperties37 = new ParagraphMarkRunProperties();

FontSize fontSize62 = new FontSize(){Val =24};

FontSizeComplexScript fontSizeComplexScript70 = new FontSizeComplexScript(){Val =22};



paragraphMarkRunProperties37.Append(fontSize62);

paragraphMarkRunProperties37.Append(fontSizeComplexScript70);



paragraphProperties41.Append(paragraphStyleId10);

paragraphProperties41.Append(spacingBetweenLines3);

paragraphProperties41.Append(paragraphMarkRunProperties37);



paragraph51.Append(paragraphProperties41); < br $>


第52段=新段落(){RsidParagraphMarkRevisi on =00C207B3,RsidParagraphAddition =00DA659F,RsidParagraphProperties =00C207B3,RsidRunAdditionDefault =00E1588B,ParagraphId =103C3DDE,TextId =77777777};



ParagraphProperties paragraphProperties42 = new ParagraphProperties();

ParagraphStyleId paragraphStyleId11 = new ParagraphStyleId(){Val =Heading3};

SpacingBetweenLines spacingBetweenLines4 = new SpacingBetweenLines(){之前=0};



ParagraphMarkRunProperties paragraphMarkRunProperties38 = new ParagraphMarkRunProperties();

FontSize fontSize63 = new FontSize(){Val = 24};

FontSizeComplexScript fontSizeComplexScript71 = new FontSizeComplexScript(){Val =20};



paragraphMarkRunProperties38.Append(fontSize63);

paragraphMarkRunProperties38.Append(fontSizeComplexScript71);



paragraphProperties42.Append(paragraphStyleId11);

paragraphProperties42.Append(spacingBetweenLines4);

paragraphProperties42.Append(paragraphMarkRunProperties38);



运行run120 = new Run(){RsidRunProperties =00C207B3};



RunProperties runProperties87 = new RunProperties();

FontSize fontSize64 = new FontSize(){Val =24};

FontSizeComplexScript fontSizeComplexScript72 = new FontSizeComplexScript(){Val =20};



runProperties87.Append(fontSize64);

runProperties87.Append(fontSizeComplexScript72);

Text text118 = new Text();

text118.Text =其他评论(可选);



run120.Append(runProperties87);

run120 .Append(text118);



运行run121 = new Run(){RsidRunProperties =00C207B3,RsidRunAddition =00DA659F};



RunProperties runProperties88 = new RunProperties();

FontSize fontSize65 = new FontSize(){Val =24};

FontSizeComplexScript fontSizeComplexScript73 = new FontSizeComplexScript(){Val =20};



runProperties88.Append(fontSize65);

runProperties88.Append(fontSizeComplexScript73);

Text text119 = new Text();

text119.Text =:;



run121.Append(runProperties88);

run121.Append(text119 );



第52段.Append(paragraphProperties42);

第52段.Append(run120);

第52段。追加(run121);



第53段=新段落(){RsidParag raphAddition =00F17E7E,RsidParagraphProperties =00DA659F,RsidRunAdditionDefault =00F17E7E,ParagraphId =170A3E91,TextId =14C679B7};

BookmarkStart bookmarkStart1 = new BookmarkStart(){Name = _GoBack,Id =0};

BookmarkEnd bookmarkEnd1 = new BookmarkEnd(){Id =0};



第53段.Append(bookmarkStart1);

paragraph53.Append(bookmarkEnd1);

表table7 = new Table();



TableProperties tableProperties7 = new TableProperties();

TableStyle tableStyle2 = new TableStyle(){Val =TableGrid};

TablePositionProperties tablePositionProperties2 = new TablePositionProperties(){ LeftFromText = 180,RightFromText = 180,VerticalAnchor = VerticalAnchorValues.Text,Horizo​​ntalAnchor = Horizo​​ntalAnchorValues.Margin,TablePositionY = 214};

TableWidth ta bleWidth7 = new TableWidth(){Width =0,Type = TableWidthUnitValues.Auto};

着色shading21 = new Shading(){Val = ShadingPatternValues.Solid,Color =auto,Fill = 8DB3E2,ThemeFill = ThemeColorValues.Text2,ThemeFillTint =66};

TableLayout tableLayout6 = new TableLayout(){Type = TableLayoutValues.Fixed};

TableLook tableLook7 = new TableLook(){Val =04A0};



tableProperties7.Append(tableStyle2);

tableProperties7.Append(tablePositionProperties2) ;

tableProperties7.Append(tableWidth7);

tableProperties7.Append(shading21);

tableProperties7.Append(tableLayout6);

tableProperties7.Append(tableLook7);



TableGrid tableGrid7 = new TableGrid();

GridColumn gridColumn14 = new GridColumn() {宽度=10296};



tableGrid7.Append(gridColumn14);



TableRow tableRow9 = new TableRow(){RsidTableRowMarkRevision = 0063050C,RsidTableRowAddition =00F17E7E,RsidTableRowProperties =00315155,ParagraphId =3788A34B,TextId =77777777};



TableCell tableCell19 = new TableCell( ); $



TableCellProperties tableCellProperties19 = new TableCellProperties();

TableCellWidth tableCellWidth19 = new TableCellWidth(){Width =10296,Type = TableWidthUnitValues.Dxa};

着色着色22 =新着色(){Val = ShadingPatternValues.Clear,Color =auto,Fill =8DB3E2,ThemeFill = ThemeColorValues.Text2,ThemeFillTint =66 };



tableCellProperties19.Append(tableCellWidth19);

tableCellProperties19.Append(shading22);



段落paragr aph54 = new Paragraph(){RsidParagraphMarkRevision =0063050C,RsidParagraphAddition =00F17E7E,RsidParagraphProperties =00F17E7E,RsidRunAdditionDefault =00F17E7E,ParagraphId =555BA2FD,TextId =4BAB9469};



ParagraphProperties paragraphProperties43 = new ParagraphProperties();



ParagraphMarkRunProperties paragraphMarkRunProperties39 = new ParagraphMarkRunProperties();

粗体bold83 = new Bold();

BoldComplexScript boldComplexScript78 = new BoldComplexScript();

FontSize fontSize66 = new FontSize(){Val =22};

FontSizeComplexScript fontSizeComplexScript74 = new FontSizeComplexScript(){Val =20};



paragraphMarkRunProperties39.Append(bold83);

paragraphMarkRunProperties39.Append(boldComplexScript78);

paragraphMarkRunProperties39。追加(fontSize66);

paragraphMarkRunProperties39.Append(fontSizeComplexScript74);



paragraphProperties43.Append(paragraphMarkRunProperties39);



运行run122 = new Run(){RsidRunProperties =008E0E2E};



RunProperties runProperties89 = new RunProperties();

Bold bold84 = new Bold();



runProperties89.Append(bold84);

Text text120 = new Text ();

text120.Text =员工评论:;



run122.Append(runProperties89);

run122.Append(text120);



运行run123 = new Run();



RunProperties runProperties90 = new RunProperties();

Bold bold85 = new Bold();



runProperties90.Append(bold85);

文本text121 = new Text(){Space = SpaceProcessingModeValues.Preserve};

text121.Text =;



run123.Append( runProperties90);

run123.Append(text121);



运行run124 = new Run();



RunProperties runProperties91 = new RunProperties();

Color color3 = new Color(){Val =808080,ThemeColor = ThemeColorValues.Background1,ThemeShade =80} ;



runProperties91.Append(color3);

Text text122 = new Text(){Space = SpaceProcessingModeValues.Preserve};

text122.Text =;



run124.Append(runProperties91);

run124.Append(text122);



运行run125 = new运行();

文本text123 = new Text(){Space = SpaceProcessingModeValues.Preserve};

text123.Text =;



run125.Append(text123);



SdtRun sdtRun3 = new SdtRun();



SdtProperties sdtProperties7 = new SdtProperties();

SdtAlias sdtAlias6 = new SdtAlias(){Val = EmployeeComments};

Tag tag6 = new Tag(){Val =EmployeeComments};

SdtId sdtId7 = new SdtId(){Val = 1825780944};

锁定lock7 = new Lock(){Val = LockingValues.SdtContentLocked};

ShowingPlaceholder showsPlaceholder3 = new ShowingPlaceholder();

// DataBinding dataBinding7 = new DataBinding(){PrefixMappings =xmlns:ns0 = \'http://schemas.microsoft.com/office/2006/metadata/properties\'xmlns:ns1 = \'http://www.w3 .org / 2001 / XMLSchema-instance \'xmlns:ns2 = \'$ ListId:BackupDocuments; \'xmlns:ns3 = \'3938b449-2e68- 4216-9dc4-c08645db9ef5 \'xmlns:ns4 = \'5372bb52-7a60-4bd4-a3af-476b3cc6b985 \'xmlns:ns5 = \'682afeaa-49b3-4d3c-a7fe-099dfe46c58d \'xmlns:ns6 = \'12e95924-d241-4538-b351-919a55fa0c8a \',XPath =/ ns0:properties [1] / documentManagement [1] / ns5:EmployeeComments [1],StoreItemId ={3353F0FD-49CA-4627 -9B69-CF6589E6B26C}};

DataBinding dataBinding7 = new DataBinding(){PrefixMappings =xmlns:ns0 = \'http://schemas.microsoft.com/office/2006/metadata/ properties \'xmlns:ns1 = \'http://www.w3.org/2001/XMLSchema-instance\'xmlns:ns2 = \'$ ListId:BackupDocuments; \'xmlns:ns3 = \ '3938b449-2e68-4216-9dc4-c08645db9ef5 \'xmlns:ns4 = \'5372fb52-7a60-4bd4-a3af-476b3cc6b985 \'xmlns:ns5 = \'682afeaa-49b3-4d3c-a7fe-099dfe46c58d \ 'xmlns:ns6 = \'12e95924-d241-4538-b351-919a55fa0c8a \',XPath =/ ns0:properties [1] / documentManagement [1] / ns6:EmployeeComments [1] ,StoreItemId ={3353F0FD-49CA-4627-9B69-CF6589E6B26C}};

SdtContentText sdtContentText7 = new SdtContentText(){MultiLine = true};



sdtProperties7.Append(sdtAlias6);

sdtProperties7.Append(tag6);

sdtProperties7.Append(sdtId7);

sdtProperties7.Append(lock7);

sdtProperties7.Append(shownPlaceholder3);

sdtProperties7.Append(dataBinding7);

sdtProperties7.Append( sdtContentText7);

SdtEndCharProperties sdtEndCharProperties7 = new SdtEndCharProperties();



SdtContentRun sdtContentRun3 = new SdtContentRun();



运行run126 = new Run(){RsidRunProperties =00E1233A,RsidRunAddition =003A1325};



RunProperties runProperties92 = new RunProperties();

RunS tyle runStyle4 = new RunStyle(){Val =PlaceholderText};



runProperties92.Append(runStyle4);

Text text124 = new文字();

text124.Text =[自动填充];



run126.Append(runProperties92);

run126.Append(text124);



sdtContentRun3.Append(run126);



sdtRun3.Append(sdtProperties7);

sdtRun3.Append(sdtEndCharProperties7);

sdtRun3.Append(sdtContentRun3);



paragraph54.Append(paragraphProperties43);

paragraph54.Append(run122);

paragraph54.Append(run123);

paragraph54。追加(run124);

paragraph54.Append(run125);

paragraph54.Append(sdtRun3);



tableCell19.Append( tableCellProperties19);

tableCell19.Append(第54段);



tableRow9.Append(tableCell19);



table7.Append(tableProperties7);

table7.Append(tableGrid7);

table7.Append(tableRow9);



返回table7;



有谁可以帮我解决这个问题?

Hi,
I have developed one console application by the help of Sharepoint client DLL and OpenXML.dll (2.5). In this application I am trying to first delete one table (Last table of the document) then pragmatically creating one table and adding this table at the end of the word document. But after completing the operation when I am opening the document in Open XML SDK 2.5 productivity tool it is showing the OpenXmlUnknownElement . below is the line
OpenXmlUnknownElement openXmlUnknownElement1 = OpenXmlUnknownElement.CreateOpenXmlUnknownElement("<w:tbl xmlns:w="\" http:="" schemas.openxmlformats.org="" wordprocessingml="" 2006="" main\""=""><w:tblpr><w:tblw w:w="\" 10030\""="" w:type="\" dxa\""=""><w:tblcellspacing w:w="\" 36\""="" w:type="\" dxa\""=""><w:tblind w:w="\" 435\""="" w:type="\" dxa\""=""><w:tbllayout w:type="\" fixed\""=""><w:tblcellmar><w:left w:w="\" 115\""="" w:type="\" dxa\""=""><w:right w:w="\" 115\""="" w:type="\" dxa\""=""><w:tbllook w:val="\" 01e0\""=""><w:tblgrid><w:gridcol w:w="\" 2186\""=""><w:gridcol w:w="\" 7844\""=""><w:tr w:rsidr="\" 000110da\""="" w:rsidtr="\" 00aa570b\""="" w14:paraid="\" 501bf0ef\""="" w14:textid="\" 77777777\""="" xmlns:w14="\" http:="" schemas.microsoft.com="" office="" word="" 2010="" wordml\""=""><w:trpr><w:tblcellspacing w:w="\" 36\""="" w:type="\" dxa\""=""><w:tc><w:tcpr><w:tcw w:w="\" 2078\""="" w:type="\" dxa\""=""><w:tcborders><w:top w:val="\" single\""="" w:color="\" c0c0c0\""="" w:sz="\" 2\""="" w:space="\" 0\""=""><w:left w:val="\" single\""="" w:color="\" c0c0c0\""="" w:sz="\" 2\""="" w:space="\" 0\""=""><w:bottom w:val="\" single\""="" w:color="\" c0c0c0\""="" w:sz="\" 2\""="" w:space="\" 0\""=""><w:right w:val="\" single\""="" w:color="\" c0c0c0\""="" w:sz="\" 2\""="" w:space="\" 0\""=""><w:shd w:val="\" clear\""="" w:color="\" auto\""="" w:fill="\"><w:valign w:val="\" center\""=""><w:p w:rsidrpr="\" 008e0e2e\""="" w:rsidr="\" 000110da\""="" w:rsidp="\" 00aa570b\""="" w:rsidrdefault="\" w14:paraid="\" 0356805a\""="" w14:textid="\" 77777777\""=""><w:ppr><w:jc w:val="\" right\""=""><w:rpr><w:b><w:r w:rsidrpr="\" 008e0e2e\""=""><w:rpr><w:b><w:t>Employee Comments:<w:bookmarkstart w:name="\" _goback\""="" w:displacedbycustomxml="\" next\""="" w:id="\" 0\""=""><w:bookmarkend w:displacedbycustomxml="\" next\""="" w:id="\" 0\""=""><w:sdt><w:sdtpr><w:text w:multiline="\" true\""=""><w:sdtcontent><w:tc><w:tcpr><w:tcw w:w="\" 7736\""="" w:type="\" dxa\""=""><w:tcborders><w:top w:val="\" single\""="" w:color="\" c0c0c0\""="" w:sz="\" 2\""="" w:space="\" 0\""=""><w:left w:val="\" single\""="" w:color="\" c0c0c0\""="" w:sz="\" 2\""="" w:space="\" 0\""=""><w:bottom w:val="\" single\""="" w:color="\" c0c0c0\""="" w:sz="\" 2\""="" w:space="\" 0\""=""><w:right w:val="\" single\""="" w:color="\" c0c0c0\""="" w:sz="\" 2\""="" w:space="\" 0\""=""><w:shd w:val="\" clear\""="" w:color="\" auto\""="" w:fill="\" eaf1dd\""=""><w:valign w:val="\" center\""=""><w:p w:rsidr="\" 000110da\""="" w:rsidp="\" 00ee0340\""="" w:rsidrdefault="\" 00ce7b7b\""="" w14:paraid="\" 2886a2b0\""="" w14:textid="\" 0aa781c0\""=""><w:r><w:t>Test by nabhendu<w:r><w:br><w:permend w:id="\" 1680364608\""="">");
I have attached the my code block also.

Body bd = doc.MainDocumentPart.Document.Body;
DocumentFormat.OpenXml.Wordprocessing.Table table = doc.MainDocumentPart.Document.Body.Elements<documentformat.openxml.wordprocessing.table>().Last();
table.RemoveAllChildren();

doc.MainDocumentPart.Document.Body.Elements<documentformat.openxml.wordprocessing.table>().Last().Append(CreateEmployeeCommentMetaTag(table));

Paragraph paragraph51 = new Paragraph() { RsidParagraphAddition = "00C207B3", RsidParagraphProperties = "00C207B3", RsidRunAdditionDefault = "00C207B3", ParagraphId = "103C3DDD", TextId = "77777777" };

ParagraphProperties paragraphProperties41 = new ParagraphProperties();
ParagraphStyleId paragraphStyleId10 = new ParagraphStyleId() { Val = "Heading3" };
SpacingBetweenLines spacingBetweenLines3 = new SpacingBetweenLines() { Before = "0" };

ParagraphMarkRunProperties paragraphMarkRunProperties37 = new ParagraphMarkRunProperties();
FontSize fontSize62 = new FontSize() { Val = "24" };
FontSizeComplexScript fontSizeComplexScript70 = new FontSizeComplexScript() { Val = "22" };

paragraphMarkRunProperties37.Append(fontSize62);
paragraphMarkRunProperties37.Append(fontSizeComplexScript70);

paragraphProperties41.Append(paragraphStyleId10);
paragraphProperties41.Append(spacingBetweenLines3);
paragraphProperties41.Append(paragraphMarkRunProperties37);

paragraph51.Append(paragraphProperties41);

Paragraph paragraph52 = new Paragraph() { RsidParagraphMarkRevision = "00C207B3", RsidParagraphAddition = "00DA659F", RsidParagraphProperties = "00C207B3", RsidRunAdditionDefault = "00E1588B", ParagraphId = "103C3DDE", TextId = "77777777" };

ParagraphProperties paragraphProperties42 = new ParagraphProperties();
ParagraphStyleId paragraphStyleId11 = new ParagraphStyleId() { Val = "Heading3" };
SpacingBetweenLines spacingBetweenLines4 = new SpacingBetweenLines() { Before = "0" };

ParagraphMarkRunProperties paragraphMarkRunProperties38 = new ParagraphMarkRunProperties();
FontSize fontSize63 = new FontSize() { Val = "24" };
FontSizeComplexScript fontSizeComplexScript71 = new FontSizeComplexScript() { Val = "20" };

paragraphMarkRunProperties38.Append(fontSize63);
paragraphMarkRunProperties38.Append(fontSizeComplexScript71);

paragraphProperties42.Append(paragraphStyleId11);
paragraphProperties42.Append(spacingBetweenLines4);
paragraphProperties42.Append(paragraphMarkRunProperties38);

Run run120 = new Run() { RsidRunProperties = "00C207B3" };

RunProperties runProperties87 = new RunProperties();
FontSize fontSize64 = new FontSize() { Val = "24" };
FontSizeComplexScript fontSizeComplexScript72 = new FontSizeComplexScript() { Val = "20" };

runProperties87.Append(fontSize64);
runProperties87.Append(fontSizeComplexScript72);
Text text118 = new Text();
text118.Text = "Additional Comments (optional)";

run120.Append(runProperties87);
run120.Append(text118);

Run run121 = new Run() { RsidRunProperties = "00C207B3", RsidRunAddition = "00DA659F" };

RunProperties runProperties88 = new RunProperties();
FontSize fontSize65 = new FontSize() { Val = "24" };
FontSizeComplexScript fontSizeComplexScript73 = new FontSizeComplexScript() { Val = "20" };

runProperties88.Append(fontSize65);
runProperties88.Append(fontSizeComplexScript73);
Text text119 = new Text();
text119.Text = ":";

run121.Append(runProperties88);
run121.Append(text119);

paragraph52.Append(paragraphProperties42);
paragraph52.Append(run120);
paragraph52.Append(run121);

Paragraph paragraph53 = new Paragraph() { RsidParagraphAddition = "00F17E7E", RsidParagraphProperties = "00DA659F", RsidRunAdditionDefault = "00F17E7E", ParagraphId = "170A3E91", TextId = "14C679B7" };
BookmarkStart bookmarkStart1 = new BookmarkStart() { Name = "_GoBack", Id = "0" };
BookmarkEnd bookmarkEnd1 = new BookmarkEnd() { Id = "0" };

paragraph53.Append(bookmarkStart1);
paragraph53.Append(bookmarkEnd1);
Table table7 = new Table();

TableProperties tableProperties7 = new TableProperties();
TableStyle tableStyle2 = new TableStyle() { Val = "TableGrid" };
TablePositionProperties tablePositionProperties2 = new TablePositionProperties() { LeftFromText = 180, RightFromText = 180, VerticalAnchor = VerticalAnchorValues.Text, HorizontalAnchor = HorizontalAnchorValues.Margin, TablePositionY = 214 };
TableWidth tableWidth7 = new TableWidth() { Width = "0", Type = TableWidthUnitValues.Auto };
Shading shading21 = new Shading() { Val = ShadingPatternValues.Solid, Color = "auto", Fill = "8DB3E2", ThemeFill = ThemeColorValues.Text2, ThemeFillTint = "66" };
TableLayout tableLayout6 = new TableLayout() { Type = TableLayoutValues.Fixed };
TableLook tableLook7 = new TableLook() { Val = "04A0" };

tableProperties7.Append(tableStyle2);
tableProperties7.Append(tablePositionProperties2);
tableProperties7.Append(tableWidth7);
tableProperties7.Append(shading21);
tableProperties7.Append(tableLayout6);
tableProperties7.Append(tableLook7);

TableGrid tableGrid7 = new TableGrid();
GridColumn gridColumn14 = new GridColumn() { Width = "10296" };

tableGrid7.Append(gridColumn14);

TableRow tableRow9 = new TableRow() { RsidTableRowMarkRevision = "0063050C", RsidTableRowAddition = "00F17E7E", RsidTableRowProperties = "00315155", ParagraphId = "3788A34B", TextId = "77777777" };

TableCell tableCell19 = new TableCell();

TableCellProperties tableCellProperties19 = new TableCellProperties();
TableCellWidth tableCellWidth19 = new TableCellWidth() { Width = "10296", Type = TableWidthUnitValues.Dxa };
Shading shading22 = new Shading() { Val = ShadingPatternValues.Clear, Color = "auto", Fill = "8DB3E2", ThemeFill = ThemeColorValues.Text2, ThemeFillTint = "66" };

tableCellProperties19.Append(tableCellWidth19);
tableCellProperties19.Append(shading22);

Paragraph paragraph54 = new Paragraph() { RsidParagraphMarkRevision = "0063050C", RsidParagraphAddition = "00F17E7E", RsidParagraphProperties = "00F17E7E", RsidRunAdditionDefault = "00F17E7E", ParagraphId = "555BA2FD", TextId = "4BAB9469" };

ParagraphProperties paragraphProperties43 = new ParagraphProperties();

ParagraphMarkRunProperties paragraphMarkRunProperties39 = new ParagraphMarkRunProperties();
Bold bold83 = new Bold();
BoldComplexScript boldComplexScript78 = new BoldComplexScript();
FontSize fontSize66 = new FontSize() { Val = "22" };
FontSizeComplexScript fontSizeComplexScript74 = new FontSizeComplexScript() { Val = "20" };

paragraphMarkRunProperties39.Append(bold83);
paragraphMarkRunProperties39.Append(boldComplexScript78);
paragraphMarkRunProperties39.Append(fontSize66);
paragraphMarkRunProperties39.Append(fontSizeComplexScript74);

paragraphProperties43.Append(paragraphMarkRunProperties39);

Run run122 = new Run() { RsidRunProperties = "008E0E2E" };

RunProperties runProperties89 = new RunProperties();
Bold bold84 = new Bold();

runProperties89.Append(bold84);
Text text120 = new Text();
text120.Text = "Employee Comments:";

run122.Append(runProperties89);
run122.Append(text120);

Run run123 = new Run();

RunProperties runProperties90 = new RunProperties();
Bold bold85 = new Bold();

runProperties90.Append(bold85);
Text text121 = new Text() { Space = SpaceProcessingModeValues.Preserve };
text121.Text = " ";

run123.Append(runProperties90);
run123.Append(text121);

Run run124 = new Run();

RunProperties runProperties91 = new RunProperties();
Color color3 = new Color() { Val = "808080", ThemeColor = ThemeColorValues.Background1, ThemeShade = "80" };

runProperties91.Append(color3);
Text text122 = new Text() { Space = SpaceProcessingModeValues.Preserve };
text122.Text = " ";

run124.Append(runProperties91);
run124.Append(text122);

Run run125 = new Run();
Text text123 = new Text() { Space = SpaceProcessingModeValues.Preserve };
text123.Text = " ";

run125.Append(text123);

SdtRun sdtRun3 = new SdtRun();

SdtProperties sdtProperties7 = new SdtProperties();
SdtAlias sdtAlias6 = new SdtAlias() { Val = "EmployeeComments" };
Tag tag6 = new Tag() { Val = "EmployeeComments" };
SdtId sdtId7 = new SdtId() { Val = 1825780944 };
Lock lock7 = new Lock() { Val = LockingValues.SdtContentLocked };
ShowingPlaceholder showingPlaceholder3 = new ShowingPlaceholder();
//DataBinding dataBinding7 = new DataBinding() { PrefixMappings = "xmlns:ns0=\'http://schemas.microsoft.com/office/2006/metadata/properties\' xmlns:ns1=\'http://www.w3.org/2001/XMLSchema-instance\' xmlns:ns2=\'$ListId:BackupDocuments;\' xmlns:ns3=\'3938b449-2e68-4216-9dc4-c08645db9ef5\' xmlns:ns4=\'5372fb52-7a60-4bd4-a3af-476b3cc6b985\' xmlns:ns5=\'682afeaa-49b3-4d3c-a7fe-099dfe46c58d\' xmlns:ns6=\'12e95924-d241-4538-b351-919a55fa0c8a\' ", XPath = "/ns0:properties[1]/documentManagement[1]/ns5:EmployeeComments[1]", StoreItemId = "{3353F0FD-49CA-4627-9B69-CF6589E6B26C}" };
DataBinding dataBinding7 = new DataBinding() { PrefixMappings = "xmlns:ns0=\'http://schemas.microsoft.com/office/2006/metadata/properties\' xmlns:ns1=\'http://www.w3.org/2001/XMLSchema-instance\' xmlns:ns2=\'$ListId:BackupDocuments;\' xmlns:ns3=\'3938b449-2e68-4216-9dc4-c08645db9ef5\' xmlns:ns4=\'5372fb52-7a60-4bd4-a3af-476b3cc6b985\' xmlns:ns5=\'682afeaa-49b3-4d3c-a7fe-099dfe46c58d\' xmlns:ns6=\'12e95924-d241-4538-b351-919a55fa0c8a\' ", XPath = "/ns0:properties[1]/documentManagement[1]/ns6:EmployeeComments[1]", StoreItemId = "{3353F0FD-49CA-4627-9B69-CF6589E6B26C}" };
SdtContentText sdtContentText7 = new SdtContentText() { MultiLine = true };

sdtProperties7.Append(sdtAlias6);
sdtProperties7.Append(tag6);
sdtProperties7.Append(sdtId7);
sdtProperties7.Append(lock7);
sdtProperties7.Append(showingPlaceholder3);
sdtProperties7.Append(dataBinding7);
sdtProperties7.Append(sdtContentText7);
SdtEndCharProperties sdtEndCharProperties7 = new SdtEndCharProperties();

SdtContentRun sdtContentRun3 = new SdtContentRun();

Run run126 = new Run() { RsidRunProperties = "00E1233A", RsidRunAddition = "003A1325" };

RunProperties runProperties92 = new RunProperties();
RunStyle runStyle4 = new RunStyle() { Val = "PlaceholderText" };

runProperties92.Append(runStyle4);
Text text124 = new Text();
text124.Text = "[Automatically populated]";

run126.Append(runProperties92);
run126.Append(text124);

sdtContentRun3.Append(run126);

sdtRun3.Append(sdtProperties7);
sdtRun3.Append(sdtEndCharProperties7);
sdtRun3.Append(sdtContentRun3);

paragraph54.Append(paragraphProperties43);
paragraph54.Append(run122);
paragraph54.Append(run123);
paragraph54.Append(run124);
paragraph54.Append(run125);
paragraph54.Append(sdtRun3);

tableCell19.Append(tableCellProperties19);
tableCell19.Append(paragraph54);

tableRow9.Append(tableCell19);

table7.Append(tableProperties7);
table7.Append(tableGrid7);
table7.Append(tableRow9);

return table7;

Can anyone please help me for resolving this issue?

推荐答案

ListId:BackupDocuments; \'xmlns:ns3 = \'3938b449-2e68-4216-9dc4-c08645db9ef5 \'xmlns:ns4 = \'5372fb52-7a60-4bd4-a3af-476b3cc6b985 \ 'xmlns:ns5 = \'682afeaa-49b3-4d3c-a7fe-099dfe46c58d \'xmlns:ns6 = \'12e95924-d241-4538-b351-919a55fa0c8a \',XPath =/ ns0:properties [1 ] / documentManagement [1] / ns5:EmployeeComments [1],StoreItemId ={3353F0FD-49CA-4627-9B69-CF6589E6B26C}};

DataBinding dataBinding7 = new DataBinding(){PrefixMappi ngs =xmlns:ns0 = \'http://schemas.microsoft.com/office/2006/metadata/properties\'xmlns:ns1 = \'http://www.w3.org/2001/XMLSchema -instance \'xmlns:ns2 = \'
ListId:BackupDocuments;\' xmlns:ns3=\'3938b449-2e68-4216-9dc4-c08645db9ef5\' xmlns:ns4=\'5372fb52-7a60-4bd4-a3af-476b3cc6b985\' xmlns:ns5=\'682afeaa-49b3-4d3c-a7fe-099dfe46c58d\' xmlns:ns6=\'12e95924-d241-4538-b351-919a55fa0c8a\' ", XPath = "/ns0:properties[1]/documentManagement[1]/ns5:EmployeeComments[1]", StoreItemId = "{3353F0FD-49CA-4627-9B69-CF6589E6B26C}" };
DataBinding dataBinding7 = new DataBinding() { PrefixMappings = "xmlns:ns0=\'http://schemas.microsoft.com/office/2006/metadata/properties\' xmlns:ns1=\'http://www.w3.org/2001/XMLSchema-instance\' xmlns:ns2=\'


ListId:BackupDocuments; \'xmlns:ns3 = \'3938b449-2e68-4216-9dc4-c08645db9ef5 \'xmlns :ns4 = \'5372fb52-7a60-4bd4-a3af-476b3cc6b985 \'xmlns:ns5 = \'682afeaa-49b3-4d3c-a7fe-099dfe46c58d \'xmlns:ns6 = \'12e95924-d241-4538- b351-919a55fa0c8a \',XPath =/ ns0:properties [1] / documentManagement [1] / ns6:EmployeeComments [1],StoreItemId ={3353F0FD-49CA-4627-9B69-CF6589E6B26C}};

SdtContentText sdtContentText7 = new SdtContentText(){MultiLine = true};



sdtProperties7.Append(sdtAlias6);

sdtProperties7.Append(tag6);

sdtProperties7.Append(sdtId7);

sdtProperties7.Append(lock7);

sdtPr operties7.Append(shownPlaceholder3);

sdtProperties7.Append(dataBinding7);

sdtProperties7.Append(sdtContentText7);

SdtEndCharProperties sdtEndCharProperties7 = new SdtEndCharProperties ();



SdtContentRun sdtContentRun3 = new SdtContentRun();



运行run126 = new Run() {RsidRunProperties =00E1233A,RsidRunAddition =003A1325};



RunProperties runProperties92 = new RunProperties();

RunStyle runStyle4 = new RunStyle(){Val =PlaceholderText};



runProperties92.Append(runStyle4);

Text text124 = new Text();

text124.Text =[自动填充];



run126.Append(runProperties92);

run126.Append(text124);



sdtContentRun3.Appe nd(run126);



sdtRun3.Append(sdtProperties7);

sdtRun3.Append(sdtEndCharProperties7);

sdtRun3.Append(sdtContentRun3);



paragraph54.Append(paragraphProperties43);

paragraph54.Append(run122);

paragraph54.Append(run123);

paragraph54.Append(run124);

paragraph54.Append(run125);

paragraph54 .Append(sdtRun3);



tableCell19.Append(tableCellProperties19);

tableCell19.Append(paragraph54);



tableRow9.Append(tableCell19);



table7.Append(tableProperties7);

table7。追加(tableGrid7);

table7.Append(tableRow9);



返回table7;



任何人都可以帮助我解决这个问题?
ListId:BackupDocuments;\' xmlns:ns3=\'3938b449-2e68-4216-9dc4-c08645db9ef5\' xmlns:ns4=\'5372fb52-7a60-4bd4-a3af-476b3cc6b985\' xmlns:ns5=\'682afeaa-49b3-4d3c-a7fe-099dfe46c58d\' xmlns:ns6=\'12e95924-d241-4538-b351-919a55fa0c8a\' ", XPath = "/ns0:properties[1]/documentManagement[1]/ns6:EmployeeComments[1]", StoreItemId = "{3353F0FD-49CA-4627-9B69-CF6589E6B26C}" };
SdtContentText sdtContentText7 = new SdtContentText() { MultiLine = true };

sdtProperties7.Append(sdtAlias6);
sdtProperties7.Append(tag6);
sdtProperties7.Append(sdtId7);
sdtProperties7.Append(lock7);
sdtProperties7.Append(showingPlaceholder3);
sdtProperties7.Append(dataBinding7);
sdtProperties7.Append(sdtContentText7);
SdtEndCharProperties sdtEndCharProperties7 = new SdtEndCharProperties();

SdtContentRun sdtContentRun3 = new SdtContentRun();

Run run126 = new Run() { RsidRunProperties = "00E1233A", RsidRunAddition = "003A1325" };

RunProperties runProperties92 = new RunProperties();
RunStyle runStyle4 = new RunStyle() { Val = "PlaceholderText" };

runProperties92.Append(runStyle4);
Text text124 = new Text();
text124.Text = "[Automatically populated]";

run126.Append(runProperties92);
run126.Append(text124);

sdtContentRun3.Append(run126);

sdtRun3.Append(sdtProperties7);
sdtRun3.Append(sdtEndCharProperties7);
sdtRun3.Append(sdtContentRun3);

paragraph54.Append(paragraphProperties43);
paragraph54.Append(run122);
paragraph54.Append(run123);
paragraph54.Append(run124);
paragraph54.Append(run125);
paragraph54.Append(sdtRun3);

tableCell19.Append(tableCellProperties19);
tableCell19.Append(paragraph54);

tableRow9.Append(tableCell19);

table7.Append(tableProperties7);
table7.Append(tableGrid7);
table7.Append(tableRow9);

return table7;

Can anyone please help me for resolving this issue?


这篇关于Sharepoint文档库的word文档项中的OpenXmlUnknownElement问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆