Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am reading Office OpenXml styles from an xml file and adding them to a document. The styles are the tags and each attribute represents a property of the style. Creating the style from the Name (string) of the tag is easy, but when I try to set the "Type" property of the style to StyleValues.Table (read as a string from the Type attribute of the xml), I get errors. The Type of the "Type" property is DocumentFormat.OpenXml.EnumValue
Posted
Updated 26-Sep-16 8:16am
v4
Comments
David_Wimbley 26-Sep-16 13:26pm    
Wrap your code in < pre lang="c#" >< /pre > tags (remove the spaces before/after the greater than/less than signs) in order to post your code. Plenty of people do it daily so...i believe in you.

1 solution

The simplest way is to just paste your code in: when you do that a pop-up appears giving you options for how to paste it. Generally, these contain:
Paste as-is
Encode HTML
Code Block
Quoted Text
Best Guess

And a small preview of what it will insert as you hover the mouse over the options.
If I paste in some C#
List<string> myList = new List<string>();
if (a == b)
   c();

"Encode HTML" and "Code Block" are probably the ones to start with:
Encode HTML:
List&lt;string&gt; myList = new List&lt;string&gt;();
if (a == b)
   c();
Which displays as:
List<string> myList = new List<string>();
if (a == b)
c();
Code Block:
C#
List<string> myList = new List<string>();
if (a == b)
   c();

You can also paste code and use the code widget above the text box to add the formatting you want.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900