Quantcast
Channel: Open XML Format SDK forum
Viewing all 1288 articles
Browse latest View live

in XLSX doucment , first row values turn in strange format.

$
0
0

When i open xlsx doument with zip, and naviagte to SharedStrings.xml
first row values are as follow : 
<si>

<t>F_x0000_i_x0000_r_x0000_s_x0000_t_x0000_ _x0000_N_x0000_a_x0000_m_x0000_e_x0000_</t>

</si>

When i open the document with excel evrything is ok, values are strings they need to be. So my question is, what can cause that, and is there any way i can convert values like those, to content strings inside code.

problem is that, if i read in values from that excel, then in program i get those strange sybols as well. And as i have to control the header values from excel, i need to know how to convert them to normal text. 

thanks




Where I can download this editer

$
0
0

When I am asking this question, I typing word in this editer.

This is an editer tool.

Where I can download this editer tool?

Append rows using SAXParser in Open xml SDK for Excel

$
0
0

Hi ,

Can someone help me how to append rows using SAX Parser in Openxml SDK. I want add rows to an existing worksheet.


srikanth

Add Different Header and Footer on pages Office OpenXML SDK 2.0

$
0
0

I am trying to add different header and footer on first page and subsequent default pages in word document using Office Open XML SDK 2.0. But it only adds default page header and not first page. Kindly refer to code below. I appreciate if someone can help me out, as i am not able to figure out what i am doing wrong.

In Text.docx fill in more than one page so the we have header and footers in more than 1 page.

Calling Code:

string strTemplate = ConfigurationManager.AppSettings["WordDoc"] + "Test.docx"; string
DestinationPath = ConfigurationManager.AppSettings["WordDoc"] + "P_" + "Test.docx";
File.Copy(strTemplate, DestinationPath, true);

//I have created a class file Office, with methods to perform functions.
Office officeLetter = new Office(); 
officeLetter.Open(DestinationPath);
officeLetter.AddHeaderAndFooter(); 

officeLetter.Close()

Class File:

using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
using Oracle.DataAccess.Client;
using System;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
using System.Collections.Generic;


public class Office{

 protected WordprocessingDocument Document;


public WordprocessingDocument Open(string documentName, bool openMode = true)
{
    WordprocessingDocument document = null;
    try
    {
    document = WordprocessingDocument.Open(documentName, openMode);
    }
    catch //(Exception ex)
    {
    throw;
    }

    this.Document = document;
    return document;
}

public void Close()
{
    this.Document.Close();
}

public void AddHeaderAndFooter()
{

    // Get the main document part
    var mainPart = Document.MainDocumentPart;

    // Delete the existing header and footer parts
    mainPart.DeleteParts(mainPart.HeaderParts);
    mainPart.DeleteParts(mainPart.FooterParts);

    // Create a new header and footer parts for first and default pages
    HeaderPart headerPart = mainPart.AddNewPart<HeaderPart>();
    FooterPart footerPart = mainPart.AddNewPart<FooterPart>();

    HeaderPart defaultHeaderPart = mainPart.AddNewPart<HeaderPart>();
    FooterPart defaultFooterPart = mainPart.AddNewPart<FooterPart>();

    // Get Id of the headerPart and footer parts
    string headerPartId = mainPart.GetIdOfPart(headerPart);
    string footerPartId = mainPart.GetIdOfPart(footerPart);
    string defaultHeaderPartId = mainPart.GetIdOfPart(defaultHeaderPart);
    string defaultFooterPartId = mainPart.GetIdOfPart(defaultFooterPart);

    GenerateHeaderPartContentFirst(headerPart);
    GenerateHeaderPartContent(defaultHeaderPart);
    GenerateFooterPartContentFirst(footerPart);
    GenerateFooterPartContent(defaultFooterPart);

    // Get SectionProperties and Replace HeaderReference and FooterRefernce with new Id
    IEnumerable<SectionProperties> sections = mainPart.Document.Body.Elements<SectionProperties>();

    foreach (var section in sections)
    {
    // Delete existing references to headers and footers
    section.RemoveAllChildren<HeaderReference>();
    section.RemoveAllChildren<FooterReference>();

    // Create the new header and footer reference node
    section.PrependChild<HeaderReference>(new HeaderReference() { Id = headerPartId, Type = HeaderFooterValues.First });
    section.PrependChild<HeaderReference>(new HeaderReference() { Id = defaultHeaderPartId, Type = HeaderFooterValues.Default });
    section.PrependChild<FooterReference>(new FooterReference() { Id = footerPartId, Type = HeaderFooterValues.First });
    section.PrependChild<FooterReference>(new FooterReference() { Id = defaultFooterPartId, Type = HeaderFooterValues.Default });
    }
    mainPart.Document.Save();
}

public void GenerateHeaderPartContent(HeaderPart part)
{
    Header header1 = new Header() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 wp14" } };
    header1.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
    header1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
    header1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
    header1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
    header1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
    header1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
    header1.AddNamespaceDeclaration("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
    header1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
    header1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
    header1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
    header1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
    header1.AddNamespaceDeclaration("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
    header1.AddNamespaceDeclaration("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
    header1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
    header1.AddNamespaceDeclaration("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");

    Paragraph paragraph1 = new Paragraph() { RsidParagraphAddition = "00164C17", RsidRunAdditionDefault = "00164C17" };
    Paragraph paragraph2 = new Paragraph();
    ParagraphProperties paragraphProperties1 = new ParagraphProperties();
    ParagraphStyleId paragraphStyleId1 = new ParagraphStyleId() { Val = "Header" };

    paragraphProperties1.Append(paragraphStyleId1);

    Run run1 = new Run();
    Text text1 = new Text();
    text1.Text = "Default Header";

    run1.Append(text1);

    paragraph1.Append(paragraphProperties1);
    paragraph1.Append(run1);

    header1.Append(paragraph1);

    part.Header = header1;
}

public void GenerateHeaderPartContentFirst(HeaderPart part)
{
    Header header1 = new Header() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 wp14" } };
    header1.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
    header1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
    header1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
    header1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
    header1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
    header1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
    header1.AddNamespaceDeclaration("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
    header1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
    header1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
    header1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
    header1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
    header1.AddNamespaceDeclaration("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
    header1.AddNamespaceDeclaration("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
    header1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
    header1.AddNamespaceDeclaration("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");

    Paragraph paragraph1 = new Paragraph() { RsidParagraphAddition = "00164C17", RsidRunAdditionDefault = "00164C17" };
    Paragraph paragraph2 = new Paragraph();
    ParagraphProperties paragraphProperties1 = new ParagraphProperties();
    ParagraphStyleId paragraphStyleId1 = new ParagraphStyleId() { Val = "Header" };

    paragraphProperties1.Append(paragraphStyleId1);

    Run run1 = new Run();
    Text text1 = new Text();
    text1.Text = "First Page Header";

    run1.Append(text1);

    paragraph1.Append(paragraphProperties1);
    paragraph1.Append(run1);

    header1.Append(paragraph1);

    part.Header = header1;
}

static void GenerateFooterPartContentFirst(FooterPart part)
{
    Footer footer1 = new Footer() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 wp14" } };
    footer1.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
    footer1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
    footer1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
    footer1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
    footer1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
    footer1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
    footer1.AddNamespaceDeclaration("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
    footer1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
    footer1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
    footer1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
    footer1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
    footer1.AddNamespaceDeclaration("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
    footer1.AddNamespaceDeclaration("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
    footer1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
    footer1.AddNamespaceDeclaration("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");

    Paragraph paragraph1 = new Paragraph() { RsidParagraphAddition = "00164C17", RsidRunAdditionDefault = "00164C17" };

    ParagraphProperties paragraphProperties1 = new ParagraphProperties();
    ParagraphStyleId paragraphStyleId1 = new ParagraphStyleId() { Val = "Footer" };

    paragraphProperties1.Append(paragraphStyleId1);

    Run run1 = new Run();
    Text text1 = new Text();
    text1.Text = "First Footer";

    run1.Append(text1);

    paragraph1.Append(paragraphProperties1);
    paragraph1.Append(run1);

    footer1.Append(paragraph1);

    part.Footer = footer1;
}

static void GenerateFooterPartContent(FooterPart part)
{
    Footer footer1 = new Footer() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 wp14" } };
    footer1.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
    footer1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
    footer1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
    footer1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
    footer1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
    footer1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
    footer1.AddNamespaceDeclaration("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
    footer1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
    footer1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
    footer1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
    footer1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
    footer1.AddNamespaceDeclaration("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
    footer1.AddNamespaceDeclaration("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
    footer1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
    footer1.AddNamespaceDeclaration("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");

    Paragraph paragraph1 = new Paragraph() { RsidParagraphAddition = "00164C17", RsidRunAdditionDefault = "00164C17" };

    ParagraphProperties paragraphProperties1 = new ParagraphProperties();
    ParagraphStyleId paragraphStyleId1 = new ParagraphStyleId() { Val = "Footer" };

    paragraphProperties1.Append(paragraphStyleId1);

    Run run1 = new Run();
    Text text1 = new Text();
    text1.Text = " Default Footer";

    run1.Append(text1);

    paragraph1.Append(paragraphProperties1);
    paragraph1.Append(run1);

    footer1.Append(paragraph1);

    part.Footer = footer1;
}
}



TOC in OpenXML automated Docx only partially refreshing

$
0
0

Hey folks

I've got here some documents generated using OpenXML SDK (2.0/2.5, same behavior). I've tried both MS Word 2010/2013, also same behavior.

Now, I've got a TOC in the document which needs to be refreshed when the document opens. I use the 'UpdateFieldsOnOpen' flag to make Word ask the user to refresh his document. I then click 'yes, you may refresh'.
-> Result = a partially refreshed TOC.

Why partially? Well ... Content of the document is databound to a custom XML datasource using content controls. TOC at this point refuses to show the databound text, but instead shows the default text of the content control (which isn't really helpful).

Now ... when I then manually refresh the TOC, then it does show me everything as it's supposed to be shown.

Strange thing is that when the application was first made Word DID refresh that properly on document opening, so I'm at a loss as to why it's no longer doing so now. Maybe I'm missing something?

Any thoughts would be welcome.

Error while open the excel sheet

$
0
0

Hi,

   I loaded the values in excel sheet by using open xml, but while open the excel sheet it show the error message like below, can you tell me how to address this errors? is any specific tool available to address this errors?

updating chart data in presentation - broken reference (?)

$
0
0




static void Main(string[] args) { using (PresentationDocument presDoc = PresentationDocument.Open(@"C:\Users\username\Desktop\tests\test.pptx", true)) { string rid = null; SlideId slideId = (SlideId)presDoc.PresentationPart.Presentation.SlideIdList.ChildElements[4]; SlidePart slidePart = (SlidePart)presDoc.PresentationPart.GetPartById(slideId.RelationshipId.ToString()); Slide slide = slidePart.Slide; //ChartPart chartPart = slidePart.ChartParts.FirstOrDefault(); List<ChartPart> list= slidePart.ChartParts.ToList<ChartPart>(); //ChartPart chartPart = slidePart.ChartParts.Last(); //ChartPart chartPart //for (int i = 0; i < list.Count(); i++) //{ // chartPart = list[i]; // if (chartPart.=="Chart3") // { // } //} ChartPart chartPart = list[1]; EmbeddedPackagePart worksheetPart=chartPart.EmbeddedPackagePart; //chartPart.Parts. using (SpreadsheetDocument embedDocument = SpreadsheetDocument.Open(worksheetPart.GetStream(), true)) { WorksheetPart sheetPart = (WorksheetPart)embedDocument.WorkbookPart.GetPartById(embedDocument.WorkbookPart.Workbook.Descendants<ss.Sheet>().Where(s => s.Name == "Sheet1").First().Id.ToString()); ss.Worksheet sheet = sheetPart.Worksheet; //series names ss.Cell cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "B1").First(); cell.CellValue.Text = "C1"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "C1").First(); cell.CellValue.Text = "C2"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "D1").First(); cell.CellValue.Text = "C3"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "E1").First(); cell.CellValue.Text = "C4"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "F1").First(); cell.CellValue.Text = "C5"; //categories names cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "A2").First(); cell.CellValue.Text = "S1"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "A3").First(); cell.CellValue.Text = "S2"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "A4").First(); cell.CellValue.Text = "S3"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "A5").First(); cell.CellValue.Text = "S4"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "A6").First(); cell.CellValue.Text = "S5"; //values cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "B2").First(); cell.CellValue.Text = "1"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "C2").First(); cell.CellValue.Text = "2"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "D2").First(); cell.CellValue.Text = "3"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "E2").First(); cell.CellValue.Text = "4"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "F2").First(); cell.CellValue.Text = "5"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "B3").First(); cell.CellValue.Text = "6"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "C3").First(); cell.CellValue.Text = "7"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "D3").First(); cell.CellValue.Text = "8"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "E3").First(); cell.CellValue.Text = "9"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "F3").First(); cell.CellValue.Text = "10"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "B4").First(); cell.CellValue.Text = "11"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "C4").First(); cell.CellValue.Text = "12"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "D4").First(); cell.CellValue.Text = "13"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "E4").First(); cell.CellValue.Text = "14"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "F4").First(); cell.CellValue.Text = "15"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "B5").First(); cell.CellValue.Text = "16"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "C5").First(); cell.CellValue.Text = "17"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "D5").First(); cell.CellValue.Text = "18"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "E5").First(); cell.CellValue.Text = "19"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "F5").First(); cell.CellValue.Text = "20"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "B6").First(); cell.CellValue.Text = "66"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "C6").First(); cell.CellValue.Text = "62"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "D6").First(); cell.CellValue.Text = "58"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "E6").First(); cell.CellValue.Text = "54"; cell = sheet.Descendants<ss.Cell>().Where(c => c.CellReference == "F6").First(); cell.CellValue.Text = "50"; // modification } Chart chart = chartPart.ChartSpace.Elements<Chart>().First(); ExternalData ED = chartPart.ChartSpace.Elements<ExternalData>().First(); AutoUpdate AU = ED .Descendants<AutoUpdate>() .FirstOrDefault(); AU.Val = true; }

I created that code on base of some code found on openxmldeveloper site. It runs without errors, data in workbook is updated. The problem is that after running it, reference between chart and that workbook is broken (data on chart is not updated and there is no possibility to edit source data).In addition when I try to open that workbook, excel shows some message that there is some problem. When I choose to recover, it opens with good data.


Code of output xml files in which there are differences in comparison to source files:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><xworksheet xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" mc:Ignorable="x14ac"><xsheetPr codeName="Sheet1"/><xdimension ref="A1:F8"/><xsheetViews><xsheetView tabSelected="1" workbookViewId="0"><xselection activeCell="E12" sqref="E12"/></xsheetView></xsheetViews><xsheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/><xcols><xcol min="1" max="1" width="11" customWidth="1"/><xcol min="2" max="4" width="10" customWidth="1"/></xcols><xsheetData><xrow r="1" spans="1:6" x14ac:dyDescent="0.25"><xc r="A1" s="1" t="s"><xv>
     0</xv></xc><xc r="B1" s="2" t="s"><xv>
     C1</xv></xc><xc r="C1" s="2" t="s"><xv>
     C2</xv></xc><xc r="D1" s="2" t="s"><xv>
     C3</xv></xc><xc r="E1" s="3" t="s"><xv>
     C4</xv></xc><xc r="F1" s="3" t="s"><xv>
     C5</xv></xc></xrow><xrow r="2" spans="1:6" x14ac:dyDescent="0.25"><xc r="A2" s="4" t="s"><xv>
     S1</xv></xc><xc r="B2" s="7"><xv>
     1</xv></xc><xc r="C2" s="7"><xv>
     2</xv></xc><xc r="D2" s="7"><xv>
     3</xv></xc><xc r="E2" s="7"><xv>
     4</xv></xc><xc r="F2" s="7"><xv>
     5</xv></xc></xrow><xrow r="3" spans="1:6" x14ac:dyDescent="0.25"><xc r="A3" s="5" t="s"><xv>
     S2</xv></xc><xc r="B3" s="8"><xv>
     6</xv></xc><xc r="C3" s="8"><xv>
     7</xv></xc><xc r="D3" s="8"><xv>
     8</xv></xc><xc r="E3" s="8"><xv>
     9</xv></xc><xc r="F3" s="8"><xv>
     10</xv></xc></xrow><xrow r="4" spans="1:6" x14ac:dyDescent="0.25"><xc r="A4" s="5" t="s"><xv>
     S3</xv></xc><xc r="B4" s="8"><xv>
     11</xv></xc><xc r="C4" s="8"><xv>
     12</xv></xc><xc r="D4" s="8"><xv>
     13</xv></xc><xc r="E4" s="8"><xv>
     14</xv></xc><xc r="F4" s="8"><xv>
     15</xv></xc></xrow><xrow r="5" spans="1:6" x14ac:dyDescent="0.25"><xc r="A5" s="4" t="s"><xv>
     S4</xv></xc><xc r="B5" s="7"><xv>
     16</xv></xc><xc r="C5" s="7"><xv>
     17</xv></xc><xc r="D5" s="7"><xv>
     18</xv></xc><xc r="E5" s="7"><xv>
     19</xv></xc><xc r="F5" s="7"><xv>
     20</xv></xc></xrow><xrow r="6" spans="1:6" x14ac:dyDescent="0.25"><xc r="A6" s="5" t="s"><xv>
     S5</xv></xc><xc r="B6" s="6"><xv>
     66</xv></xc><xc r="C6" s="6"><xv>
     62</xv></xc><xc r="D6" s="6"><xv>
     58</xv></xc><xc r="E6" s="6"><xv>
     54</xv></xc><xc r="F6" s="6"><xv>
     50</xv></xc></xrow><xrow r="8" spans="1:6" x14ac:dyDescent="0.25"><xc r="B8" t="s"><xv>
     1</xv></xc></xrow></xsheetData><xpageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/><xpageSetup orientation="portrait" r:id="rId1"/><xtableParts count="1"><xtablePart r:id="rId2"/></xtableParts></xworksheet>
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><xworkbook xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><xfileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9303"/><xworkbookPr codeName="ThisWorkbook" defaultThemeVersion="124226"/><xbookViews><xworkbookView xWindow="480" yWindow="75" windowWidth="21840" windowHeight="13740"/></xbookViews><xsheets><xsheet name="Sheet1" sheetId="1" r:id="rId1"/></xsheets><xcalcPr calcId="0" calcMode="manual"/><xoleSize ref="A1"/></xworkbook>

In attached xml code there of course should be ":" between "x" and "workbook" etc. I do not know why it disappeared ...




Open XML Format SDK 2.5 SpreadsheetDocument how to remove Images by name

$
0
0

I am developing an application that create/update an xlsx for every production item.

Now when I have to create a new xlsx I can do everything I need (write text and add images).

In update status I have to remove some of the images I added (named by a prefix) but I have not find how to do it.

http://social.msdn.microsoft.com/Forums/office/en-US/328c965d-5221-4d6f-9040-2460f4ffbd78/issue-with-removing-charts-from-the-spreadsheet-using-open-xml-sdk-v2?forum=oxmlsdk modest helped me becouse 

wsp.DeletePart(wsp.DrawingsPart);wsp.Worksheet.Descendants<Drawing>().FirstOrDefault().Remove();

remove every images in my sheets.

How can I remove images by name?

regards

Gabriele Toccafondi


Error While Using WriteElement - Store must be open for this operation

$
0
0

Hi Everybody,

While using the WriteElement of an OpenXmlWriterinstance (writer.WriteElement(Cell)) I got the following error:

 "Store must be open for this operation".

The worksheetPart behind this writer is Open and the code works well most of the time.

(the problem happends only from time to time and it seems it happends more when multiple instances are running simultaneously).

The Store in the error message is related to: IsolatedStorage - but I have no idea what to do.

Can aynbody help ?

Thanks !

 

Creating Excel spreadsheet using System.IO.Packaging

$
0
0

Hi, I am creating Excel spreadsheets dynamically on a Web server using System.IO.Packaging.  It has been working great for some time.  I have noticed that the Excel files were sometimes very large for the amount of content and I noticed that when I opened them up and saved them using Excel that the size was reduced dramatically. After looking at the individual files in the package I saw that the files in the ones created by my program had a compression ratio of "0 %."

How can I add the package parts compressed?  I am using Visual Studio 2010, Framework 4.0.

Thanks,


Lloyd Carter

How to insert Word 2013 Start/End tag type Content Controls using OpenXML sdk

$
0
0

Is there any way to create a document with Start/End tag type  a content control using open XML sdk?


Antony

Changing Excel Sheet data inside a Word Document

$
0
0

Hello,

The problem is that I can change contents of the sheet inside word doc but after opening the doc user needs to double click the sheet and press ESC to see the updated content.

I saw an example of updating Chart data, but I need the exact code which resolves my PROBLEM,

PLEASE JUST PUT THE REQUIRED CODE TO RESOLVE THE PROBLEM NOT ANY LINK, JUST MY PROBLEM!

THANK YOU.

IEnumerable<EmbeddedObject> objects = mainPart.Document.Descendants<EmbeddedObject>();

                //Problem: update cached values in the word-processing document.
               
                for (int i = 0; i < mainPart.EmbeddedPackageParts.Count(); i++)
                {
                    EmbeddedPackagePart epp = (EmbeddedPackagePart)mainPart.EmbeddedPackageParts.ElementAt(i);
                    DocumentFormat.OpenXml.Vml.Shape shape = objects.ElementAt(i).ChildElements.OfType<DocumentFormat.OpenXml.Vml.Shape>().First();

                    
                    if (shape.Alternate != null)
                    {
                        Stream stream = epp.GetStream(FileMode.OpenOrCreate);
                        BookmarkValue bv = excelObjectBookmarkValues.FirstOrDefault(P => P.Key.Trim().ToLower() == shape.Alternate.Value.Trim().ToLower());
                        
                        if (bv != null)
                        {
                            List<DataModel.BookmarkValue> excelBookmarkValues = bv.DetailList;
                            using (SpreadsheetDocument ssDoc = SpreadsheetDocument.Open(stream, true))
                            {

                                FlushCachedValues(ssDoc);

                                WorkbookPart wbPart = ssDoc.WorkbookPart;
                                Sheet theSheet = wbPart.Workbook.Descendants<Sheet>().First();


                                if (theSheet != null)
                                {
                                    Worksheet ws = ((WorksheetPart)(wbPart.GetPartById(theSheet.Id))).Worksheet;
                                    SheetData sheetData = ws.GetFirstChild<SheetData>();
                                    
                                    foreach (var item in excelBookmarkValues)
                                    {
                                        try
                                        {
                                            DefinedName name = wbPart.Workbook.Descendants<DefinedName>().FirstOrDefault(c => c.Name.Value == item.Key);
                                            if (name != null)
                                            {
                                                Cell cell = sheetData.Descendants<Cell>().FirstOrDefault(c => c.CellReference.Value == ExtractCellReference(name.Text));

                                                if (cell != null)
                                                {
                                                    cell.CellValue = new CellValue("123456789");
                                                    cell.DataType = new EnumValue<CellValues>(CellValues.Number);
                                                }
                                                
                                            }
                                        }
                                        catch
                                        {
                                        }
                                    }
                                }
                            }

Weird Issue with Picture Content Control

$
0
0

Dear All,

I have been struggling with this issue for quite sometime now but could not get a clue as what the problem is.

To simplify, the following are the details:

I have two content controls in the word document. First one is rich text content control and the second one is picture content control. If I keep the content controls in the sequence above, I am not able to see the image in the document.

However, if I keep the picture content control first and then keep the rich text content control second, then image is shown in the document.

To insert the image into word document, I have followed exactly the same approach suggested in MSDN


Below is the document.xml content while image is shown and when image not shown.

Document.xml content when image is not shown

 <w:body>
  <w:p w:rsidRPr="00FB59AD" w:rsidR="006E7AE4" w:rsidP="006E7AE4" w:rsidRDefault="000836D8">
   <w:pPr>
    <w:widowControl w:val="0"/>
    <w:tabs>
     <w:tab w:val="left" w:pos="3880"/>
    </w:tabs>
    <w:autoSpaceDE w:val="0"/>
    <w:autoSpaceDN w:val="0"/>
    <w:adjustRightInd w:val="0"/>
    <w:ind w:left="540" w:right="6392"/>
    <w:rPr>
     <w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
     <w:color w:val="000000"/>
     <w:sz w:val="20"/>
     <w:szCs w:val="20"/>
    </w:rPr>
   </w:pPr>
   <w:sdt>
    <w:sdtPr>
     <w:rPr>
      <w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
      <w:color w:val="000000"/>
      <w:sz w:val="20"/>
      <w:szCs w:val="20"/>
     </w:rPr>
     <w:alias w:val="Producer"/>
     <w:tag w:val="Signature_Producer"/>
     <w:id w:val="1000"/>
     <w:dataBinding w:xpath="OpportunityTeam[Role='Originator']/Name" w:storeItemID="{79C40D76-FB76-4FE7-B052-92866EE52A78}"/>
     <w:lock w:val="sdtLocked"/>
     <w:showingPlcHdr/>
     <w:showingPlcHdr/>
     <w:placeholder>
      <w:docPart w:val="DefaultPlaceholder_Text"/>
     </w:placeholder>
    </w:sdtPr>
    <w:sdtEndPr/>
    <w:sdtContent>
     <w:r>
      <w:rPr>
       <w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
       <w:color w:val="000000"/>
       <w:sz w:val="20"/>
       <w:szCs w:val="20"/>
      </w:rPr>
      <w:t>_____</w:t>
     </w:r>
    </w:sdtContent>
   </w:sdt>
  </w:p>
  <w:p w:rsidRPr="00FB59AD" w:rsidR="00611650" w:rsidP="00543E0E" w:rsidRDefault="00611650">
   <w:pPr>
    <w:widowControl w:val="0"/>
    <w:autoSpaceDE w:val="0"/>
    <w:autoSpaceDN w:val="0"/>
    <w:adjustRightInd w:val="0"/>
    <w:jc w:val="both"/>
    <w:rPr>
     <w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
     <w:b/>
     <w:bCs/>
     <w:color w:val="000000"/>
     <w:sz w:val="20"/>
     <w:szCs w:val="20"/>
    </w:rPr>
   </w:pPr>
  </w:p>
  <w:p w:rsidRPr="00FB59AD" w:rsidR="005501B2" w:rsidP="00543E0E" w:rsidRDefault="000836D8">
   <w:pPr>
    <w:widowControl w:val="0"/>
    <w:autoSpaceDE w:val="0"/>
    <w:autoSpaceDN w:val="0"/>
    <w:adjustRightInd w:val="0"/>
    <w:jc w:val="both"/>
    <w:rPr>
     <w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
     <w:b/>
     <w:bCs/>
     <w:color w:val="000000"/>
     <w:sz w:val="20"/>
     <w:szCs w:val="20"/>
    </w:rPr>
   </w:pPr>
   <w:sdt>
    <w:sdtPr>
     <w:rPr>
      <w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
      <w:color w:val="000000"/>
      <w:sz w:val="20"/>
      <w:szCs w:val="20"/>
     </w:rPr>
     <w:alias w:val="Signature_P"/>
     <w:tag w:val="Signature_P"/>
     <w:id w:val="1001"/>
     <w:showingPlcHdr/>
     <w:picture/>
     <w:placeholder>
      <w:docPart w:val="DefaultPlaceholder_Text"/>
     </w:placeholder>
    </w:sdtPr>
    <w:sdtEndPr/>
    <w:sdtContent>
     <w:r>
      <w:drawing>
       <wp:inline distT="0" distB="0" distL="0" distR="0" wp14:editId="50D07946">
        <wp:extent cx="990000" cy="792000"/>
        <wp:effectExtent l="0" t="0" r="0" b="0"/>
        <wp:docPr id="1" name="Picture1"/>
        <wp:cNvGraphicFramePr>
         <a:graphicFrameLocks xmlns:a="" noChangeAspect="1"/>
        </wp:cNvGraphicFramePr>
        <a:graphic xmlns:a="">
         <a:graphicData uri="">
          <pic:pic xmlns:pic="">
           <pic:nvPicPr>
            <pic:cNvPr id="0" name="Picture1jpg"/>
            <pic:cNvPicPr/>
           </pic:nvPicPr>
           <pic:blipFill>
            <a:blip r:embed="R6bfdd73efae547c0" cstate="print">
             <a:extLst>
              <a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}"/>
             </a:extLst>
            </a:blip>
            <a:stretch>
             <a:fillRect/>
            </a:stretch>
           </pic:blipFill>
           <pic:spPr>
            <a:xfrm>
             <a:off x="0" y="0"/>
             <a:ext cx="990000" cy="792000"/>
            </a:xfrm>
            <a:prstGeom prst="rect">
             <a:avLst/>
            </a:prstGeom>
           </pic:spPr>
          </pic:pic>
         </a:graphicData>
        </a:graphic>
       </wp:inline>
      </w:drawing>
     </w:r>
    </w:sdtContent>
   </w:sdt>
   <w:bookmarkStart w:name="_GoBack" w:id="1"/>
   <w:bookmarkEnd w:id="1"/>
  </w:p>
  <w:sectPr w:rsidRPr="00FB59AD" w:rsidR="005501B2" w:rsidSect="000028C4">
   <w:headerReference w:type="default" r:id="Re80fb6104d05440c"/>
   <w:footerReference w:type="default" r:id="Rc757831e72ba42bd"/>
   <w:pgSz w:w="12240" w:h="15840"/>
   <w:pgMar w:top="547" w:right="720" w:bottom="274" w:left="720" w:header="274" w:footer="274" w:gutter="0"/>
   <w:cols w:space="720"/>
   <w:titlePg/>
   <w:docGrid w:linePitch="360"/>
  </w:sectPr>
 </w:body>
</w:document>


Document.xml content when image is shown


 <w:body>
  <w:p w:rsidRPr="00FB59AD" w:rsidR="005501B2" w:rsidP="00543E0E" w:rsidRDefault="00F71900">
   <w:pPr>
    <w:widowControl w:val="0"/>
    <w:autoSpaceDE w:val="0"/>
    <w:autoSpaceDN w:val="0"/>
    <w:adjustRightInd w:val="0"/>
    <w:jc w:val="both"/>
    <w:rPr>
     <w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
     <w:b/>
     <w:bCs/>
     <w:color w:val="000000"/>
     <w:sz w:val="20"/>
     <w:szCs w:val="20"/>
    </w:rPr>
   </w:pPr>
   <w:sdt>
    <w:sdtPr>
     <w:rPr>
      <w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
      <w:color w:val="000000"/>
      <w:sz w:val="20"/>
      <w:szCs w:val="20"/>
     </w:rPr>
     <w:alias w:val="Signature_P"/>
     <w:tag w:val="Signature_P"/>
     <w:id w:val="1000"/>
     <w:showingPlcHdr/>
     <w:picture/>
     <w:placeholder>
      <w:docPart w:val="DefaultPlaceholder_Text"/>
     </w:placeholder>
    </w:sdtPr>
    <w:sdtEndPr/>
    <w:sdtContent>
     <w:r>
      <w:drawing>
       <wp:inline distT="0" distB="0" distL="0" distR="0" wp14:editId="50D07946">
        <wp:extent cx="990000" cy="792000"/>
        <wp:effectExtent l="0" t="0" r="0" b="0"/>
        <wp:docPr id="1" name="Picture1"/>
        <wp:cNvGraphicFramePr>
         <a:graphicFrameLocks xmlns:a="" noChangeAspect="1"/>
        </wp:cNvGraphicFramePr>
        <a:graphic xmlns:a="">
         <a:graphicData uri="">
          <pic:pic xmlns:pic="">
           <pic:nvPicPr>
            <pic:cNvPr id="0" name="Picture1jpg"/>
            <pic:cNvPicPr/>
           </pic:nvPicPr>
           <pic:blipFill>
            <a:blip r:embed="R00e39305099a416e" cstate="print">
             <a:extLst>
              <a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}"/>
             </a:extLst>
            </a:blip>
            <a:stretch>
             <a:fillRect/>
            </a:stretch>
           </pic:blipFill>
           <pic:spPr>
            <a:xfrm>
             <a:off x="0" y="0"/>
             <a:ext cx="990000" cy="792000"/>
            </a:xfrm>
            <a:prstGeom prst="rect">
             <a:avLst/>
            </a:prstGeom>
           </pic:spPr>
          </pic:pic>
         </a:graphicData>
        </a:graphic>
       </wp:inline>
      </w:drawing>
     </w:r>
    </w:sdtContent>
   </w:sdt>
  </w:p>
  <w:p w:rsidRPr="00FB59AD" w:rsidR="00650BE8" w:rsidP="00543E0E" w:rsidRDefault="00650BE8">
   <w:pPr>
    <w:widowControl w:val="0"/>
    <w:autoSpaceDE w:val="0"/>
    <w:autoSpaceDN w:val="0"/>
    <w:adjustRightInd w:val="0"/>
    <w:rPr>
     <w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
     <w:b/>
     <w:bCs/>
     <w:color w:val="000000"/>
     <w:sz w:val="20"/>
     <w:szCs w:val="20"/>
    </w:rPr>
   </w:pPr>
  </w:p>
  <w:p w:rsidRPr="00FB59AD" w:rsidR="00B30783" w:rsidP="00B30783" w:rsidRDefault="00F71900">
   <w:pPr>
    <w:widowControl w:val="0"/>
    <w:tabs>
     <w:tab w:val="left" w:pos="3880"/>
    </w:tabs>
    <w:autoSpaceDE w:val="0"/>
    <w:autoSpaceDN w:val="0"/>
    <w:adjustRightInd w:val="0"/>
    <w:ind w:left="540" w:right="6392"/>
    <w:rPr>
     <w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
     <w:color w:val="000000"/>
     <w:sz w:val="20"/>
     <w:szCs w:val="20"/>
    </w:rPr>
   </w:pPr>
   <w:sdt>
    <w:sdtPr>
     <w:rPr>
      <w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
      <w:color w:val="000000"/>
      <w:sz w:val="20"/>
      <w:szCs w:val="20"/>
     </w:rPr>
     <w:alias w:val="Producer"/>
     <w:tag w:val="Signature_Producer"/>
     <w:id w:val="1001"/>
     <w:dataBinding w:xpath="OpportunityTeam[Role='Originator']/Name" w:storeItemID="{79C40D76-FB76-4FE7-B052-92866EE52A78}"/>
     <w:lock w:val="sdtLocked"/>
     <w:showingPlcHdr/>
     <w:placeholder>
      <w:docPart w:val="DefaultPlaceholder_Text"/>
     </w:placeholder>
    </w:sdtPr>
    <w:sdtEndPr/>
    <w:sdtContent>
     <w:r>
      <w:rPr>
       <w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
       <w:color w:val="000000"/>
       <w:sz w:val="20"/>
       <w:szCs w:val="20"/>
      </w:rPr>
      <w:t>_____</w:t>
     </w:r>
    </w:sdtContent>
   </w:sdt>
  </w:p>
  <w:sectPr w:rsidRPr="00FB59AD" w:rsidR="00B30783" w:rsidSect="000028C4">
   <w:headerReference w:type="default" r:id="Rea4355789ec24642"/>
   <w:footerReference w:type="default" r:id="R10c99469143a4520"/>
   <w:pgSz w:w="12240" w:h="15840"/>
   <w:pgMar w:top="547" w:right="720" w:bottom="274" w:left="720" w:header="274" w:footer="274" w:gutter="0"/>
   <w:cols w:space="720"/>
   <w:titlePg/>
   <w:docGrid w:linePitch="360"/>
  </w:sectPr>
 </w:body>
</w:document>

note: removed namespace links and change name of the picture from picture1.jpg to picturejpg as it did not permit to post otherwise.

Any help is highly appreciated


How to insert a combobox in a spreadsheet by code behind c# using Open XML Format SDK

$
0
0

Hello,

   I'd like to insert a combobox in a spreadsheet by code behind c# using Open XML Format SDK.

   I found usefull info for lots of things under http://msdn.microsoft.com/EN-US/library/office/cc861607(v=office.15).aspx

    but not this.

Thanks for any help.

Claude

How to inject dynamic behavior in an Excell using Open XML Format SDK

$
0
0

Hello,

   I need to inject dynamic behavior in an excell sheet generated by c# code in Sharepoint.
   As for example, a user can see values in a combobox only if another combobox select a specific value.
   I suppose it is about VBA injection (or not?).
   
   Is that at all possible with Open XML Format SDK ? 
   If not what should I have to use to achieve this goal?
   
Thank you for any help.
CLaude


Making Sense of Validation Errors

$
0
0

I have written code to generate a Word document using OpenXml. I can load the document into Word and it looks okay.

However, running the Validate command in the Open XML SDK 2.0 Productivity Tool for Microsoft Office, it reports a large number of errors that I'm trying to resolve. But they aren't making much sense to me. For example:

Error Node Type: ParagraphProperties
Error Part: /word/document2.xml
Error Node Path: /w:document[1]/w.body[1]/w:p[2]/w:pPr[1]
Related Node Type: ParagraphBorders
Related Part: (blank)
The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:pBdr'. 

As best I can read this, it's complaining about the w:pBdr (ParagraphBorders) within a w:pPr (ParagraphProperties). However, ParagraphBorders is listed as a valid child of ParagraphProperties. Moreover, if I create a document with an underline in Word, it creates a ParagraphBorders element as a child of ParagraphProperties.

So what does the error mean?


Jonathan Wood • Black Belt Coder

OpenXmlPackageException Invalid Hyperlink Malformed URI while opening docx File

$
0
0

Hey,

I'm using the Office SDK to edit docx file's custom properties. For 21 out of 23 files the code does what it is supposed to do but for the other two files it throws this exception.

http://www.pic-upload.de/view-24311762/error.jpg.html

I already found http://social.msdn.microsoft.com/Forums/office/en-US/8147fa29-6e55-4f4e-9d60-c07ea3779042/how-to-validate-a-word-document-using-openxml-sdk-25 question and used the code to validate my doc but it looked like the code accepted my doc.

I've also visited https://github.com/OfficeDev/Open-XML-SDK/issues/7 which looks somehow like my exception but it didn't help me..

Thanks in advance!

PS: Sorry that the links are in plain text but i can't post them because my account is too new :3

Disable Macros in OpenXml using asp.net

$
0
0

Hi I am using OpenXml in asp.net . In that i am trying to open the macro enabled excel and insert the data into the excel. For that i needs to disable all the macros in the Excel. Then only i can able to write into that. Is there anyway to disable it ? . 

Please help me out. 

Create PPT slides of dynamic number via Open XML...

$
0
0

HI,

I need to create Slide Deck which will have dynamic number of slides. How it can be done ? Can i create slide parts in a loop as most of slides are same , it's just data will be different.

Let me know the way it is possible ?

Open XML Excel to Detect Track Changes

$
0
0

Hi,

Currently I am using the following code to detect Track Changes in an Excel file.

using (var document = SpreadsheetDocument.Open(tempFilePath, false))
{
    if (document.WorkbookPart.WorkbookRevisionHeaderPart != null
        && document.WorkbookPart.WorkbookRevisionHeaderPart
            .GetPartsCountOfType<WorkbookRevisionLogPart>() != 0)
    {
        hasChanges.HasTrackChanges = true;
    }
}

This works fine however I need to extend it to only detect Track Changes that have not been accepted. Do anyone have suggestions to how this could be done?

Thanks

Viewing all 1288 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>