Hi ,
I have developed vb.net application to create docx (using Openxml ) now I want to merge these docx documents into single document runtime using .net code , please help me to solve this problem.
Thank you in advance
Umesh.
Hi,
I am trying to merge word documents in sharepoint document library. Some pages in the docs are in portrait and some in landscape. after merging documents all the pages in the documents r displayed in portrait mode. how can i retain page orientation programmatically ?
Plz let me know how to insert section properties after each page or each document ?
here is my code
Appreciate your help..
foreach (SPFile item in listitem.Folder.Files)
{
// SPFile inputFile = item.File;
SPFile inputFile = item;
string altChunkId = "AltChunkId" + id;
id++;
byte[] byteArray = inputFile.OpenBinary();
AlternativeFormatImportPart chunk = outputDoc.MainDocumentPart.AddAlternativeFormatImportPart(AlternativeFormatImportPartType.WordprocessingML,
altChunkId);
using (MemoryStream mem = new MemoryStream())
mem.Write(byteArray, 0, (int)byteArray.Length);
mem.Seek(0, SeekOrigin.Begin);
chunk.FeedData(mem);
}
AltChunk altChunk = new AltChunk();
altChunk.Id = altChunkId;
outputDoc.MainDocumentPart.Document.Body.InsertAfter(altChunk,
outputDoc.MainDocumentPart.Document.Body.Elements<Paragraph>().Last());
outputDoc.MainDocumentPart.Document.Save();
outputDoc.Close();
memOut.Seek(0, SeekOrigin.Begin);
ClientContext clientContext = new ClientContext(SPContext.Current.Site.Url);
ClientOM.File.SaveBinaryDirect(clientContext, outputPath, memOut, true);
// Conversion