Wie zum Einfügen eines Zeilenumbruchs in eine Zelle der Tabelle in Word?

wenn ich einfügen '\r\n' in eine Zelle einer Tabelle im word-Dokument mit c# ,es funktioniert nicht ,warum ? wie es zu tun ?

Word.Application wordApp; 
Word.Document wordDoc; 
filePath = @"" + strWorkPath + @"Uploads\Template\template.doc"; 
saveFilePath = @"" + strWorkPath + @"Uploads\" + VersionStr + @"\" + fileName; 
object format = Word.WdSaveFormat.wdFormatDocument; wordApp = new Word.Application(); 
Object nothing = Missing.Value; 
wordDoc = wordApp.Documents.Open(ref filePath, ref nothing, ref nothing, ref nothing, ref nothing,ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing); 
Word.Table table = wordDoc.Tables[1]; 
table.Cell(1, 1).Range.Text = "sdsdlkfjdslk \r\n slkdfjslj"; 

als in der letzten Zeile angezeigt.

In das Dokument, es ist "sdsdlkfjdslk \r\n slkdfjslj", nicht "sdsdlkfjdslk slkdfjslj"

InformationsquelleAutor Charles | 2010-04-30
Schreibe einen Kommentar