Aracılığıyla paylaş


DocumentBase.SaveFormat Özellik

Belgenin dosya biçimini alır.

Ad alanı:  Microsoft.Office.Tools.Word
Derleme:  Microsoft.Office.Tools.Word.v4.0.Utilities (Microsoft.Office.Tools.Word.v4.0.Utilities.dll içinde)

Sözdizimi

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

Özellik Değeri

Tür: System.Int32
Belgenin dosya biçimi.

Notlar

Harici dosya dönüştürücüsünü belirtir benzersiz bir sayı değeridir veya bir WdSaveFormat sabit.

Bu özellik için değer kullanın FileFormat bağımsız değişkeni SaveAs yöntemi bir belge var olan değilse ilgili bir dosya biçiminde kaydetmek için WdSaveFormat sabit.

Örnekler

Aşağıdaki kod örneğinde SaveAs yöntemi belgeyi yeni bir dosya adı myfile.docx rtf biçiminde kaydedin.Bu örneği kullanmak için çalıştırın ThisDocument bir belge düzeyi projesinde sınıf.

Private Sub DocumentSaveAs()

    Me.SaveAs(FileName:="myfile.docx", 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.docx";
    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);
    }
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

DocumentBase Sınıf

Microsoft.Office.Tools.Word Ad Alanı