wordpress hit counter
create a content - WordprocessingML - Formats - OpenXML Developer

create a content

Formats

Discussions about working with different Open XML Formats

create a content

  • rated by 0 users
  • This post has 3 Replies |
  • 0 Followers
  • how i can create a content with wordml? which tag should i use?
  • What do you mean by "content"? Are there some specific requirements?

    Below is the code for generating a simplest "Hello World" .docx document:

    public static void CreateWordMLDocument()
            {
                string file = "CreateWordMLDocument.docx";

                // Create a Wordprocessing document.
                using (WordprocessingDocument package = WordprocessingDocument.Create(file, DocumentFormat.OpenXml.WordprocessingDocumentType.Document))
                {
                    // Add a new main document part.
                    package.AddMainDocumentPart();

                    // Create the Document DOM.
                    package.MainDocumentPart.Document =
                        new Document(
                            new Body(
                                new Paragraph(
                                    new Run(
                                        new Text("Hello World!")))));

                    // Save changes to the main document part.
                    package.MainDocumentPart.Document.Save();
                }
            }

    btw, there are some learning resources:

    Also, could you tell me what solution are you going to implement? Thanks!

  • Thank you for your answer but i need a solution for a dynamic directory with wordml
  • I see. SDK cannot automatically refresh the content for you, if there's any change in your document.

    You need to open the document via app to recalculate the right postion of the items in the content.

Page 1 of 1 (4 items)