Archiv der Kategorie: Open XML

Open XML: change text in document header

Within this article I want to show how to change text in an existing document. As example the text within the document header should be modified. But you can use the same principle to change the content in all other … Weiterlesen

Veröffentlicht unter .NET, C#, Open XML | 1 Kommentar

Open XML: add a picture

Within this article I want to show how to add a picture to an Open XML document.   Document Image Part At first you have to create an image part. This document part is used to store the image. If … Weiterlesen

Veröffentlicht unter .NET, C#, Open XML | 3 Kommentare

Open XML: Create a table

Within this article I want to show you how to create a table within a word document.   Table structure In Open XML documents there are a lot of different content elements and styles. Within this article I want to … Weiterlesen

Veröffentlicht unter .NET, C#, Open XML | 1 Kommentar

Open XML: Create new heading style

In a previous article I have shown how to use an existing heading style. But this requires an existing template document with the according style definition. Maybe you don’t have such a document or don’t want to use one. In … Weiterlesen

Veröffentlicht unter .NET, C#, Open XML | Kommentar hinterlassen

Open XML: Set heading style

If you create a word document and fill it with content, you will normally define headings to group the content. So it is a common task to define and use heading styles. There are two main uses cases: you may … Weiterlesen

Veröffentlicht unter .NET, C#, Open XML | Kommentar hinterlassen

Open XML: Use a template file

Within a previous article I have shown you a “Hello World” solution to create an Open XML file. Based on this article I will show you an adapted version of this application which uses an existing file. So you can … Weiterlesen

Veröffentlicht unter .NET, C#, Open XML | Kommentar hinterlassen

Open XML: Set background color

You can chance the foreground color of a text by define an according Color element. Changing the background color will work in the same way, but you have to create a Shading element instead of a Color element. The Shading … Weiterlesen

Veröffentlicht unter .NET, C#, Open XML | Kommentar hinterlassen

Open XML: Set text color

To change the foreground color of a text in an Open XML document, you have to create a Color element and add it to the run properties. The following source code shows an example application. At first a color element … Weiterlesen

Veröffentlicht unter .NET, C#, Open XML | Kommentar hinterlassen

Open XML: Set text font

In Open XML you can set the font for a text by using a RunFonts element. You just have to create the element, set the font name and append the created font to the Run element. The following source code … Weiterlesen

Veröffentlicht unter .NET, C#, Open XML | Kommentar hinterlassen

Open XML: Change the text format

Within an Open XML document you may easily change the text format to create bold, italic, underline or other formatted content. The most important thing is to thin about the document structure. As explained in a previous article, the Run … Weiterlesen

Veröffentlicht unter .NET, C#, Open XML | Kommentar hinterlassen