|
-
Jul 5th, 2007, 02:05 AM
#1
Thread Starter
Junior Member
Inserting Excel file data to a word document using VB.NET
Hi Friends,
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, , )
So can you please help me out?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|