Document.OriginalDocumentTitle Property (2007 System)
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.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property OriginalDocumentTitle As String
'Usage
Dim instance As Document
Dim value As String
value = instance.OriginalDocumentTitle
[BrowsableAttribute(false)]
public string OriginalDocumentTitle { get; }
[BrowsableAttribute(false)]
public:
property String^ OriginalDocumentTitle {
String^ get ();
}
public function get OriginalDocumentTitle () : String
Property Value
Type: System.String
The title of the original document after performing a legal-blackline document compare operation.
Remarks
To perform a legal-blackline document compare operation, use the CompareDocuments method of the Application property.
Examples
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.
This example is for a document-level customization.
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());
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.