Document.Merge Method (2007 System)
Merges the changes marked with revision marks from one document to another.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax
'Declaration
Public Sub Merge ( _
FileName As String, _
ByRef MergeTarget As Object, _
ByRef DetectFormatChanges As Object, _
ByRef UseFormattingFrom As Object, _
ByRef AddToRecentFiles As Object _
)
'Usage
Dim instance As Document
Dim FileName As String
Dim MergeTarget As Object
Dim DetectFormatChanges As Object
Dim UseFormattingFrom As Object
Dim AddToRecentFiles As Object
instance.Merge(FileName, MergeTarget, _
DetectFormatChanges, UseFormattingFrom, _
AddToRecentFiles)
public void Merge(
string FileName,
ref Object MergeTarget,
ref Object DetectFormatChanges,
ref Object UseFormattingFrom,
ref Object AddToRecentFiles
)
public:
void Merge(
String^ FileName,
Object^% MergeTarget,
Object^% DetectFormatChanges,
Object^% UseFormattingFrom,
Object^% AddToRecentFiles
)
public function Merge(
FileName : String,
MergeTarget : Object,
DetectFormatChanges : Object,
UseFormattingFrom : Object,
AddToRecentFiles : Object
)
Parameters
FileName
Type: System.StringThe name of the new file that includes the merged contents.
MergeTarget
Type: System.Object%One of the WdMergeTarget values.
DetectFormatChanges
Type: System.Object%true to detect format changes in the document; otherwise, false.
UseFormattingFrom
Type: System.Object%One of the WdUseFormattingFrom values.
AddToRecentFiles
Type: System.Object%true to add to the recent files list; otherwise, false.
Remarks
Optional Parameters
For information on optional parameters, see The Variable missing and Optional Parameters in Office Solutions.
Examples
The following code example uses the Merge method to merge the changes marked with revision marks in Sales2.doc into the document associated with the current project. This example assumes that the file Sales2.doc exists on the current computer in the folder C:\Docs.
This example is for a document-level customization.
Private Sub DocumentMerge()
Me.Merge("C:\Docs\Sales2.doc", _
MergeTarget:=Word.WdMergeTarget.wdMergeTargetCurrent, _
DetectFormatChanges:=True, _
UseFormattingFrom:=Word.WdUseFormattingFrom.wdFormattingFromCurrent, _
AddToRecentFiles:=True)
End Sub
private void DocumentMerge()
{
object MergeTarget = Word.WdMergeTarget.wdMergeTargetCurrent;
object DetectFormatChanges = true;
object UseFormattingFrom =
Word.WdUseFormattingFrom.wdFormattingFromCurrent;
object AddToRecentFiles = true;
this.Merge("C:\\Docs\\Sales2.doc", ref MergeTarget,
ref DetectFormatChanges, ref UseFormattingFrom,
ref AddToRecentFiles);
}
.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.