+ Reply to Thread
Results 1 to 5 of 5

VBA code to scan a Word doc and record characteristics in Excel

  1. #1
    Registered User
    Join Date
    04-13-2018
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    6

    VBA code to scan a Word doc and record characteristics in Excel

    Hello Everyone,

    I'm looking for a way to automate looking at several 100 Word documents and compare them against a word template. I was hoping to use Excel VBA and record the results on a worksheet for review. I'm looking differences in font, font size, headers, text placement, etc.

    Does anyone know of a tool that can do this? By chance does anyone have some VBA code they would be willing to share?

    I could look at each file individually but that's no fun.

    Thanks in advance.

    Terry

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: VBA code to scan a Word doc and record characteristics in Excel

    What does "record the results" mean? What do you want the results to look like? A Word document is unstructured data so comparison results can be just about anything. You need to specify how you want to quantify this kind of comparison and record it in Excel. An example is going to make this go a lot faster. Ideally you would attach the template, a sample document, and an Excel file showing the results of comparing those two documents.

    My approach would be to use the Word document compare feature, but it shows individual differences between the documents and does not give any kind of comparison statistics.
    Last edited by 6StringJazzer; 03-21-2023 at 11:48 AM. Reason: typo
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    04-13-2018
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    6

    Re: VBA code to scan a Word doc and record characteristics in Excel

    Hi Jeff,

    Thanks for the reply. Good point. I will keep the in mind for future posts. Attached is a example of what I'm trying to accomplish.

    "Record the results" mean identifying parts of the word document that do not adhere to the defined template. For example, is a paragraph in the correct font, size and color. Is bold on where appropriate based on the template. The recorded results to indicate the paragraph text that does not match the template settings. For example a line would be recorded in the excel worksheet similar to "Paragraph starting with 'The little fox ran across the meadow...' is not in the correct format of Font 'Arial'. Size '11'."

    I know this is a shot in the dark type of request but I really don't want to manually check 100's of documents.
    Attached Files Attached Files

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: VBA code to scan a Word doc and record characteristics in Excel

    The document comparison tool isn't going to help you, because all the text is going to be different.

    That might be possible to do, but it could turn into a pretty big job. The issue here is that virtually anything could vary from the template. The hard part here, in my opinion, is mapping the parts of the document to what part of the template they are supposed to match. Suppose the user changes the text of a heading, like Qualification Summary becomes Experience Overview. Then you have a nightmare trying to automate the comparison. If the structure is really tight, where the user must use every section in the template, it might be doable.

    BTW if an automated process can identify the differences, it could also correct them. Do you want to take it that far?

    I could try to write something up, because this is a little bit interesting, but if I don't have a full, realistic example you will have to do you own testing. I will look into it to see what is possible. But it's free and I have limited time, so I hope you're not in a hurry.

  5. #5
    Registered User
    Join Date
    04-13-2018
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    6

    Re: VBA code to scan a Word doc and record characteristics in Excel

    Thanks 6StringJazzer. Any code examples would be awesome but don't stress over this. I completely understand everyone's time is limited. All the documents are company confidential so I would be doing my own testing. I agree if code can find the discrepancies it could make the corrections. However I want the document owners to make their own corrections. They should have followed the guidelines from the start.

    No matter how I try to automate this it's not going to be perfect. But I also agree this is an interesting challenge.

+ 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: 9
    Last Post: 02-28-2019, 05:52 PM
  2. Scan EAN 128 bar code with leading digit 0 into Excel.
    By josersynear in forum Excel General
    Replies: 1
    Last Post: 01-03-2019, 10:04 PM
  3. Replies: 0
    Last Post: 11-15-2018, 08:56 PM
  4. Word Scan Across Multiple Sheets
    By Sneef in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2015, 09:31 AM
  5. Macro To Record Copying and Pasting from Excel to Word?
    By MattyD89 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-17-2014, 11:16 AM
  6. scan data, find max value of column, return single record on other worksheet
    By virtualnoob in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-26-2012, 11:26 PM
  7. Scan through row 1 fields for specified text and record the column in a variable
    By wfogel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-28-2010, 04:49 PM

Tags for this Thread

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