Leeres Word-Dokument

LordDeath

Erfahrenes Mitglied
Hi

Ich versuche ein Word Dokument zu speichern, es funktioniert alles wunderbar, doch das Dokument ist leer wenn ich es öffne hat da jemand eine Idee woran das liegt?

C#:
Word.Application WordApp = new Word.ApplicationClass();
object missingValue = Type.Missing;
object fileName = "F:\\Neu.doc";
object readOnly = false;
object isVisible = true;

Word.Document myDoc = WordApp.Documents.Open(ref fileName, ref missingValue, ref readOnly, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref isVisible, ref missingValue, ref missingValue, ref missingValue, ref missingValue);

myDoc.Activate();
			
object FileName = "F:\\test.xml";
object FileFormat = Word.WdSaveFormat.wdFormatXML;
object LockComments = false;
object AddToRecentFiles = true;
object ReadOnlyRecommended = false;
object EmbedTrueTypeFonts = true;
object SaveNativePictureFormat = true;
object SaveFormsData = true;
object SaveAsAOCELetter = false;
object Encoding = Microsoft.Office.Core.MsoEncoding.msoEncodingAutoDetect;
object InsertLineBreaks = false;
object AllowSubstitutions = false;
object LineEnding = Word.WdLineEndingType.wdCRLF;
object AddBiDiMarks = false;
myDoc.SaveAs(ref FileName, ref FileFormat, ref LockComments,
 		        ref missingValue, ref AddToRecentFiles, ref missingValue,
			ref ReadOnlyRecommended, ref EmbedTrueTypeFonts,
			ref SaveNativePictureFormat, ref SaveFormsData,
			ref SaveAsAOCELetter, ref Encoding, ref InsertLineBreaks,
			ref AllowSubstitutions, ref LineEnding, ref AddBiDiMarks);

myDoc.Close(ref missingValue, ref missingValue, ref missingValue);

Greetz
 
Zuletzt bearbeitet von einem Moderator:

Neue Beiträge

Zurück