CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2001
    Posts
    2

    Working with MsWord

    I have some documents in Word and i want to modify them, ¿what can i do?... i tried oppening the document but i dont have a idea for what's the next step...


  2. #2
    Join Date
    Jun 2001
    Location
    Memphis, TN
    Posts
    146

    Re: Working with MsWord

    Hi there,
    this is a link to a post i wrote just a few weeks ago, i'm not sure if it is what you had in mind exactly but maybe it will point you in the right direction?

    http://www.codeguru.com/cgi-bin/bbs/...age=0&Limit=25

    to make this exact code work, you'll have to remove a couple of variables that are being sent to the Word selection text i think. Just look at how it is structured and i think you'll figure out how to send and format your data/text. Good luck!

    jeff


  3. #3
    Join Date
    Aug 2000
    Location
    NY, USA
    Posts
    632

    Re: Working with MsWord

    Start Word, Go to Tools>Macro>Record New Macro. Then do something, like open document, highlight something and replace with something else, change font, whatever. Stop recording Macro. Go to Tools>Macro>Macros. Select just recorded macro and click on 'Edit' button. You'll see all VB code to perform everything you just did. This code will work in your VB application with a few changes. You need to add "MS Word Object Library" reference to your project and then create object as Word.Application. Then paste the code from your macro in VB project and play with it.
    Vlad


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