0
I’m with a legacy application, in Visual Studio, which generates files .doc, using Microsoft.Office.Interop.Word.Application.
The application adds lines, spelling a few words, but sometimes the text gets truncated.
I’ve searched for ascii code and so far found nothing.
Thank you,
you could exemplify with your code, so we can view better
– Marcos Henrique
preferably the part of the code where it reads the information (from where it searches) and the part of the writing of the file.
– Hoppy
Follows the code:
– Marcos Fregolao
Microsoft.Office.Interop.Word.Application wordapp = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word.Document worddoc = new Microsoft.Office.Interop.Word.Document();
– Marcos Fregolao
nl string = System.Environment.Newline; worddoc = wordapp.Documents.Add(); Microsoft.Office.Interop.Word.Range Rng = worddoc. Paragraphs[1]. Range;
wordapp.Application.Selection.Font.Size = 10;
wordapp.Application.Selection.Font.Name = "Courier New";
wordapp.Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphLeft; wordapp.Application.Selection.ParagraphFormat.Spaceafter = 0;
– Marcos Fregolao
Stringbuilder strCabecalho = new Stringbuilder(); strCabecalho.Append("----------------------------------------------------------------------" + nl);
 strCabecalho.Append(" P R O T O C O L O " + "( " + pesqPge.nmeArchive + " )"); //Inserts publication data wordapp.Application.Selection.Typetext(strFormatacao.Tostring()); //Inserts a page break
– Marcos Fregolao
It seems that the problem occurs in this: wordapp.Application.Selection.Typetext(strFormatacao.Tostring());
– Marcos Fregolao