Control Notepad with VBA

B

Brad

I need to automate the following tasks from within Access. I need to
open a txt file (easy part), then change the page setup setting from
within Notepad, and print the document. Anybody know if this
possible. I tried opening the file and using sendkeys but the
sendkeys were executed within Access.

If that is possible I also need to open a PDF file, add a background
to the document and print it.

Anybody got any ideas on this.
 
T

Tony Toews [MVP]

Brad said:
I need to automate the following tasks from within Access. I need to
open a txt file (easy part), then change the page setup setting from
within Notepad, and print the document. Anybody know if this
possible. I tried opening the file and using sendkeys but the
sendkeys were executed within Access.

You could try searching for a API calls that would
1) enumerate all the open applications titles to figure out which one
is yours. Ensure you test with Notepad already open with other files
too.
2) setting the focus to the above found instance of Notepad.

Start at mvs.org/access and look in the API section and also at
vbnet.mvps.org. Most VB API calls work quite well in Access.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top