Write the records in the database in the Word document in formatting records in the database.

zhaozj2021-02-12  164

Use the COM components of Word.

Word._Application app = new Word.ApplicationClass (); app.Visible = false; object nothing = System.Reflection.Missing.Value; object temp = Environment.CurrentDirectory @ "/ resume.doc"; // document templates

Word.documents.open (Ref Nothing, Ref Nothing, Ref Nothing, Ref Nothing, Ref Nothing, Ref Nothing, Ref Nothing, Ref Nothing, Ref Nothing, Ref Nothing, Ref Nothing, Ref Nothing, Ref Nothing, REF NOTHING, REF NOTING, Ref Nothing, Ref Nothing, Ref Nothing; // Open Template

Doc.Tables [1] .cell (1, 2) .range.text = ""; // Add content to cells

// Insert the cell into the cell Doc.Tables [1] .Cell (1, 5) .Range.inlineshapes.addPicture (IMGPATH, REF NOTHING, REF NOTHING, REF NOTHING);

转载请注明原文地址:https://www.9cbs.com/read-7371.html

New Post(0)