worddocument.saveas does save - but the document is empty...

N

neoret

Hello.

I use the document.saveas command in my addin and everything seems to
be ok. But when I reopen the document it is empty... What am I doing
wrong?

Here is a bit of my code:

object FileName = filename;
object FileFormat =
Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatRTF;
object LockComments = false;
object AddToRecentFiles = true;
object ReadOnlyRecommended = false;
object EmbedTrueTypeFonts = false;
object SaveNativePictureFormat = true;
object SaveFormsData = true;
object SaveAsAOCELetter = false;
object Encoding = Microsoft.Office.Core.MsoEncoding.msoEncodingUSASCII;
object InsertLineBreaks = false;
object AllowSubstitutions = false;
object LineEnding =
Microsoft.Office.Interop.Word.WdLineEndingType.wdCRLF;
object AddBiDiMarks = false;

if (theActiveDoc.SaveFormat == (int)
Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatDocument)
{
theActiveDoc.SaveAs(ref FileName, ref FileFormat, ref LockComments,
ref missing, ref AddToRecentFiles, ref missing,
ref ReadOnlyRecommended, ref EmbedTrueTypeFonts,
ref SaveNativePictureFormat, ref SaveFormsData,
ref SaveAsAOCELetter, ref Encoding, ref InsertLineBreaks,
ref AllowSubstitutions, ref LineEnding, ref AddBiDiMarks);
}
 

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