+ Reply to Thread
Results 1 to 3 of 3

Loop through files and find specific word

  1. #1
    Forum Contributor
    Join Date
    07-13-2015
    Location
    Poland
    MS-Off Ver
    MS Office 365
    Posts
    171

    Loop through files and find specific word

    Hi,

    I work generally with Excel and know basics of VBA programming, but I realized that actually (it's a shame) do not know Word and especially VBA for it
    I have hundreds onepage doc files and I'd like to loop them for getting value one cell right offset from word "TOTAL AMOUNT" in table embeded in document and list its through column A in Excel File.

    Can you help me to start with?

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Loop through files and find specific word

    Hi zico8,

    See the files associated with post #3 in the following thread: http://www.excelforum.com/word-forma...erge-data.html

    This mayhelp you get started accessing Microsoft Word from Excel and finding specific text within oneWord document. I do not know if this will work trying to find text in a Table. Expanding this to search through several files is relatively easy if you need help with that.

    Sample code to access word from the above reference follows:
    Please Login or Register  to view this content.
    The code uses 'Late Binding' (which I prefer) so there is no need for additional libraries or references. For more information about 'Early Binding' vs. 'Late Binding' see: http://peltiertech.com/Excel/EarlyLateBinding.html


    For additional help on your specific problem, we need to see a sample Word file and a sample Excel file.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

    Lewis

  3. #3
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Loop through files and find specific word

    Quote Originally Posted by LJMetzger View Post
    For additional help on your specific problem, we need to see a sample Word file and a sample Excel file.
    Not really, and you've posted a fair bit of code that isn't at all applicable yet still doesn't extract any data. All that's needed is a few moments to understand the problem. The following code attends to that, though it could be simplified if we knew which table(s) to extract from and whether the required data are in, say, the last cell in the table(s).
    Please Login or Register  to view this content.
    The above macro assumes you want to populate the active worksheet and that the required data are in the first/only paragraph of the cells concerned. A folder browser is included, so all you need do is run the macro, select the folder, then sit back while the data are extracted.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 02-21-2016, 02:39 AM
  2. [SOLVED] Help with macro to find a specific word and replace the entire cell with the return word.
    By BG1983 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-24-2015, 09:40 PM
  3. Macro to loop through all word files and convert them into pdf
    By adelkam in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-04-2014, 02:26 AM
  4. [SOLVED] Find Word and Loop to End
    By Tellm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-27-2014, 11:54 AM
  5. [SOLVED] How to find specific word and sum the column according to that word
    By cobo1981 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-14-2014, 12:04 PM
  6. How to find a specific word and replace the immediate next word
    By sugaprasad in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 01-31-2013, 02:16 AM
  7. [SOLVED] Repeat macros in a loop and save as word files
    By amanduggal in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2012, 08:39 AM

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