Page 1 of 4 123 ... LastLast
Results 1 to 15 of 49
  1. #1
    Lounger
    Join Date
    Oct 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Export word data in excel (Ms word 2003)

    Hi,

    I have word file with many data groups which look for example like this:

    Test Name: Test User Interface

    Linked Defects:
    Defect ID LinkedEntityID Defect:Summary
    414 1019 Button is too small

    Test Name: Test Performance

    Linked Defects:
    DefectID LinkedEntityID Defect:Summary
    324 1039 Performance is bad.

    ....

    I want to create an excel list from that input with the following columns and the corresponding data:
    TestName DefectID LinkedEntityID Defect:Summary


    Can anybody give me help here how I have to define the word macro in an easy way to solve this problem? - Im working already for a long time on that. [img]/forums/images/smilies/sad.gif[/img]
    I have also attached a screen shot of how the data groups look like in the word file.

    Many thanks in advance.
    Regards
    pat
    Attached Images Attached Images

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Export word data in excel (Ms word 2003)

    Welcome to Woody's Lounge!

    Could you attach a small sample document with three or four of these data groups? That will make it easier to test code.
    Thanks in advance.

  3. #3
    Lounger
    Join Date
    Oct 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export word data in excel (Ms word 2003)

    Hi Hans,

    I have created a sample word file with sample data in order that you can see the structure. could you help me to import the word data to an excel sheet? :-/
    Attached Files Attached Files

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Export word data in excel (Ms word 2003)

    See the attached version of your sample document. It contains a macro named Export2XL that will create an Excel workbook with the data.
    The code uses Automation with late binding, so it should work with any version of Excel (although I'm not sure about Excel 2007).
    Attached Files Attached Files

  5. #5
    Lounger
    Join Date
    Oct 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export word data in excel (Ms word 2003)

    wow great thank you, one last little problem, I forgot that case, there could be the possibility that there is a Testname with the correponding information but no linked defects. when i try this with your macro than it does not work properly anymore... [img]/forums/images/smilies/sad.gif[/img] could you please help me once more..?
    I attached again a sample word document.

    regards
    patrick
    Attached Files Attached Files

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Export word data in excel (Ms word 2003)

    What do you want to happen if a testname has no corresponding table? Is it OK to skip that testname?

  7. #7
    Lounger
    Join Date
    Oct 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export word data in excel (Ms word 2003)

    is it also possible if there is no corresponding linked defects table that the testname is exported though (respectively without a defect id, etc.) ?

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Export word data in excel (Ms word 2003)

    OK, try this version. The code has extensive comments, you'll see where it tests for the data table.
    Attached Files Attached Files

  9. #9
    Lounger
    Join Date
    Oct 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export word data in excel (Ms word 2003)

    cool, it looks great but in this version the testname is skipped when there is no linked defects table, right? - is it also possible that the testname is written in the excel sheet in an own row but naturally without a defect id, etc.?

  10. #10
    Lounger
    Join Date
    Oct 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export word data in excel (Ms word 2003)

    hi hans,

    I tried it with my real document but no data is imported to the excel sheet. could you please look at that? [img]/forums/images/smilies/sad.gif[/img](
    Attached Files Attached Files

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Export word data in excel (Ms word 2003)

    This is confusing - you originally replied that it was OK to skip those testnames, then changed it to the opposite while I was adapting the code.

  12. #12
    Lounger
    Join Date
    Oct 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export word data in excel (Ms word 2003)

    yes im sorry, i edited my posting because for my calculations than in excel it is better that every test name is displayed in the excel sheet, also if there are no corresponding defects to the testname. is this also possible?
    could you please look at my last posting where I posted my real document because when I test the macro with that document nothing is displayed in the excel sheet, only the headers of the columns...? [img]/forums/images/smilies/sad.gif[/img]

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Export word data in excel (Ms word 2003)

    If you ask questions in the future, please provide all relevant information right from the start, instead of gradually adding more and more complications after someone has already spent time and energy on the original question.

    In the first place, your document has a table of contents that also contains the text you told us to look for. so we have to skip that.
    In the second place, the test names are longer than one line, unlike those in the first and second sample document.
    In the third place, the test names are followed by index entries, which makes it a lot more difficult.
    Before I try modifying the code once again, can you tell me whether ALL testnames will ALWAYS be followed by an index entry? Or could there be some test names that are NOT followed by an index entry?

  14. #14
    Lounger
    Join Date
    Oct 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export word data in excel (Ms word 2003)

    Im really sorry that edited this posting. No every testname hast an index entry in the table of contents. do you know how this works? [img]/forums/images/smilies/sad.gif[/img]

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Export word data in excel (Ms word 2003)

    Just to make sure, since English is neither my native language nor yours, what exactly do you mean by "No every testname hast an index entry in the table of contents."?

    1) Not every testname has an index entry in the table of contents.

    or

    2) Every testname has an index entry in the table of contents.

Page 1 of 4 123 ... LastLast

Posting Permissions

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