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

Open xml relationship target is NULL when inserting chart

$
0
0

Hi,

I have looked into the specification ISO/IEC 29500-1:2012 and i understand that the attribute Target for the element Relationship can be set to NULL at times(Empty header and footer in the specification).

Now, i have stumbled on Target being NULL also when inserting a diagram into a word document. For example:

<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"Target="NULL" TargetMode="External" xmlns="http://schemas.openxmlformats.org/package/2006/relationships" />

I'm using Open xml sdk and i'm trying to create a relationship. My question is how i should resolve the target which i think should point to the diagram/chart that i inserted.

Br,

/Peter


Peter


Using OpenXML SDK for Universal Apps?

$
0
0

[UWP][C#] Using OpenXML SDK for Universal Apps?

Hi,

I am trying to use the OpenXML library 2.5 in a universal App so save an excel file.

I have discovered multiple issues with trying to do this:

1. I can't add any references.
 2. The only way I can get the library in the solution is via NuGet to add an unofficial
    one.
 3. Even if I do step 2 I still can't compiple becuase I get the error:

The type 'System.IO.Packaging.Package' is defined in an assembly that is not referenced. You must add a reference to assembly 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Since I can't do "1" I am stuck

So here are my questions:

1. So I am wondering how I can resolve this to use this libary this library?
 2. I am assuming this somehow this is because it is a WinRT limitation only allowing a subset of the .NET framework. So I would like to find out if this is the case  and what are the limitations here. What are the requirments to support 3rd partly   libraries if any. Any URLs you can point to so I can get some further information background.

Thanks,

Ward.

I am not getting calculated value after entering required cell in Excel sheet

$
0
0

I tried with below methods, But did not work

1)

spreadSheet.WorkbookPart.Workbook.CalculationProperties.ForceFullCalculation = true;
spreadSheet.WorkbookPart.Workbook.CalculationProperties.FullCalculationOnLoad = true;

2)

 worksheetPart.Worksheet.Reload();

3)

public static void FlushCachedValues(SpreadsheetDocument doc)
        {
            doc.WorkbookPart.WorksheetParts
               .SelectMany(part => part.Worksheet.Elements<SheetData>())
               .SelectMany(data => data.Elements<Row>())
               .SelectMany(row => row.Elements<Cell>())
               .Where(cell => cell.CellFormula != null && cell.CellValue != null)
               .ToList()
               .ForEach(cell => cell.CellValue.Remove());
        }

