this is the code to convert word documents to excel.Code:Imports System Imports Microsoft.VisualBasic Partial Public Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Sub GetDataFromWordDoc() Dim sPath As String Dim sFile As String Dim MyWd As Object sPath = "C:\ENGDATA\PDMS_Upload\Data_loading\BLOCK22\" sFile = Dir(sPath & "*.doc") Do While sFile <> "" MyWd = GetObject(sPath & sFile) MyWd.ActiveWindow.Selection.WholeStory() MyWd.ActiveWindow.Selection.Copy() Sheets("Sheet1").Cells.SpecialCells(xlCellTypeLastCell) Offset(1, 1).End(xlToLeft).PasteSpecial(xlPasteValues) sFile = Dir() Loop MyWd = Nothing End Sub End Class
but i am getting error at underlines portion..the error is name not declaredwhat should i do..I got thios code frm net and i just pasted it in visual studio..is there anybody to guide me to get my result??I am running short of tymm
![]()





Reply With Quote