Note Pad

TedMartin

Registered User.
Local time
Today, 22:22
Joined
Sep 29, 2003
Messages
76
I want to Create a NotePad or WordPad object. I know the VBA code to create a Word Document but as my file must be a .txt file, I need to use NotePad or WordPad.

The usual Word Code I have use is:

Set WordObj = CreateObject("Word.Application")

changing this to CreateObject("NotePad.Application") does not work.

Any thoughts please?

Thanks

Ted
 
Simply use the Open, Print/Write, Close option

Simple sweet and easy !

Search the access help on "Open" for detailed information.

Even easier simply export it using the "docmd.TransferText" command, also on this search the help.

Regards
 
NotePad

Thanks - but can you be more specific. Let me give you the whole story.

I am outputting some data from a report as a .txt file. When this code runs, the created file opens. All I want to do is Close it with code. (or prevent it from opening)
Thanks
 
You can use docmd.outputto to export reports and you can specify how when why what for fileformats and such.

Just type docmd.outputto and hit F1 read all about it in the access help (or i can post the entire text here if you like)
Same for docmd.transfertext and open
But if you want to export a report that you have in your database you want to use outputto

Mind tho: OutputTo is the most inflexible
Tranfertext is a little more flexible
Open, Print/write, Close is most flexible

Regards
 
Hi, I am new to VBA . I need guidence on this.
I need to generate a report from Ms-access.
I have a code which will fetch the records from database table and write into notepad using objfile.writeline.
the output is like this:
EMPLOYEE INFORMATION
====================
SOURCE WWID
CNTNL 110000001
BEGIN-DATE ENDDA
19760127 99991231
VORNA SOURCE
ESTHER MARIA CNTNL
WWID BEGIN-DATE
110000001 19760127
ENDDA VORNA
99991231 ESTHER MARIA
======================
but format is not upto the mark.
i need to format the file. my actuval resul shold be like this
EVT - CROSS FUNCTIONAL REPORT 4/4/2009 9:57:32 PM
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
EMPLOYEE INFORMATION
====================
SOURCE WWID
CNTNL 110000001
BEGIN-DATE ENDDA
19760127 99991231
VORNA SOURCE
ESTHER MARIA CNTNL
WWID BEGIN-DATE
110000001 19760127
ENDDA VORNA
99991231 ESTHER MARIA

here all fields are dynamic fields.
ple give me guidence for this.
or tell me any other option to generate a report in notepad using all dynamic fields.
thanks
Ravi
 
Wow talk about an old thread, atleast you used the search :)

The thing I see as missing is this...
EVT - CROSS FUNCTIONAL REPORT 4/4/2009 9:57:32 PM
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Why dont you prefix this as a constant to your file? Should not be a problem.

Instead of using the variable(s) you add "+-+-+-+-+-+-+-+" and you are done.

Good luck...
 

Users who are viewing this thread

Back
Top Bottom