Sdílet prostřednictvím


DocumentBase.RevisedDocumentTitle – vlastnost

Získá název revidovaný dokument po provedení operace porovnání dokumentů Popis právního porovnání.

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 RevisedDocumentTitle As String
public string RevisedDocumentTitle { get; }

Hodnota vlastnosti

Typ: System.String
Název revidovaný dokument po provedení operace porovnání dokumentů Popis právního porovnání.

Poznámky

Provádět operaci porovnání dokumentů Popis právního porovnání slouží CompareDocuments metoda Application vlastnost.

Příklady

Následující příklad kódu porovnává dokumentu aplikace Word v dokumentu úroveň přizpůsobení (označované jako původní dokument) s jinou verzí stejného dokumentu (nazývané revidovaný dokument).Výsledek porovnání umístí do původního dokumentu.V příkladu potom upozorní uživatele, zda název původního dokumentu a název revidovaný dokument jsou stejné nebo různé a zobrazí oba tituly.Chcete-li tento příklad použít, spusťte jej ze třídy ThisDocument v projektu na úrovni dokumentu.

Private Sub GetDocumentTitlesAfterComparison()        
    Dim originalFileName As Object = "c:\myDocs\HikingGuide.docx"
    Dim originalDoc As Word.Document = Me.Application.Documents.Open( _
        originalFileName)

    Dim revisedFileName As Object = "c:\myDocs\RevisedHikingGuide.docx"
    Dim revisedDoc As Word.Document = Me.Application.Documents.Open( _
        revisedFileName)

    Me.Application.CompareDocuments( _
        originalDoc, revisedDoc, _
        Word.WdCompareDestination.wdCompareDestinationOriginal, _
        Word.WdGranularity.wdGranularityWordLevel, True, True, _
        True, True, True, True, True, True, True, True, "", True)

    Dim sb As StringBuilder = New StringBuilder()
    If Me.OriginalDocumentTitle = Me.RevisedDocumentTitle Then
        sb.Append("The titles of the orginal and revised document are identical.")
    Else
        sb.Append("The titles of the orginal and revised document are different.")
    End If
    sb.Append( _
            vbCrLf + "Title of original document: " _
            + Me.OriginalDocumentTitle _
            + vbCrLf + "Title of revised document: " _
            + Me.RevisedDocumentTitle)
    MessageBox.Show(sb.ToString())
End Sub
private void GetDocumentTitlesAfterComparison()
{
    object OriginalFileName = @"c:\myDocs\HikingGuide.docx";
    Word.Document originalDoc = this.Application.Documents.Open(
        ref OriginalFileName, ref missing, ref missing, ref missing, ref missing,
        ref missing, ref missing, ref missing, ref missing, ref missing,
        ref missing, ref missing, ref missing, ref missing, ref missing,
        ref missing);

    object RevisedFileName = @"c:\myDocs\RevisedHikingGuide.docx";
    Word.Document revisedDoc = this.Application.Documents.Open(
        ref RevisedFileName, ref missing, ref missing, ref missing, ref missing, 
        ref missing,ref missing, ref missing, ref missing, ref missing, 
        ref missing, ref missing, ref missing, ref missing,ref missing, 
        ref missing);

    this.Application.CompareDocuments(
        originalDoc, revisedDoc, 
        Word.WdCompareDestination.wdCompareDestinationOriginal, 
        Word.WdGranularity.wdGranularityWordLevel, true, true, 
        true, true, true, true, true, true, true, true, "", true);

    StringBuilder sb = new StringBuilder();
    if (this.OriginalDocumentTitle == this.RevisedDocumentTitle)
    {
        sb.Append(
            "The titles of the orginal and revised document are identical.");
    }
    else
    {
        sb.Append(
            "The titles of the orginal and revised document are different.");                    
    }
    sb.Append(
            "\r\nTitle of original document: " + this.OriginalDocumentTitle
            + "\r\nTitle of revised document: " + this.RevisedDocumentTitle);
    MessageBox.Show(sb.ToString());
}

Zabezpečení rozhraní .NET Framework

Viz také

Referenční dokumentace

DocumentBase Třída

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