DocumentBase.SaveFormat – vlastnost

Získá formátu dokumentu.

Obor názvů:  Microsoft.Office.Tools.Word
Sestavení:  Microsoft.Office.Tools.Word.v4.0.Utilities (v Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntaxe

'Deklarace
Public ReadOnly Property SaveFormat As Integer
    Get
public int SaveFormat { get; }

Hodnota vlastnosti

Typ: System.Int32
Formát souboru dokumentu.

Poznámky

Hodnota je jedinečné číslo, které určuje externího souboru převaděč nebo WdSaveFormat konstantu.

Použít hodnotu pro tuto vlastnost FileFormat argument SaveAs Metoda uložit dokument ve formátu souboru, pro který není odpovídající WdSaveFormat konstanta.

Příklady

Následující kód například použití SaveAs metoda uložení dokumentu do nového název souboru soubor.doc ve formátu RTF. Chcete-li použít tento příklad spustit z ThisDocument třídy v projektu úrovni dokumentu.

Private Sub DocumentSaveAs()

    Me.SaveAs(FileName:="myfile.doc", FileFormat:=Word.WdSaveFormat.wdFormatRTF, _
        LockComments:=False, AddToRecentFiles:=True, ReadOnlyRecommended:=False, _
        EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=True, _
        SaveFormsData:=True, SaveAsAOCELetter:=False, _
        Encoding:=Office.MsoEncoding.msoEncodingUSASCII, _
        InsertLineBreaks:=False, AllowSubstitutions:=False, _
        LineEnding:=Word.WdLineEndingType.wdCRLF, _
        AddBiDiMarks:=False)
End Sub
private void DocumentSaveAs()
{
    object FileName = "myfile.doc";
    object FileFormat = 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 = Office.MsoEncoding.msoEncodingUSASCII;
    object InsertLineBreaks = false;
    object AllowSubstitutions = false;
    object LineEnding = Word.WdLineEndingType.wdCRLF;
    object AddBiDiMarks = false;

    if (this.SaveFormat == (int)Word.WdSaveFormat.wdFormatDocument)
    {
        this.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);
    }
}

Zabezpečení rozhraní .NET Framework

Viz také

Odkaz

DocumentBase Třída

Microsoft.Office.Tools.Word – obor názvů