为有中文需求的客户提供多渠道中文技术支持.

Thu Mar 23, 2023 3:41 am

下面為代碼範例
Code: Select all
  Document document = new Document(@"C:\test5\轉檔.doc");
            var resultDoc = new Document();
            var newSection = resultDoc.AddSection();

            //只抓section0- table0 - row0- cell0 中的所有內容
            var section = document.Sections[0];
            var table = section.Tables[0];
            var row = table.Rows[0];
            var cell = row.Cells[0];

            var documentObjects = cell.ChildObjects; //以paragraph去切分,which is splited by 換行符號
            foreach (var documentObj in documentObjects)
            {
                var paragraph = documentObj as Paragraph;
                if (paragraph == null) continue;
                //clone
                newSection.Paragraphs.Add(paragraph.Clone() as Paragraph);
            }

            resultDoc.SaveToFile(@"C:\test5\clone from 轉檔(有問題).docx", FileFormat.Docx);



附檔 已寄到:[email protected]
轉檔.doc copy 到 clone from 轉檔(有問題).docx 連連看會跑掉 應該要是第一張圖片(ole)的左邊

yaowen2022
 
Posts: 17
Joined: Mon Mar 06, 2023 8:52 am

Thu Mar 23, 2023 10:10 am

您好,

感謝諮詢。
您所說的“連連看”問題,我對比了您的文檔和輸出文檔後,沒有發現問題。我在邮件中发送了对比截图,您能在截圖上標注一下嗎?

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Thu Mar 23, 2023 10:33 am

已回mail 附圖

yaowen2022
 
Posts: 17
Joined: Mon Mar 06, 2023 8:52 am

Return to 中文技术支持