Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DocumentBase.OriginalDocumentTitle Property

Gets the title of the original document after performing a legal-blackline document compare operation.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

public string OriginalDocumentTitle { get; }

Property Value

Type: System.String
The title of the original document after performing a legal-blackline document compare operation.

To perform a legal-blackline document compare operation, use the CompareDocuments method of the Application property.

The following code example compares the Word document in the document-level customization (called the original document) with another version of the same document (called the revised document). It places the result of the comparison into the original document. The example then notifies the user whether the title of the original document and the title of the revised document are identical or different and displays both document titles. To use this example, run it from the ThisDocument class in a document-level project.

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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft