Exporting Text to a notepad

M

Mark

I am trying to run a macro that exports text from a query to notepad, this
works, but Access attempts to put a frame around each result, I need raw text.

See below - Can you help?

-Mark Matzke

I need the result in notpad to be:

1a234567
2a987654
3b543210

I get something like this:
 
D

Dirk Goldgar

I am trying to run a macro that exports text from a query to notepad,
this works, but Access attempts to put a frame around each result, I
need raw text.

See below - Can you help?

-Mark Matzke

I need the result in notpad to be:

1a234567
2a987654
3b543210

I get something like this:

What actions is your macro performing?
 
V

Van T. Dinh

Mark

If you use the TransferText or OutPutTo action, check the arguments (and
Export Specification you set for the TransferText action).
 
M

Mark

Macro: OutputTo

Object Name FTP File
Output Format MS-DOS Text
Aoutput File c:\Locate.txt
Auto Start No
Template File

This txt file then is reviewd and once approved sent directly to an FTP
server owned by the state.
 
M

Mark

I am currently using the below arguements, please let me know if you know of
a better one.

Macro: OutputTo

Object Name FTP File
Output Format MS-DOS Text
Aoutput File c:\Locate.txt
Auto Start No
Template File

--
Mark Matzke


Van T. Dinh said:
Mark

If you use the TransferText or OutPutTo action, check the arguments (and
Export Specification you set for the TransferText action).
 
V

Van T. Dinh

I don't see "MS-DOS Text" as an option in the Output Format argument (using
Access 2003).

If you have the option "Text file (*.txt), select this option instead of
MS-DOS Text.

--
HTH
Van T. Dinh
MVP (Access)



I am currently using the below arguements, please let me know if you know
of
a better one.

Macro: OutputTo

Object Name FTP File
Output Format MS-DOS Text
Aoutput File c:\Locate.txt
Auto Start No
Template File

--
Mark Matzke


Van T. Dinh said:
Mark

If you use the TransferText or OutPutTo action, check the arguments (and
Export Specification you set for the TransferText action).

--
HTH
Van T. Dinh
MVP (Access)



message
 
D

Dirk Goldgar

Macro: OutputTo

Object Name FTP File
Output Format MS-DOS Text
Aoutput File c:\Locate.txt
Auto Start No
Template File

This txt file then is reviewd and once approved sent directly to an
FTP server owned by the state.

Interesting. I don't have "MS-DOS Text" among my options, but when I
select "Text Files (*.txt)" for the Output Format, I get formatted
output that is probably like what you're getting.

I suggest that instead of using the OutputTo action, you use the
TransferText instead. You can either use the "Export Delimited"
transfer type, or use "Export Fixed Width" -- but for fixed-width output
you'll first have to create an import/export specification to specify
the output column widths.
 
V

Van T. Dinh

I agreed with Dirk's advice to use TransferText instead. In fact, I can't
remember when I last used OutputTo to create a text-file export, possibly
Access 95.
 
M

Mark

"1a234567"
"2a987654"
"3b543210"

I tried what you said - The above is what I got with the Export Delimited.
I also tried Export Fixed Width, but it is looking for "Transfer Type
argument"
 
M

Mark

"1a234567"
"2a987654"
"3b543210"

I tried what Dirk said - The above is what I got with the Export Delimited.
I also tried Export Fixed Width, but it is looking for "Transfer Type
argument" - The data needs to be saved without the quotes:

1a234567
2a987654
3b543210

--
Mark Matzke

--
Mark Matzke


Van T. Dinh said:
I agreed with Dirk's advice to use TransferText instead. In fact, I can't
remember when I last used OutputTo to create a text-file export, possibly
Access 95.
 
D

Dirk Goldgar

"1a234567"
"2a987654"
"3b543210"

I tried what you said - The above is what I got with the Export
Delimited. I also tried Export Fixed Width, but it is looking for
"Transfer Type argument"

I think you must mean that it's looking for a Specification Name
argument, since "Export Fixed Width" *is* the Transfer Type argument.

If you don't want the quotes around the values, I don't think you can
use the delimited format. So you'll need to use fixed width output, and
that means you'll need to create an export specification. To do that,
export the query once manually to a text file, and choose Fixed Width
output in the Export Text Wizard. Set up the column widths the way you
want, and when you get to the point in the Export Text Wizard where
everything is specified and you're ready to finish and export the file,
click the Advanced... button to review the specification, and then click
the Save As... button on that dialog and save it with a meaningful name.
Once you've saved the specification, you don't even have to finish the
export.

Go back to your macro, and enter the name of that specification in the
macro's "Specification Name" argument.
 
V

Van T. Dinh

The deault is to enclose Text values in double quotes. If you don't want
this enclosure, create an Export Specification and used it in your
TransferText action.

See Access Help topic "Export data or database objects" for more info. on
Export spec.
 
M

Mark

This is what worked:
If you don't want the quotes around the values, I don't think you can
use the delimited format. So you'll need to use fixed width output, and
that means you'll need to create an export specification. To do that,
export the query once manually to a text file, and choose Fixed Width
output in the Export Text Wizard. Set up the column widths the way you
want, and when you get to the point in the Export Text Wizard where
everything is specified and you're ready to finish and export the file,
click the Advanced... button to review the specification, and then click
the Save As... button on that dialog and save it with a meaningful name.
Once you've saved the specification, you don't even have to finish the
export.

Go back to your macro, and enter the name of that specification in the
macro's "Specification Name" argument.

--
Mark Matzke


Van T. Dinh said:
The deault is to enclose Text values in double quotes. If you don't want
this enclosure, create an Export Specification and used it in your
TransferText action.

See Access Help topic "Export data or database objects" for more info. on
Export spec.
 
M

Mark

Thank you for all your help on this!
--
Mark Matzke


Van T. Dinh said:
The deault is to enclose Text values in double quotes. If you don't want
this enclosure, create an Export Specification and used it in your
TransferText action.

See Access Help topic "Export data or database objects" for more info. on
Export spec.
 
S

schasteen

Have you tried to make a report from the query and export that? If you use
OutPutTo and text on a report you don't get the frame. You will have to
adjust the formmating some.
 
M

Mark

This is what worked for my issue:
If you don't want the quotes around the values, I don't think you can
use the delimited format. So you'll need to use fixed width output, and
that means you'll need to create an export specification. To do that,
export the query once manually to a text file, and choose Fixed Width
output in the Export Text Wizard. Set up the column widths the way you
want, and when you get to the point in the Export Text Wizard where
everything is specified and you're ready to finish and export the file,
click the Advanced... button to review the specification, and then click
the Save As... button on that dialog and save it with a meaningful name.
Once you've saved the specification, you don't even have to finish the
export.

Go back to your macro, and enter the name of that specification in the
macro's "Specification Name" argument.
 

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