Connecting Tech Pros Worldwide Forums | Help | Site Map

Automated Application using VB

Newbie
 
Join Date: Jul 2008
Location: United States
Posts: 1
#1: Jul 1 '08
Hi,

I am new at Visual Basic. I need to create an application which will open notepad file copy that data and paste in to msword and run macro to find and replace text. All I want to do using Visual Basic and then want to put that exe in to schedule task

Anyone have can help me with this shell programming?

Need VB Code for following

- Open Notepad File
- Copy All data from Notepad file
- Open MSWORD
- Paste data to Msword
- Run Macro via MSWORD having Find and replace function
- Copy all data from word and paste into Notepad
- Save Notepad file
- Close Notepad and MSWORD

kadghar's Avatar
Expert
 
Join Date: Apr 2007
Location: Mexico City
Posts: 1,155
#2: Jul 2 '08

re: Automated Application using VB


Quote:

Originally Posted by sneh4ever

...
Need VB Code for following

- Open Notepad File
- Copy All data from Notepad file
- Open MSWORD
- Paste data to Msword
- Run Macro via MSWORD having Find and replace function
- Copy all data from word and paste into Notepad
- Save Notepad file
- Close Notepad and MSWORD

Well, you should give it a try by yourself, and then, if you have any particular questions we'll be glad to help you.

BTW, you dont need to open notepad, notepad uses TXT files and you can read them via VB using OPEN/FOR
then save the file in a String, and use the REPLACE function
Use OPEN/FOR once again to save the string as a TXT
this way you dont have to lead with Word, macros or ActiveX

HTH
Reply


Similar Visual Basic 4 / 5 / 6 bytes