did not work :(

Please help me on this. Thanks in Advance.


-- Regards, Kiran.D.N Web Developer Kreativepool, Mysore. kirandn at live.com


How to create and run Macro in Excel 2013 in C# using Open Xml Sax?

$
0
0

I recorded the Macro from Excel. How do I create it and execute in C# using Open Xml Sax? There are multiple worksheets in the workbook. I have to open every worksheet and execute the Macro.

Thanks.

DanYeung



How to protect document with password using C# and openxml

$
0
0

Hi

How to create a document with openxml and C# that will pop up a password prompt when open an excel file.

Set Custom Properties in a Word Document using open XML doesn't update text automatically

$
0
0

Hi I developed application to set document properties using open xml sdk following this article 

https://msdn.microsoft.com/en-us/library/office/hh674468.aspx

using (var document = WordprocessingDocument.Open(fileName, true))
            {
                string propertyName = "CO_CUST_NAME";

                var cusProps = document.CustomFilePropertiesPart;
                if (cusProps != null)
                {
                    var props = cusProps.Properties;
                    props.Load(cusProps);
                    if (props != null)
                    {
                        propertyName = "CO_CUST_NAME";
                        var prop = props.Where(p => ((CustomDocumentProperty)p).Name.Value == propertyName).FirstOrDefault();
                        if (prop != null)
                        {
                            var newProp = new CustomDocumentProperty();

                            newProp.VTLPWSTR = new VTLPWSTR("Vikasitha1");
                            newProp.FormatId = "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}";
                            newProp.Name = propertyName;
                            prop.Remove();
                            props.AppendChild(newProp);
                        }

                        propertyName = "CO_DEL_ADDRESS";
                        prop = props.Where(p => ((CustomDocumentProperty)p).Name.Value == propertyName).FirstOrDefault();
                        if (prop != null)
                        {
                            var newProp = new CustomDocumentProperty();
                            newProp.VTLPWSTR = new VTLPWSTR("No 50 Colombo");
                            newProp.FormatId = "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}";
                            newProp.Name = propertyName;
                            prop.Remove();
                            props.AppendChild(newProp);

                        }

                        int pid = 2;
                        foreach (CustomDocumentProperty item in props)
                        {
                            item.PropertyId = pid++;
                        }
                        
                        props.Save();
                    }
                }
            }

and it worked fine

except when I open the document fields doesn't fill up automatically it just stays as blank

but when I right click and click on 'Update Field' it shows the values

I need to fill up these fields automatically. How can I do that, I tried several methods but didn't work.

How to add new slide in presentation using openXml JavaScript??

$
0
0

Hi All,

I am trying to add new slide in my powerpoint presentation using openXml JavaScript but facing some difficulties. I am able to get the slides using below code block. Can anyone give me reference code or a link to refer to add new slide in the document using openXml JavaScript?

var doc = new openXml.OpenXmlPackage(templateDocument);
var presentations = doc.getPartsByRelationshipType(openXml.relationshipTypes.presentation);
var presObj = presentations[0];
var slides = presObj.getPartsByContentType(openXml.contentTypes.slide);

Any help will be appreciated. Thanks in advance.

Add a Caption to an Image in a table Cell

$
0
0

I have a VB.Net program that inserts images into a table in MS Word.

All is well but I want to insert a caption under each image so that when I do a table of Figures the captions will all show up in the Table of figures.

I have a sub that adds the table row and the image goes into the right side cell.

I can't figure out how to generate a caption out the filename for each image.

Any help would be appreciated. Thanks

Paul

 Sub AddTableRow(strFile As FileInfo, ByRef objDocument As WordprocessingDocument)
        'Dim imgElement As Drawing
        Dim tr As New TableRow

        ' Create a cell.
        Dim tc1 As New TableCell
        Dim tc2 As TableCell

        ' Specify the table cell content.

'First cell has filename of image

        tc1.Append(New TableCellProperties(New TableCellWidth() With {.Type = TableWidthUnitValues.Dxa, .Width = "1200"}))
        tc1.Append(New Paragraph(New Run(New Text(strFile.FullName))))
        ' Append the table cell to the table row.
        tr.Append(tc1)

'Second cell has image with filename below. I want the filename to be a proper Word Caption

        tc2 = New TableCell()        
        InsertAPicture(strFile.FullName, tc2, objDocument)
        tc2.Append(New Paragraph(New Run(New Text(strFile.Name))))
        tr.Append(tc2)

        table.Append(tr)

    End Sub


Hiding columns in Excel 2010 file using OpenXML

$
0
0

Hi,

I am using the below shown code to hide the column in an excel 2010 file

 WorksheetPart newWorksheetPart = spreadSheet.WorkbookPart.AddNewPart<WorksheetPart>();                                                        newWorksheetPart.Worksheet = new Worksheet(new SheetData());                                                        Sheets existingSheets = spreadSheet.WorkbookPart.Workbook.GetFirstChild<Sheets>();                            if (existingSheets.Elements<Sheet>().Count() > 0)                            {                                sheetId = existingSheets.Elements<Sheet>().Select(s => s.SheetId.Value).Max() + 1;                            }                            Columns columns = new Columns();                            Column qId = new Column() { Min = (UInt32Value)1U, Max = (UInt32Value)1U, Hidden = true, CustomWidth = true, Width = 0 };                            columns.Append(qId);                            newWorksheetPart.Worksheet.Append(columns);

But the column shows up and when i open the excel file its throw up error. Any reason why its happening like this.

TIA,

Uday Mandava

Read Excel Charts using OpenXML

$
0
0

I need to get chart name and the chart type of two charts where is being in the same excel sheet. 

chart name could be taken from DrawingPart -> WorksheetDrawing -> twoCellAnchor -> GraphicFrame -> NoneVisualGraphicFrameProperties -> NoneVisualDrawingProperties -> Name

From where can I take chart type?

Is it 

DrawingPart -> ChartPart -> ChartSpace  -> Chart -> PlotArea ?

Then How can I map particular chart name to chart type ?

There are two drawingPart and ChartPart within a same WorkbookPart for two different charts. Is there any relational link between chart name and chart type?

Update ziparchive entry

$
0
0

Hello,

I have a docx file that I open with ZipArchive.

I then Locate the .xml entry: "word/webextensions/webextension1.xml".

I then wish to replace some values in that file, and save it.

I've gotten so far that I'm able to read the content of the file. However, I cannot for the life of me figure out how to write new content back to it, and thereby have the .docx file be updated.

This is my code so far:

Stream fs = File.OpenRead(@"C:\TestingDocuments\TestingCheckedOutStatus2.docx");
System.IO.MemoryStream data = new System.IO.MemoryStream();
            System.IO.Stream str = fs;

            str.CopyTo(data);
            data.Seek(0, SeekOrigin.Begin);
            byte[] buf = new byte[data.Length];
            data.Read(buf, 0, buf.Length);
            try
            {
                ZipArchive archive = new ZipArchive(data, ZipArchiveMode.Update);
                foreach (ZipArchiveEntry entry in archive.Entries)
                {


                    if (entry.FullName == "word/webextensions/webextension1.xml")
                    {
                        Stream documentXmlData = entry.Open();
                        StreamReader reader = new StreamReader(documentXmlData);
                        string text = reader.ReadToEnd();
                        Console.write(text);

                        //Write changes to word/webextensions/webextension1.xml and save it to my word document.

                        break;
                    }
                }

            }

Any help is greatly appreciated, I am completely stuck.

Copy a Sheet from an Excel to another ¿is this possible?

$
0
0

Hi everyone,

I'm quite new with SDK and I was trying to copy a sheet from an Excel file stored in a SharePoint library to another Excel, also stored in SP. I'm doing this from a Windows form application, using the .NET client object model for SharePoint and the Open XML SDK 2.0

First, I was  saving both (source and target) files to a temp folder. After adding the sheet, the target Excel crashes.

After this, I try to load the target file in a stream, and I'm able to add a new sheet (empty), however, I can't add the sheet recovered from te source file. I was googling but I was not able to find any example of this, so I'm not sure if this is possible with SDK or I should find a different solution.

Thanks in advance an sorry for my english,

Could not load file or assembly - OpenXML

$
0
0

I have a web site that uses Telerik, which uses OpenXML to generate Excel documents. The Web project and the business projects both reference OpenXML version 2.0.5022.0.  If I open the solution in Visual Studio and view the site using IIS Express, the Excel documents are generated correctly. However, if I build the solution and push it to another web server configured with IIS, I get the 'Could not load file or assembly' page when I attempt to have the site generate an Excel document. The confusing part is that the error indicates that the application is looking for version 2.5.5631.0.  Which is installed on the machines, but I am not trying to use yet.  I did update references to the new versions recently, but that caused Telerik to break.  Now that I've removed those references from the projects and added the old reference back, it seems that the web server keeps trying to look for the newer version-even though the projects all reference version 2.0.5022.0 specifically.  I've attempted copy local and added the DLL to the web servers GAC.  The 2.0.5022.0 version copies correctly and the key is correct, but for some reason the application keeps looking for the new version regardless of what I do.  Does anyone know how to force the application to use the previous version?

The error:

Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)


