Closed Thread
Results 1 to 4 of 4

Extract data from word document

  1. #1
    Registered User
    Join Date
    11-01-2004
    Posts
    37

    Extract data from word document

    Hi

    I am going to modify a macro to extract data from MS Word documents. I run below mentioned macro but in the beginning where there is :


    ('Set a reference (Tools - References) to the

    'Microsoft Word x.0 Object Library)

    I don’t know what should I do.

    And also I face error on:

    (Dim wdApp As Word.Application)

    May somebody help me?
    The complete macro is following.

    rgds
    hme



    Please Login or Register  to view this content.
    Last edited by VBA Noob; 01-13-2008 at 06:19 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    o set a reference to MS Word you need to open the Visual basic editor (Alt+F11), then from the Tools menu select references. Then scroll down the list until you find "Microsoft Word 12.0 Object Library" and check the box. Note: the number refers to the version of word on your PC, so it might be a different number. Click OK & close the Dialog.

    Now try running the macro.

    Edit; the code runs with no error when the reference has been set
    Last edited by royUK; 01-13-2008 at 08:11 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    11-01-2004
    Posts
    37
    thank you very much for your reply royUK

    It is working well

    may you help me to modify this macro to retrieve the line where there is "Subject" and copy this line and 2 line before and 2 line after this line to an excel worksheet (insted of retrieve the information from the table in word as it is in above macro) and do this for all word doc. in a specific folder.

    rgds
    hme

  4. #4
    Registered User
    Join Date
    06-13-2011
    Location
    Bangalore,india
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Extract data from word document

    Suppose the word contains the data not in a table format,instead line wise.

    eg.

    Serial Number
    2345678

    Abstract
    aaaaaaaaaaaaaaaa
    nnnnnnnnnnnnnnn

    date of publication
    21.03.2011

    then how to copy a serios of data in word format similiar to this in to excel using macros

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1