Writing Text file using Print Command

Q

Question Boy

Hi I am using Albert's Super Easy MailMerge, well the txt file generation
routine. it use the following line

Print #intFile, strData

to populate a text file.

My strData can get rather large and appear to be having issues if it exceed
255 chrs. Is Print limited top 255 chrs? If so, what alternative method
could I use instead? If not, am I missing something else?

Also, I tried to google different subject to find info on the Print command,
but got all sort of irrelevant info on printing..., What is the proper term
to look this up?

Thank you

QB
 
D

dymondjack

Lookup "VBA File IO" and you should see some subject matter on how to deal
with text files. I'm not sure how detailed you'll find info on the Print
command, most of what I've looked at in the past on the subject was pretty
stripped (I don't think there's much to it actually), and unfortunately I
don't know too much about the character limit.

hth

--
Jack Leach
www.tristatemachine.com

- "Success is the ability to go from one failure to another with no loss of
enthusiasm." - Sir Winston Churchill
 
S

Stuart McCall

Question Boy said:
Hi I am using Albert's Super Easy MailMerge, well the txt file generation
routine. it use the following line

Print #intFile, strData

to populate a text file.

My strData can get rather large and appear to be having issues if it
exceed
255 chrs. Is Print limited top 255 chrs? If so, what alternative method
could I use instead? If not, am I missing something else?

Try this:

Open "MyFileName" For Binary Access Write As intFile
Put #intFile, , strData
Close intFile

That will write out the entire contents of strData. If you still get only
255 chars then something else is wrong.
Is strData being filled via a memo field?
Also, I tried to google different subject to find info on the Print
command,
but got all sort of irrelevant info on printing..., What is the proper
term
to look this up?

Try searching for "Print # Statement"
 
A

Albert D. Kallal

My strData can get rather large and appear to be having issues if it
exceed
255 chrs. Is Print limited top 255 chrs? If so, what alternative method
could I use instead? If not, am I missing something else?

There not a limit on the line size, but if your query has any type of
formatting function, then access often truncates the ONE field to 255.

so, there not a limit on the output, but if you using a query with some
function on a particular column, it can get truncated....

I would open up the query that the merge is based on, and double check if it
truncating at that point in time....
 

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