openxml 상용 탭 및 노트

7112 단어 .NET
1. 상용 라벨

                                           

                                                                                       

               

                                                                                       

   
   


2. 흔적처리
1) 책갈피
 if (bookmark.Name == bookmarkDataVal.Key)
                        {
                            Run bookmarkText = bookmark.NextSibling();
                            if (bookmarkText != null)  // if the bookmark has text replace it
                            {
                                // RunProperties runProperties = new RunProperties(); //  
                                //Color color = new Color() { Val = "0000FF" };
                                //Underline underline = new Underline();
                                //underline.Val = UnderlineValues.Single;
                                //runProperties.Append(color);
                                //runProperties.Append(underline);
                                //   bookmarkText.RunProperties = runProperties;
                                //  bookmarkText.GetFirstChild().Text = bookmarkDataVal.Value;



                                Text text = new Text(bookmarkDataVal.Value);
                                RunProperties runProperties = new RunProperties(); //  
                                                                                   //Color color = new Color() { Val = "0000FF" };
                                                                                   //Underline underline = new Underline();
                                                                                   //Font font = new Font();
                                                                                   //  font.h
                                                                                   //   underline.Val = UnderlineValues.Single;
                                                                                   //  runProperties.Append(underline);
                                                                                   //   runProperties.Append(color);
                                                                                   //Run run = new Run(runProperties);
                                                                                   //run.Append(text);

                                //Inserted insert = new Inserted();
                                //insert.Id = Guid.NewGuid().ToString();

                                //insert.Author = new StringValue() { Value = "   222" };
                                //insert.Date = DateTime.Now;
                                //insert.AppendChild(text);

                                bookmarkText.GetFirstChild().Text = "";
                                InsertedRun insert = new InsertedRun(runProperties);
                                insert.Id = Guid.NewGuid().ToString();

                                insert.Author = new StringValue() { Value = "   222" };
                                insert.Date = DateTime.Now;
                                insert.AppendChild(text);

                                bookmarkText.AppendChild(insert);

                                //   bookmarkText.Append(insert);

                            }

2) 테이블 셀
   foreach (var table in tables)
                {
                    if (content.TableData.Count <= index) break;

                    List> lstData = content.TableData[index].TableData;
                    index++;
                    //     
                    foreach (List rowArray in lstData)
                    {
                        TableRow row = new TableRow();
                        foreach (string strCell in rowArray)
                        {
                            TableCell cell = new TableCell();

                            Text text = new Text(strCell);
                            RunProperties runProperties = new RunProperties();
                            InsertedRun insert = new InsertedRun(runProperties);
                            insert.Id = Guid.NewGuid().ToString();

                            insert.Author = new StringValue() { Value = "   222" };
                            insert.Date = DateTime.Now;
                            insert.AppendChild(text);

                           

                            cell.Append(new Paragraph(new Run(insert)));
                         //   cell.Append(insert);
                            row.Append(cell);
                        }
                        table.Append(row);
                    }

                    // TableRow tr = WordUtil.DOC_TAB_GetTableRow(ref table, 0);
                }

좋은 웹페이지 즐겨찾기