|
|||||||
| TX Text Control .NET Server Please use this forum for TX Text Control .NET Server support only. If you need support for a different product, please use the appropriate forum. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Multiple document merge : AccessViolationException
Hi,
First, sorry for my bad english , i'm french. I post because i have problem with merging multiple document. When i add documents to ServerTextControl.Selection, i catch an AccessViolationException.code : Code:
WordFile word = new WordFile(new ServerTextControl());
word.stc.Create();
foreach (String path in pathList)
{
word.stc.Selection.Load(path, GetFormat(path));
if (word == null)
{
word = LoadFile(path);
}
else
{
word.stc.Selection.Load(path, GetFormat(path));
}
File.Delete(path); // on supprime les fichiers temporaires crées
}
Process : In this application, users can check documents and download a merged document resulting of the merging of selected documents. So multiple documents merging does not working, whereas single generation is working. I don't know how i can fix this. I hope i was clear and understandable. Thanks |
|
#2
|
||||
|
||||
|
Re: Multiple document merge : AccessViolationException
Hello there,
Do you want to append or insert a document? To append a document, please test the Append method.
__________________
Regards, Gunnar Giffey, TX Text Control [Forum Administrator] |
|
#3
|
|||
|
|||
|
Re: Multiple document merge : AccessViolationException
Hello, thanks for reply.
I want to append one or several documents to a single one. I try to use the "Append Method", but with the same results... I believe i'm using the same methods which is described in documentation. Quote:
Code:
[C#]
foreach(string document in mergeDocs)
{
TXTextControl.StreamType streamType = new TXTextControl.StreamType();
if (document.EndsWith("doc"))
streamType = TXTextControl.StreamType.MSWord;
else if (document.EndsWith("rtf"))
streamType = TXTextControl.StreamType.RichTextFormat;
else if (document.EndsWith("htm"))
streamType = TXTextControl.StreamType.HTMLFormat;
try
{
serverTextControl1.Selection.Load(Server.MapPath(document), streamType);
}
catch(Exception ex)
{
Response.Write("<font color=red><b>An error has occurred:</b><br>");
Response.Write(ex.ToString() + "</font>");
return;
}
counter++;
if(CheckBox1.Checked == true &&A counter != mergeDocs.Count)
{
serverTextControl1.Selection.Text = "\n\f\n";
}
}
|
|
#4
|
||||
|
||||
|
Re: Multiple document merge : AccessViolationException
I do not see the Append method in your code.
Which version are you currently using? Also, do you see any chance to reproduce your issue outside of your main project in another simple sample?
__________________
Regards, Gunnar Giffey, TX Text Control [Forum Administrator] |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Merging Multiple Documents into One Document | brycare | TX Text Control .NET Server | 3 | February 15, 2010 15:10:43 |
| Multiple Trays and Merge Field Switches | Optima | TX Text Control .NET Server | 0 | October 7, 2008 08:48:35 |
| Merge Fields in HTML document | Max | TX Text Control ActiveX | 2 | April 22, 2004 03:12:55 |
| Mail Mergeing Multiple Records in one Document | stephenk | TX Text Control .NET | 3 | February 3, 2004 01:24:43 |
| multiple image in pdf document | softedave | TX Text Control .NET | 0 | March 3, 2003 14:44:10 |