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);
}
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);
}