KJ Dietrich Web Developer

Excel chart reading

$
0
0

Hi there, 
Can I know how to read Y axis values in a chart using Open XML? for example the values of 1, 1.5, 2,2.5 in following chart

Readout datagrid in PowerPoint 2010 and insert datas in new PowerPoint slide

$
0
0

Hello,   I haveaperformanceproblem with myapplication accessedonan activePowerPointpresentation(2010 version). Datas should readout of a datagrid and automatically entered to a PowerPoint slide which has to be created.Each entryof theDataGridis writteninaseparatetext box. It is thisprocess that takes a long time. Does anyone knowstechnology/solutionthat can makethe programmuch more quicker. Program code is writteninC#.

List<Microsoft.Office.Interop.PowerPoint.Shape> ResponsibleTxtbox= new List<Microsoft.Office.Interop.PowerPoint.Shape>();

ResponsibleTxtbox.Add(slide.Shapes.AddTextbox(MsoTextOrientation.msoTextOrientationHorizontal, posLeft, posTop, 0, 0));

                   ResponsibleTxtbox[j].TextFrame2.WordWrap = MsoTriState.msoFalse;

                   ResponsibleTxtbox[j].TextFrame2.TextRange.Font.Size = mFontSize;

                   ResponsibleTxtbox[j].TextFrame2.TextRange.Font.Name = mFontName;

                   ResponsibleTxtbox[j].Tags.Add("TxtBoxType", "RespTxtBox" + j.ToString());

