CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 1999
    Posts
    1

    Serching a string in Word Document opened through VB application

    Hi friends,
    I am developing a HRD package in VB. I am getting MS Word 97 documents as input. I have to serach for some key words like skills or qualifications something like that in the document and log them if I found those key words in the document. I couldn't get any idea how to go about it. Anybody is there to help me out?



  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Serching a string in Word Document opened through VB application

    (OLE) automation is the way to go to trigger another application like Word to accomplish a certain task. You manipulate the object model of the other application through VB code.
    Word comes with a type library that you can add to the references of your vb application.
    Check out the object browser (F2) to see what objects and methods are exposed.
    I suggest you record a macro in Word to see what type of commands you need to specify to do your search operation.


  3. #3
    Join Date
    Nov 2001
    Location
    AZ, USA
    Posts
    5

    Re: Serching a string in Word Document opened through VB application

    Hi.
    I am very new to VB for Application. And I am not familiar with OLE. I wrote a program to open a .txt version of the .doc and grab a string and append it to an output file. But I want to enchance this...
    1. Automate it.
    2. Open the .doc file instead of .txt. - eliminate one step
    The following did not work for me (Open "TESTFILE" For Binary Access Read Lock Read As #1)
    3. Place the string and the filename it came from into an Access table. (I know a bit of SQL- a sample VB
    code will be appreciated)

    Any Help Is appreciated,
    Angela




  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Better post this...

    ...as a new question. Lothar is no more in CodeGuru since he went to work in Singapore...

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
    and all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

    The Rater
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured