DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Interaction with Ms Word

  1. #1
    Tengku Guest

    Interaction with Ms Word


    1)How to Interact with Ms Word?
    2)How to edit something in word? For example:
    In Word => I Love to eat @food@
    How to replace the @food@ with user input? If the user input Chicken it will
    be like this: I Love to eat chicken. If the user input fish it will be like
    this: I Love to eat fish.
    Please help me on to overcome this problems....
    Thank You..

  2. #2
    Tamar E. Granor Guest

    Re: Interaction with Ms Word

    On 11 Apr 2001 01:08:51 -0700, "Tengku" <oodeng@hotmail.com> wrote:

    >
    >1)How to Interact with Ms Word?
    >2)How to edit something in word? For example:
    >In Word => I Love to eat @food@
    >How to replace the @food@ with user input? If the user input Chicken it will
    >be like this: I Love to eat chicken. If the user input fish it will be like
    >this: I Love to eat fish.
    >Please help me on to overcome this problems....
    >Thank You..


    Use Automation. Here's some code to get you started:

    LOCAL oWord, oDoc, oRange
    oWord = CreateObject("Word.Application")
    * Substitute the path and name for your document in the next line
    oDoc = oWord.Documents.Open("MyDoc.Doc")

    WITH oDoc.Find
    .Text = "@food@"
    .Replace.Text = cUserInput
    .Execute( , , , , , , , , , , 2)
    ENDWITH

    For more information, use the Word VBA Help file (VBAWD9.CHM for Word
    2000, VBAWD8.HLP for Word 97). It's not installed by default, so you
    may have to go back to the Office installation to get it.

    Also, Della Martin and I wrote a book about automating Office. You can
    get more information at www.hentzenwerke.com.

    Tamar


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center