OpenXml two column on selected paragraph - openxml

I am using officegen in node js to create docx file pragmatically. It is using openxml to create document.I want to create two column on on selected or specified paragraph.
I use the following code.But it make whole document two column.
<w:sectPr>
<w:cols w:num="2" w:space="720"/>
</w:sectPr>
The link I followed http://officeopenxml.com/WPsectionCols.php

Related

DSpace 6 - Custom Metadata Field

In DSpace 6.3, when I try to export metadata in a particular collection where .csv file will be downloaded in that file how could I add a custom field or column of fulltextpdf column or Name of the file column where can I modify to get this column.
I have attached the .csv file, So please guide me to solution to add a custom column in the metadata.
When I export the metadata so that I could get all the fields including added column.
Thanks & Regards
Sai Kumar S
I have attached the .csv file, So please guide me to solution to add a custom column in the metadata.
When I export the metadata so that I could get all the fields including added column.
[enter image description here][1]
[1]: https://i.stack.imgur.com/KLlne.png

export column in mongodb and replace with file path

I'm new to Mongodb. I'm trying to export a column content from MongoDB collection into flat files and store them in Azure blob and replace the column content with path for exported files.
Originally, pdf files were stored in a column in the collection, but now the decision was made to export the column contents back into pdf files and reference the files by location instead in the same column.
Hope this makes sense.
Thank you

How to make repeated content control through OpenDoPE add-in

I have table with one row of content controls. I need to repeat the row as per the data xml using OpenDoPE add-in of MS Word
See the below table and xml mapping which I have done.
Currently there is one row node in xml so one row of content-control is enough. But when I add more row nodes in xml the content control is not repeating.
Help me to resolve this
Looks like you are using the "first/oldest" AddIn from https://opendope.org/implementations.html
There is a description of how to use it at http://www.opendope.org/WordAddIn_walkthrough.pdf
But you are probably better off using http://www.opendope.org/downloads/authoring-friendly/setup.exe which uses the drag/drop approach Microsoft introduced in Word 2013.
This answer uses that. (Before installing it, first uninstall the old one, using Windows "Programs and Features").
Using sample XML:
<myxml>
<rows>
<row>
<name>Abh</name>
<company>Standout</company>
<designation>Dev</designation>
</row>
<row>
<name>Name2</name>
<company>Co2</company>
<designation>Design2</designation>
</row>
</rows>
</myxml>
(note the rows element) and name, company and designation already mapped as per your question:
select the table row, then in the XML Mapping task pane, right click on row (ie the first of the siblings to be repeated, not the parent), choose Repeat > Insert Content Control:
In Design Mode, you should now see:
(note the od:repeat around the three table cells)
Save the docx, then you can try using https://github.com/plutext/docx4j/blob/master/src/samples/docx4j/org/docx4j/samples/ContentControlBindingExtensionsOld.java (update line 69 to point at your docx).
Any way I found myself a solution to this. The problem was regarding the designing of repeated content control in my template docx. I just created a rich text content control and placed my entire row (which contains the name, company, designation content controls) inside it and mapped as repeated. This resolved my problem. See the below content control design
Here is the xml mapping of name field
here is the xml mapping of repeated content controll (row)

How to split table cells in Open Xml?

I have a document with a table. I need to be able to add columns to a specific row, while maintaining the original table width.
Essentially I need to SPLIT table cells. How can I do this using open xml for a word document?
I tried
var tc = new TableCell();
tc.Append(new Paragraph(new Run(new Text("Hi"))));
row.Append(tc);
I tried just adding more cells, however it acts as new column and increases the size of the table.
First of all create a table in microsoft word and split cell there. Now open your word document in OpenXML SDK Development Tool which can be downloaded from here. If you look at the relevent cell in OpenXML, you will find the answer to your problem. Just copy code from OpenXML and make any necessory changes according to your requirements.

How to automatically create Word documents which include list fields from a custom SharePoint list?

Is it possible to automatically create Word documents which include list fields from a custom SharePoint list?
here is the scenario:
- custom list (over 100 columns)
- Word templates (not sure where is best to store them yet)
- Entry Form will provide data for the templates (or partial data, ie Client name, Sales Rep)
- a form that will have buttons (ie 'Create Order Form', 'Create PO')
the idea is to be able to generate partial populated templates from a custom list with a puch of a button.
You should look into the Word Control Toolkit, which uses the Open XML format SDK to achieve what you require.
The basic functionality is that you use the Edit Control Block on a selected list item to generate and populate a Word document using a template you can select from a drop-down list.
I've used it successfully to create printable invoices based on a contracts list.
Here's some links to get you started:
Generating Documents from SharePoint Lists with Open XML Content Controls
Word Content Control Toolkit (Codeplex)
Video Demo: Merging SharePoint List Data into Word Documents
Linking Word 2007 Content Controls to Custom XML
If you create a document library with custom fields (or better yet a content type), Office 2007 documents will include the fields as properties of the document. Word inludes features to add those fields to the document (Insert->QuickParts-Document Property).
You can automate the placement of items on the document by adding a document template to your content type.
I know your post is old but if you are still available, can your proposition be more detailed:
"If you create a document library with custom fields (or better yet a content type), Office 2007 documents will include the fields as properties of the document. Word inludes features to add those fields to the document (Insert->QuickParts-Document Property).
You can automate the placement of items on the document by adding a document template to your content type."