Results 1 to 3 of 3

Thread: Code Integration Query

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    64

    Code Integration Query

    Hi guys, a lil help please i want to create a vba that compares two paragraphs for duplication. If duplication if found the sentence being duplicated will be highligted into different colors, example i found 5 duplicate, i want to see also five colors in the output so that i can easily count the number of duplicated sentence fragments or phrases. I found a code that do exactly what i need only that it cannot set a length of matching parts and it has only two colors for highlighting duplicates. I created a userform that contains 2 rich texbox, the first box is for the source and the second box is for the article to be compared in the source. I also put a command button "Compare". I also put a textbox so that i can input the minimum length of matching part(NMin).

    Please download the attached file "DupTest" and run "compare" to see what I mean. The code actually works but only inside the document. The form I created has no code since thats my problem, integrating the code into the form. This will be the result if you will run the code in the attached document.



    If you can see the code only works inside the document itself. So the code compare the Page 1 of the document which is the SOURCE to Page 2 which is the Article.

    I want to achieve the same result but using a form so it should be like this;



    So when I click "Compare" the result should be like this (Note: That is only a screenshot of what should the result be.")



    So in general I want to integrate the code inside the file I attached into the Form.

    Credits to Tony Jollans for the code.
    Attached Files Attached Files

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Code Integration Query

    firstly to display highlighting in a form control i would think you would need to use richtextboxes to display the text on the form, frames are probably not suited for this application

    second you need to display the text from an area of the document in each container, in this case each area looks like a single page but in other cases that may not be so, you need to define what makes a source range and what makes an article range
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    64

    Re: Code Integration Query

    Yes it uses RichTextBoxes I just put frame for design.
    Could you give me a sample for that? Thanks..

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