ResponsibleTxtbox[j].TextFrame2.TextRange.Text = responsiblesNames[j];

 

Thx in advanced


Writing Datas over Xml into an active PowerPoint pptx presentation

$
0
0

Hi,

 

I have a problem with Xml and pptx. I have a GUI ansd a datagrid with datas. Now I like to write in an active presentation that datas over Xml to that slide.

 

Often hearded that is not possible, but I have seen it in a tool which make an agenda for a presentation. In that agenda GUI you insert rows with datas and then if you confirm it creates slides in an acticve presentation with that data in 2-2.5 sec. Works fine, big question is how??

 

Programm is written in C#

 

Can anyone help me?

 

Greetings

 

SK

How to insert/embedd html file in word using Open XML SDK

$
0
0

I am using below code to achieve that, But it's not working.Can anyone help me to achive that.

using System;using DocumentFormat.OpenXml.Packaging;using DocumentFormat.OpenXml.Wordprocessing;using DocumentFormat.OpenXml;using v = DocumentFormat.OpenXml.Vml;using ovml = DocumentFormat.OpenXml.Vml.Office;using System.IO;class Program {staticvoid Main(string[] args) {string containingDocumentPath =@"C:\Temp\Souce.docx";string embeddedDocumentPath =@"C:\Temp\Embeddedhtml.html; CreatePackage(containingDocumentPath, embeddedDocumentPath); } privatestaticvoid CreatePackage(string containingDocumentPath,string embeddedDocumentPath) {using (WordprocessingDocument package = WordprocessingDocument.Create(containingDocumentPath, WordprocessingDocumentType.Document)) { AddParts(package, embeddedDocumentPath); } }privatestaticvoid AddParts(WordprocessingDocument parent,string embeddedDocumentPath) {var mainDocumentPart = parent.AddMainDocumentPart(); GenerateMainDocumentPart().Save(mainDocumentPart);var embeddedPackagePart = mainDocumentPart.AddNewPart<EmbeddedPackagePart>("text/html","rId1"); GenerateEmbeddedPackagePart(embeddedPackagePart, embeddedDocumentPath); var imagePart = mainDocumentPart.AddNewPart<ImagePart>("image/x-emf", "rId2"); GenerateImagePart(imagePart); } privatestatic Document GenerateMainDocumentPart() {var element =new Document(new Body(new Paragraph(new Run(new Text("This is the containing document."))),new Paragraph(new Run(new Text("This is the embedded document: "))),new Paragraph(new Run(new EmbeddedObject(new v.Shape(new v.ImageData() { Title = "", RelationshipId = "rId2" } ) { Id = "_x0000_i1025", Style = "width:76.5pt;height:49.5pt", Ole = v.BooleanEntryWithBlankValues.Empty },new ovml.OleObject() { Type = ovml.OLEValues.Embed, ProgId = "Word.Document.12", ShapeId = "_x0000_i1025", DrawAspect = ovml.OLEDrawAspectValues.Icon, ObjectId = "_1299573545", Id = "rId1" } ) { DxaOriginal = (UInt32Value)1531UL, DyaOriginal = (UInt32Value)991UL } ) ) ) );return element; }publicstaticvoid GenerateEmbeddedPackagePart(OpenXmlPart part,string embeddedDocumentPath) {byte[] embeddedDocumentBytes;// The following code will generate an exception if an invalid// filename is passed.using (FileStream fsEmbeddedDocument = File.OpenRead(embeddedDocumentPath)) { embeddedDocumentBytes =newbyte[fsEmbeddedDocument.Length]; fsEmbeddedDocument.Read(embeddedDocumentBytes, 0, embeddedDocumentBytes.Length); } using (BinaryWriter writer =new BinaryWriter(part.GetStream())) { writer.Write(embeddedDocumentBytes); writer.Flush(); } }publicstaticvoid GenerateImagePart(OpenXmlPart part) {#region Icon Bytes// Best practice is that this icon should be stored as a resource// in the assembly instead of as a Base64 string.string iconBytes = @" AQAAAGwAAAAAAAAAAQAAAGQAAAAuAAAAAAAAA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77eT//O3k//vs5P/77OP//Ov i//vr4v/76+D/++rf//vp3//76d3/++jc//rn2v/65tr/+uTY//rk1v/54tT/+uHT// rg0f/538//+d7N//ncyv/znWf/YEgw/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AC7p5j//O/n//zv5//77+b//O/m//zv5v/87eX//O3k//zt5P/87OP//Ovi//zq4f/8 6t//++re//vo3P/759v/+uba//rl1//65NX/+uLT//nh0f/64ND/+t/O//Keav9gSDD /AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALyomP/88er//PHp//zx6v/88On//P Dp//zw6P/97+j//O/n//zu5v/87uX//O3k//zs4//87OH/06mL/9Koif/Rpof/0aWG/ 9CkhP/Po4P/+uPV//rh0v/64ND/8aBt/2BIMP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAvama//3z7f/98+3//fPs//3y7P/98+v//fLr//zy6v/98er//fHp//zw6P/ 87+f//O7m//zt5P/87eP//Ovh//vq3//76d3/++jc//rm2f/65Nf/+uPW//ri0//won D/YEgw/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC+qpv//fXv//307//jwaj/4 r+l/+G9o//fu6H/3rme/923nP/btZr/2rOX/9mxlf/YsJP/166R/9asj//Vq43/1KmL /9Koif/Spoj/0aWG//vn2v/65dj/+uPW/++jc/9gSDD/AAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAL+rnP/+9vH//fbx//328f/99vH//fbx//718P/99fD//fXw//307/ /98+7//fPt//3y7P/88er//PDp//zv5//87uX//O3k//zr4v/86t//++jd//vn2v/65 dj/7aV3/2BIMP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKye//348//99/P/ 5sWt/+XDq//jwaj/4b6l/+C8ov/euqD/3rmf/923nP/ctpr/2rSY/9mylv/YsJP/166 R/9atj//Vq43/1KqL/9Ooiv/76uD/++nd//vn2//tp3v/YEgw/wAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAADBrp7//vn1//759f/++fX//vj1//749f/++PX//vj1//339 P/+9/P//vfz//338v/99vH//fXw//307v/98+3//PLr//zx6f/87+f//O7k//vs4v/7 6uD/++jd/+upf/9gSDD/AAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAMKun//++vf //vr3/+jJsf/nx6//5sWt/+XDq//jwqj/4sCm/+G+pP/gvKH/3rqf/924nP/ctpr/2r SY/9mylv/YsJT/166R/9atj//Vq47//O7l//zs4//76t//6auD/2BIMP8AAAAAAAAAA AAAAAAAAAABAAAABQAAAA0AAAAUrpyP/9/c2f/b2NX/1dHO/9DLyv/JxcP/xcG//8rG xP/Oysj/8ezp//v28//9+PX//vj1//749P/+9/P//fbx//318P/99O3//fLr//zx6f/ 87+f//O3k//zs4v/orof/YEgw/wAAAAAAAAAAAAAAAQAAAAMAAAAOAAAAIgAAADWQgX b/tLGv/62rqf+TfGv/mIN0/6KQgv+3p5n/yrus/8Ksmf+6oY//3bqh/+C9o//gvKL/3 rqf/924nf/ctpv/27SY/9mylv/YsJT/16+S//zx6f/97+f//O3k/+avi/9gSDD/AAAA AAAAAABuOSXAczwnzWw4JNF5VEbekHpw6q+dlv/FuLL/3tbS//Xx7P/8+PP/+/bv//n 06//48uf/vqmb/9jW1P/r6Ob//fr4//77+f/++vj//vn2//749f/99/P//fbx//307/ /98+3//fLr//3w6P/87ub/5bGP/2BIMP8AAAAAAAAAAIxLMPDeuar/vpqL/9Gmlf/// //////////////+/vz//vz6//369v/8+PP/+/bv//n06//Bqpz/v6OO/9KznP/jwaj/ 4sCn/+G+pP/gvKL/37qg/924nf/ctpv/27SY/9qzlv/98+3//PHq//zw6P/ls5L/YEg w/wAAAAAAAAAAjk0z8Nq2qf+xclj/0720///////68vD/6MS9///////z4t3/2Z6T// 369v/8+PP/+/bv/828sP/U0tL/6+no//78+//+/Pv//vz6//77+f/++vj//vn2//749 P/99/P//fbx//307v/98u3//fHq/+S1lv9gSDD/AAAAAAAAAACQUDbw2bWm/6RTMf+4 jXv///////nx7/+3XEX/9+3q//Hg3P+zVDv/7NTN//369v/8+PP/2MvB/9HPz//q6Oj //vz8///9/P/OoYH/zqGB/86hgf/OoYH/zqGB/86hgf/OoYH//vXw//307v/98uz/4r ea/2BIMP8AAAAAAAAAAJJSOfDYtKT/ok8s/6RoT////////v38/6RHJ/+/fWf/79/Z/ 6dNL/+5cln//Pj1//369v/j2NH/z87N/+no5//+/fz///38//PKqv/mvqL/58On/+e/ pP/is5P/5LaX/86hgf/+9vH//fTv//3z7f/huZz/YEgw/wAAAAAAAAAAlFU88Nizpf+ iTyz/kEUm////////////n0gk/8WQev/Il4P/oEon/9WwoP/Ooo///vz6//Dq5f/My8 v/6Ofn//79/f///v3/88qq/9mpiP/fspL/5bmb/+Cxkv/kt5n/zqGB//728v/99vD// fPu/+G6n/9gSDD/AAAAAAAAAACWWD/w2LSl/6RPLf+LORb/8evp//////+lVTP/6dbO /7FrTv+fSSb//v38/69nSf/v4dn/+/j2/8nIyP/m5eX//fz8///+/f/zyqr/6cGl/+j DqP/mvqL/3q+O/+O4mf/OoYH//vfz//328f/99e//37uh/2BIMP8AAAAAAAAAAJlbQf Dmy8H/x451/7F3X//h1c//+/j3/6ZXNv/VsKD/7+Hc/6ZXNv//////wYly/7yAZ//+/ vz/y8rK/+Xk5P/9/Pz///79//PKqv/049f/7NjK//v18P/kwqr/48Gn/+K/pf/eu6X/ 3rul/967pf/fvKP/YEgw/wAAAAAAAAAAm15E8OnQx//PmoX/vYZx/9bCuv/59PH/69j R/+zb1P/////////////////////////////////R0ND/5eTk//z7+////v3/88qq// 359v/+/f3/69fJ/76snf+MdmP/iHJe/4FrV/96Y07/cltF/2pTPP9gSDD/AAAAAAAAA ACVXEPk59DG/9eql//IlH//z7Oo//////////////////////////////////////// /////////+Df3//p6Oj//fz8///+/f/zyqr///////v07//049f/v62d/+zSv//qzrv /58q1/+TErv/hvqn/YEgw/yUkJCkAAAAAAAAAAG1EM6XVsKH/8N3W/9Sij//VsaL/// ////////////////////38/P/x6eX/8+zq//Tv7v/cysL/9PPz//v6+v/+/f3///7+/ /PKqv/zyqr/88qq//PKqv/Brp///+7k//vo3P/03tD/7tTD/2BIMP8lJCQpGBgXGgAA AAAAAAAAIBQPMKhrUfzkyL7/8uDa/9KllP/SpZT/0qWU/9Wol//XqZj/16mY/9iqmP/ SpZT/0qWU/7WEbv/8+/v//v39///+/v///v7///79//7+/f///fz///37/8KwoP//7u T/++jc//Xe0P9lTjb/JSQkKRgYFxoAAAAAAAAAAAAAAAAAAAAAQSkgYKZrUvbUrp//9 eXf//Tk3v/05N7/9OTe//Xl3//15d//9eXf//Xl3//15d//u4hz//79/f///v7///7+ ///+/v///v3///39///9/P///fv/xLKj///u5P/76Nz/bFU+/yUkJCkYGBcaAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAFg4LIXFJOKWcZU3kr3JX/69yV/+vclf/r3JX/69yV/+vclf/r3JX/69yV/+9i3T///7+///+/v///v7///7+///+/v///v3///39///9/P/Gt KT//+7k/4NuWf8lJCQpGBgXGgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAADRv7H//////////////////////////////////////////////////// ////+/v////7///7+///+/v///f3///38/8i1pf+chnT/JSQkKRgYFxoAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANG/sf/Rv7H/0b+x/9G/s f/QvrD/z72v/8+9r//PvK7/zbut/827rP/Nuaz/zLmr/8u4qv/Kt6n/yreo/8m2p//I tqf/ybam/yUkJCkXFxcZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAY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AeQAAAAAADgAAABQAAAAAAAAAEAAAABQA AAA=";#endregionusing (BinaryWriter writer = new BinaryWriter(part.GetStream())) { writer.Write(System.Convert.FromBase64String(iconBytes)); writer.Flush(); } } }


Wrap text in header in word using Open XML SDK(C#)

$
0
0

Hello All,

I am using open xml format SDK to generate word document using c#. One of the issue I am facing is wrapping text in the header. Existing text is shown half in one line and another half of the text in another line. Need to make sure that the text is shown in the next line using wrapping.

Please guide me on this.

Here is the code I am using for it.

Run run8 = new Run() { RsidRunProperties = "0068783B", RsidRunAddition = "0068783B" };

            RunProperties runProperties8 = new RunProperties();
            RunStyle runStyle1 = new RunStyle() { Val = "tablecopy" };
            RunFonts runFonts8 = new RunFonts() { Ascii = "Arial", HighAnsi = "Arial", ComplexScript = "Arial" };
            Color color5 = new Color() { Val = "333333" };
            FontSize fontSize8 = new FontSize() { Val = "20" };
            FontSizeComplexScript fontSizeComplexScript6 = new FontSizeComplexScript() { Val = "20" };

            runProperties8.Append(runStyle1);
            runProperties8.Append(runFonts8);
            runProperties8.Append(color5);
            runProperties8.Append(fontSize8);
            runProperties8.Append(fontSizeComplexScript6);
            runProperties8.Append(wr);
            Text text7 = new Text();
            if (regionname != string.Empty)
            {
                text7.Text = regionname;
            }
            else
            {
                text7.Text = "";
            }
            
            run8.Append(runProperties8);
            run8.Append(text7);

Embedding Documents/Object in Word by Using the Open XML SDK

$
0
0

Hi,

With the help of following link "http://msdn.microsoft.com/en-ca/library/ee355229.aspx" i am able to embed documents in word successfully. After inserting the document as object i have to mention the file name for the object. Is there any way to mention the Object name using code?. 

And if i try to insert more than one object (different files) in document it shows the second object as image. How to insert more than one object in word document?.

Thanks in advance :)

text for content controls

$
0
0

I’m looking to create a knowledge base with Word 2013 documents that draw on thousands of snippets of text, so that whenever a string is modified the changes can be updated quickly. I’ve tried doing it with content controls and a custom XML file, but the instructions I find never seem to cover all the steps. (The strings average about two sentences, and documents hundreds of strings in each.)

Viewing all 1288 articles
Browse latest View live


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