G
Gustav Corne
Hi I am having trouble with saving my word document as PDF using c# and
word.
I get an error:
- ex {"The parameter is incorrect." } System.Exception
StackTrace " at
Microsoft.Office.Interop.Word.DocumentClass.ExportAsFixedFormat(String
OutputFileName, WdExportFormat ExportFormat, Boolean OpenAfterExport,
WdExportOptimizeFor OptimizeFor, WdExportRange Range, Int32 From, Int32 To,
WdExportItem Item, Boolean IncludeDocProps, Boolean KeepIRM,
WdExportCreateBookmarks CreateBookmarks, Boolean DocStructureTags, Boolean
BitmapMissingFonts, Boolean UseISO19005_1, Object
FixedFormatExtClassPtr)\r\n at WordReplace.Form1.button1_Click(Object
sender, EventArgs e) in c:\\documents and settings\\gcorne\\my
documents\\visual studio projects\\wordtest\\wordreplace\\form1.cs:line 128"
string
I guess it has something todo with the last parameter that should be a
"System.Object FixedFormatExtClassPtr" and I havn't got a clue what should
be there, now I try to pass a System.Reflection.Missing.Value.
Anyone know what to do?
/Gustav
aDoc.ExportAsFixedFormat(saveFile,
Microsoft.Office.Interop.Word.WdExportFormat.wdExportFormatPDF, false,
Microsoft.Office.Interop.Word.WdExportOptimizeFor.wdExportOptimizeForPrint,
Microsoft.Office.Interop.Word.WdExportRange.wdExportAllDocument, 1, 1,
Microsoft.Office.Interop.Word.WdExportItem.wdExportDocumentContent,
false, true,
Microsoft.Office.Interop.Word.WdExportCreateBookmarks.wdExportCreateNoBookmarks,
false, true, true, missing);
aDoc.Close(ref saveChanges, ref missing, ref missing );
/*
public abstract new void ExportAsFixedFormat ( System.String
OutputFileName , Microsoft.Office.Interop.Word.WdExportFormat ExportFormat ,
System.Boolean OpenAfterExport ,
Microsoft.Office.Interop.Word.WdExportOptimizeFor OptimizeFor ,
Microsoft.Office.Interop.Word.WdExportRange Range , System.Int32 From ,
System.Int32 To ,
Microsoft.Office.Interop.Word.WdExportItem Item , System.Boolean
IncludeDocProps ,
System.Boolean KeepIRM ,
Microsoft.Office.Interop.Word.WdExportCreateBookmarks CreateBookmarks ,
System.Boolean DocStructureTags , System.Boolean BitmapMissingFonts ,
System.Boolean UseISO19005_1 , System.Object FixedFormatExtClassPtr )
*/
word.
I get an error:
- ex {"The parameter is incorrect." } System.Exception
StackTrace " at
Microsoft.Office.Interop.Word.DocumentClass.ExportAsFixedFormat(String
OutputFileName, WdExportFormat ExportFormat, Boolean OpenAfterExport,
WdExportOptimizeFor OptimizeFor, WdExportRange Range, Int32 From, Int32 To,
WdExportItem Item, Boolean IncludeDocProps, Boolean KeepIRM,
WdExportCreateBookmarks CreateBookmarks, Boolean DocStructureTags, Boolean
BitmapMissingFonts, Boolean UseISO19005_1, Object
FixedFormatExtClassPtr)\r\n at WordReplace.Form1.button1_Click(Object
sender, EventArgs e) in c:\\documents and settings\\gcorne\\my
documents\\visual studio projects\\wordtest\\wordreplace\\form1.cs:line 128"
string
I guess it has something todo with the last parameter that should be a
"System.Object FixedFormatExtClassPtr" and I havn't got a clue what should
be there, now I try to pass a System.Reflection.Missing.Value.
Anyone know what to do?
/Gustav
aDoc.ExportAsFixedFormat(saveFile,
Microsoft.Office.Interop.Word.WdExportFormat.wdExportFormatPDF, false,
Microsoft.Office.Interop.Word.WdExportOptimizeFor.wdExportOptimizeForPrint,
Microsoft.Office.Interop.Word.WdExportRange.wdExportAllDocument, 1, 1,
Microsoft.Office.Interop.Word.WdExportItem.wdExportDocumentContent,
false, true,
Microsoft.Office.Interop.Word.WdExportCreateBookmarks.wdExportCreateNoBookmarks,
false, true, true, missing);
aDoc.Close(ref saveChanges, ref missing, ref missing );
/*
public abstract new void ExportAsFixedFormat ( System.String
OutputFileName , Microsoft.Office.Interop.Word.WdExportFormat ExportFormat ,
System.Boolean OpenAfterExport ,
Microsoft.Office.Interop.Word.WdExportOptimizeFor OptimizeFor ,
Microsoft.Office.Interop.Word.WdExportRange Range , System.Int32 From ,
System.Int32 To ,
Microsoft.Office.Interop.Word.WdExportItem Item , System.Boolean
IncludeDocProps ,
System.Boolean KeepIRM ,
Microsoft.Office.Interop.Word.WdExportCreateBookmarks CreateBookmarks ,
System.Boolean DocStructureTags , System.Boolean BitmapMissingFonts ,
System.Boolean UseISO19005_1 , System.Object FixedFormatExtClassPtr )
*/