Save as XPS

I

Igor

I am trying to save a Word document as an XPS file but getting a 0x800A1066
Command Failed exception. This same code works fine when I change it to
wdFormatDocument. Any ideas??

Here is my code:

FileName = @"C:\temp\temp.xps";
object FileFormat = Word.WdSaveFormat.wdFormatXPS;
object LockComments = false;
object Password = Type.Missing;
object AddtoRecentFiles = false;
object WritePassword = Type.Missing;
object ReadOnlyRecommended = false;
object EmbedTrueTypeFonts = false;
object SaveNativePictureFormat = false;
object SaveFormsData = false;
object SaveAsAOCELetter = false;
object Encoding = Type.Missing;
object InsertLineBreaks = false;
object AllowSubstitutions = false;
object LineEnding = Word.WdLineEndingType.wdCRLF;
object AddBiDiMarks = false;


doc1.SaveAs(ref FileName,ref FileFormat,ref
LockComments,ref Password,ref AddtoRecentFiles,ref WritePassword,ref
ReadOnlyRecommended,ref EmbedTrueTypeFonts,ref SaveNativePictureFormat,ref
SaveFormsData,ref SaveAsAOCELetter,ref Encoding,ref InsertLineBreaks,ref
AllowSubstitutions,ref LineEnding,ref AddBiDiMarks);

Thanks
Igor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top