|
Hello. What is the easiest way to copy/insert a full page from a document in another one?. I have tried this but It doesn't work 100% with images, tables, etc. ----------------------------------------------------------------------------------- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim oWord As New Microsoft.Office.Interop.Word.Application Dim oMissing As Object oMissing = Type.Missing Dim inicio, fin As Object Dim sRuta1 As String Dim sRuta2 As String Dim doc1 As Microsoft.Office.Interop.Word.Document Dim doc2 As Microsoft.Office.Interop.Word.Document Dim doc3 As Microsoft.Office.Interop.Word.Document sRuta1 = "C:\Documents and Settings\Neruda\Escritorio\Prueba Word\Origen\01.docx" sRuta2 = "C:\Documents and Settings\Neruda\Escritorio\Prueba Word\Origen\02.docx" oWord.Visible = True doc1 = oWord.Documents.Open(FileName:=sRuta1) 'doc2 = oWord.Documents.Open(FileName:=sRuta2) doc3 = oWord.Documents.Add doc1.Activate() 'oWord.Selection.InsertBreak(WdBreakType.wdPageBreak) 'doc1.Content.FormattedText.InsertAfter(doc1.Content.Text) inicio = doc1.Content.FormattedText.Start fin = doc1.Content.End - 1 doc1.Range(Start:=inicio, End:=fin).FormattedText.Copy() doc3.Range.Paste() 'doc3.Activate() 'doc3.Range.Paste() 'fin = doc1.Content.End - 1 'doc1.Range(Start:=fin, End:=fin).FormattedText = doc2.Content.FormattedText End Sub ---------------------------------------------------------------------------------- I enable or disable the comments for trying new things but ... nothing. No idea ! |