santuvssantu
New member
- Joined
- Jul 5, 2007
- Messages
- 2
- Programming Experience
- 1-3
Hi All,
I have tried inserting an excel file to a word document.But the following code is inserting the junk information. So can you please help me out?
Dim m_WordApp As New Word.Application
Dim m_WordDoc As Word.Document
m_WordDoc = m_WordApp.Documents.Open(CObj("C:\Documents and Settings\santu\My Documents\New Microsoft Word Document.doc"), CObj(False), CObj(False), CObj(False))
Dim fullpath As String = "C:\Documents and Settings\santu\My Documents\Certification Details.xls"
m_WordDoc.Application.Selection.EndKey(WdUnits.wdS tory)
m_WordDoc.Application.Selection.InsertBreak(WdBrea kType.wdPageBreak)
m_WordDoc.Application.Selection.InsertFile(fullpat h)
m_WordDoc.Application.Selection.InsertParagraphAft er()
Even i have tried using this also...
m_WordDoc.Range.InsertParagraphAfter()
m_WordDoc.Range.InsertFile(fullpath, , 0, , )
I want to insert all the content of the excel.....when i am using the same for copying word doc to word it is working fine but with excel i m getting this problem. Hope I explained clearly.
So can you please help me out?
I have tried inserting an excel file to a word document.But the following code is inserting the junk information. So can you please help me out?
Dim m_WordApp As New Word.Application
Dim m_WordDoc As Word.Document
m_WordDoc = m_WordApp.Documents.Open(CObj("C:\Documents and Settings\santu\My Documents\New Microsoft Word Document.doc"), CObj(False), CObj(False), CObj(False))
Dim fullpath As String = "C:\Documents and Settings\santu\My Documents\Certification Details.xls"
m_WordDoc.Application.Selection.EndKey(WdUnits.wdS tory)
m_WordDoc.Application.Selection.InsertBreak(WdBrea kType.wdPageBreak)
m_WordDoc.Application.Selection.InsertFile(fullpat h)
m_WordDoc.Application.Selection.InsertParagraphAft er()
Even i have tried using this also...
m_WordDoc.Range.InsertParagraphAfter()
m_WordDoc.Range.InsertFile(fullpath, , 0, , )
I want to insert all the content of the excel.....when i am using the same for copying word doc to word it is working fine but with excel i m getting this problem. Hope I explained clearly.
So can you please help me out?