Click to See Complete Forum and Search --> : Working with MsWord


MaXiMux
August 21st, 2001, 11:44 AM
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...

Ghost308
August 21st, 2001, 12:45 PM
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/wt/showpost.pl?Board=vb&Number=58076&Search=true&Forum=vb&Words=ms%20word%20&Match=Whole&Topic=&Searchpage=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

vchapran
August 21st, 2001, 12:46 PM
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