Questions tagged [openxml]
Questions regarding reading and writing of Microsoft Office Open XML files either through direct manipulation of the XML files contained in a zip package or through the Microsoft Office Open XML SDK.
3,628
questions
0
votes
0
answers
30
views
Get and set a package stream in password-protected OOXML files
Currently, we are using Sysyem.IO.Packaging namespace to get macros from various Office files.
Package package = Package.Open(stream, FileMode.Open, FileAccess.Read);
var pp = package.GetParts()....
0
votes
2
answers
42
views
OpenDocumentXML Excel exponentitally slows when inserting cell sharedstringtable values
The standard approach in code samples is to iterate the sharedstringtable seraching for the value to be added. Add; if not found and use existing if the string exists. However, this searching slows ...
1
vote
0
answers
18
views
OpenXML to Excel: CellFormat Problem - Open Excel-Template and insert datatable to existing Excel-Table with formatted columns
I am getting some data as JSON via RESTful web api and transforming it into a datatable.
Afterwards I want to open an "Excel template" (*.xlsx) with OpenXML and insert the datatable into an ...
0
votes
0
answers
38
views
DocumentFormat.OpenXml - Generated Excel Workbook Getting Corrupted
I'm trying to do a bulk excel export with Grid Lines disabled. For that, I'm setting the ShowGridLines property(ShowGridLines) of SheetView class (of DocumentFormat.OpenXml library) to false. But when ...
0
votes
0
answers
8
views
How to insert sub-document in MS Word document file through Open XML?
Based on the documentation, it says I just need a w:subDoc element and in relationships. But this only shows a link to the path instead of embedding the document as a sub document. Any idea why this ...
0
votes
1
answer
25
views
How do I clone existed complicated rows to the work sheet using openxml
I need to clone exists rows to the work sheet dynamically. ex. I wanna copy row 28, 29 and insert into 30, 31, or 32,33, or more maybe, it depends on the data rows.
from
to
How to do that in openxml ...
0
votes
0
answers
27
views
OpenXML nuget package x64 release build error
I am using OpenXML nuget package for my UWP project
though "x64 Debug build" is OK
I am getting build error during "x64 Release Build" with OpenXML nuget package
Is their any ...
0
votes
0
answers
45
views
AutoFitWidth equivalent in Office Open Xml file format
I have a program that creates XML Spreadsheet in legacy format (Excel 2003). It uses ss:AutoFitWidth Column attribute. AutoFitWidth means that column should be autosized for numeric values:
MSDN
<...
0
votes
0
answers
17
views
C# OpenXML Sort Excel on Multiple Columns
I am looking for example code on how to sort an Excel sheet, using OpenXML, on multiple columns in C# .Net 6.
I have a handle on my spreadsheet:
using SpreadsheetDocument spreadSheet = ...
-4
votes
1
answer
51
views
How to define a function to add cell colour for a table that created by python-docx?
I want to define a function to filling header colour,
for now, I am just hard code every object.
Here is the code I used, I tried to define a function to add cell colour.
The error msg shown below:
...
0
votes
0
answers
12
views
Modify CustomXMLPart Word Document Value Restrictions
Word Document Unzipped
Item1.xml in the CustomXML folder
<ct:contentTypeSchema xmlns:ct="http://schemas.microsoft.com/office/2006/metadata/contentType" xmlns:ma="http://schemas.microsoft.com/...
0
votes
0
answers
42
views
Modify XML Custom Part Word Document Server Properties using XML Element Tree and or XML Minidom
I am reformatting and restructuring our document management to use Sharepoint. Our SOPs, Forms and Records were previously contained in SharePoint migrated to a major Document Management System and ...
0
votes
0
answers
8
views
Table style disappears after adding a row
I'm using python-docx to populate a word template that I have
The problem is that, I want to apply a particular style to a table I have
The table exists already
and I'm just extending it like this:
...
3
votes
1
answer
74
views
Remove all animations pptx from Powerpoint Presentation using OpenXML SDK
I'm currently working on editing my existing PowerPoint file (.pptx) using OpenXML SDK. Can I know how to remove all animations from my PowerPoint presentation?
The reason for this is I want a clean ...
0
votes
1
answer
65
views
Docx to pdf in Microsoft Graph Api failing with error "WordCantOpenDocument"
We are doing a docx-PDF conversion by uploading a Word-document(docx) by first uploading it using the large document upload in Microsoft Graph API (link) and after that downloading it to PDF-format (...
1
vote
1
answer
29
views
Parsing a restricted Word file
I am working on a Windows standalone application. [ I can not disclose the name as per our company policy]
I installed Azure Information Protection Client.
Then I protected the Word file with the ...
0
votes
2
answers
93
views
OpenXML how to make text bold
I use openXML to write a word document containing my text. Now I want to make a part of the text bold. I however fail to find a solution to make my text bold, since I can't figure it out. My code is:
...
0
votes
0
answers
8
views
Is it possible to parallel retrieve values from an Excel file using OpenXML?
I have implemented a variant of the following get cell value (see link) and I use this to read an Excel tabel. However, due to the slow pace of reading every cell, I have implemented a parallel ...
1
vote
0
answers
19
views
Saving an OpenXml Word document with thousands of headers and footers
Yes you read that title right - thousands of headers and footers.
We are required to generate a massive Word document (think 20,000+ pages) and we are using the OpenXml SDK to do it. The document is ...
0
votes
0
answers
8
views
c# openxml insert multi lines with different format
How to format a cell in excel from 4 properties in red box in the picture?
I have tried mergecells but it didn't work.
So I am looking for a way to insert several lines with different format(font-size,...
1
vote
1
answer
24
views
OpenXML Create Word Document always corrupt C#
I am working on an old webforms application and I am trying to create a word document via the OpenXml in C# within one of the pages. I am trying to read in data from SQL to populate a table I will ...
2
votes
0
answers
17
views
How to Programmatically Create OOXML Strict Documents
It is possible to manually save an Excel spreadsheet as a "Strict Open XML" file in Excel filtype drop-down when using "Save as" instead of saving it as the default transitional ...
0
votes
0
answers
24
views
How to Download a System.IO.Stream Object
I am using ClosedXML and OpenXML to create a an Excel spreadsheet. This is part of a .Net Core project where a user will click a button to download a file. I was able to save the file to my hard drive ...
0
votes
0
answers
16
views
openXml word..mergefield is corrupted
I'm trying to do a mail merge, and having issues at the PRE-merge stage..ie, as soon as write the .docx.
The xml tag in question is: «customer_name»
In the XML, the tags, and single quotes, behave ...
0
votes
0
answers
9
views
How to search and replace within the Body of an OpenXML WordProcessing document
I am trying to understand how to perform search and replace of text using OpenXML. The inputs are a template file in Word format and a text file containing pairs of search/replace terms, and it will ...
1
vote
2
answers
87
views
How to get content from .docx in a binary level?
I had an issue with opening a .docx file and i wondered "what about getting the data straight from the bin?".
My first attempt was to just check the bin data in a .docx, the doc only ...
4
votes
1
answer
88
views
How To Chanage OpenXml Wordprocessing Text Direction?
I'm trying to open a word document and change its text direction to correct ones, here :
IEnumerable<DocumentFormat.OpenXml.Wordprocessing.Text> texts = doc.MainDocumentPart.Document.Body....
0
votes
0
answers
30
views
creating pivot tables in excel via openxml
i need to make manipulation on excel file and create few complex pivot tables(using filters) using openxml.
additionaly if someone know if its posible to use the BMC control-m on the batch application?...
0
votes
1
answer
45
views
How do I add number in cell using openxml
I have trouble creating cells in excel using openXml. If I use Datatype Number I get a warning when opening the excel "We found a problem with some content in file.xlsx. Do you want us to try to ...
0
votes
0
answers
39
views
OpenXML Spreadsheet cells edit causes Excel to report error on opening
I'm writing a short application in C# (Visual Studio 2022, Windows Form, .NET 6.0) where I change the values of some cells on a already existing .xlsx file.
I'm using DocumentFormat.OpenXml package.
...
0
votes
0
answers
33
views
Microsoft Excel on save changes decimal point to 8
when i open on save excel the value displayed in excel is 596207726.09 but actual code behind value is 596207726.09000003.
why this change happaned?
But 596207726.09 in excel changed to 596207726....
0
votes
0
answers
37
views
Formatting dates and currency when exporting to Excel
I have some code that's creating a DataTable, and then converting it to an Excel spreadsheet. Code is below:
DataTable table = (DataTable)JsonConvert.DeserializeObject(JsonConvert.SerializeObject(...
0
votes
1
answer
31
views
OpenXML Adding Notes and Threaded Comments
I'm posting this to help others that may be going through the struggle I went through when trying to add simple notes or threaded comments to an excel spreadsheet using the DocumentFormat.OpenXML ...
1
vote
0
answers
38
views
OpenXML Copy Spreadsheet to new Workbook
What I am trying to do: .Net Core Controller -> Read file using OpenXML -> Create new spreadsheet document using OpenXML with selected sheets from the previously read file -> return the newly ...
3
votes
1
answer
70
views
How does Excel calculate how many pixels to add/subtract when switching from "Normal" view mode to "Page Layout" view mode?
If you create a new table in Excel and look at the column width in "Normal" view mode, it will be 64px
Now if you switch to "Page Layout" mode and look at the column width, it will ...
0
votes
0
answers
23
views
In word, is it possible to add nested lists with different bullet styles for different subsections
In nested lists in word. Is it possible to have different bullet styles for different sublists. Like 1->1.1,1.2 and 2->a,b?
tried in word to do the same and was unable to acheive it. Tried ...
1
vote
0
answers
32
views
How to remove external links in an Excel document (XLSX) using OpenXML
I have a relatively simple question, but as in my opinion OpenXML has little documentation, I do not understand the following properly.
First off, we are talking about a XLSX file, which I am trying ...
0
votes
1
answer
79
views
split a paragraph in word to two paragraphs using OpenXml SDK?
I have a method that splits paragraphs into two paragraphs at the same location on the word file.
the logic is working fine but I'm losing the document format and styles.
foreach (Paragraph p in body....
0
votes
1
answer
84
views
Read docx file from VM and write it down to a stream
I have a .docx file located on my virtual machine desktop which I want to write down to a stream.
So far this is what I have tried
byte[] buffer = new byte[32768];
string path = @"\\officeblrhome....
0
votes
0
answers
65
views
adding texts to connector and adjusting texts to shapes using apache POI OOXML
Recently I am working with Apache POI and i am facing an issues
I have requirement to glue texts above rectangle to connector by using Apache POI/OOXML as below, as per OOXML specification texts can ...
0
votes
1
answer
36
views
How to get data from Excel using the OpenXML C library#
I wanted to get data from a table in Excel, but I get them in the form
Instead of
Program code
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml....
1
vote
1
answer
71
views
how to create bent connector by rotating 90degrees with exact coordinates using ooxml apache poi
Recently i am working with Apache POI and i am facing an issue while rotating bent connector with exact positioning. I want to represent bent connector as flow level between shapes, and i have a ...
1
vote
1
answer
33
views
Constructing an OpenXmlElement from bitmap picture to append into a Run instance
I have the following code:
string replaceValueString = parameterValue.ToString();
Run replaceRun = new Run();
replaceRun.Append(new Text(replaceValueString));
contentControl.InsertAfterSelf(replaceRun)...
0
votes
0
answers
6
views
How to get list from docx file?
How to determine whether a list is bulleted or numbered? I use OpenXML
In general, what will be the list determines NumberingDefinitionsPart, I thought to find out the Numbering of a certain element, ...
0
votes
0
answers
52
views
C# - How to read the values of the Pivot table in an excel file using openXML?
I'm reading an excel file with a pivot table. I'm using openXML to read the values of the excel file. I'm able to get the values of other cells outside the pivot table using "cell.cellvalue....
0
votes
0
answers
96
views
Why are headings beyond level 6 not displaying in my Office Open XML document?
I am trying to print headers like Header1 (1), Header2 (1.1) etc. The headers are printing till level 6 Header6 (1.1.1.1.1.1) but unable to print 7th (1.1.1.1.1.1.1), 8th, 9th level.
Below is what I'...
0
votes
0
answers
47
views
How to find out an OpenXml element is legit child for another
In older versions of OpenXml-sdk, every element has ChildInfoAttributes. So, it was enough to look at the list of ChildInfoAttribute to determine which types of elements it can accept as a child. ...
0
votes
0
answers
26
views
Add a table formula using C# Open XML Wordprocessing
I need to insert a =SUM(ABOVE) formula into a TableCell.
I tried cloning an already made cell. I also tried cloning the inner Paragraph object. But it doesn't work fully well - table becomes somewhat ...
0
votes
0
answers
31
views
After insert table element with children into Word using C# and OpenXml, document does not open
If I inserting an empty table, everything works fine, but when I try to imitate real table with it's children, like this created directly in word...
here is its structure:
I have such an error when ...
0
votes
0
answers
31
views
How to create OleObject using C# for OpenXML
I am working currently on embedding objects into spreadsheet using OpenXML. Being able to finally work out how to embed object I encountered the following problem:
I have found OpenXML SDK ...