Results 1 to 6 of 6

Thread: Helpppp me with coddeeeeeee

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    2

    Helpppp me with coddeeeeeee

    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
    this is the code to convert word documents to excel.
    but i am getting error at underlines portion..the error is name not declared what 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
    Last edited by Hack; Feb 10th, 2012 at 06:53 AM. Reason: Added Highlight Tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width