Non standard suffix to prn files

D

Dudley

I have to produce print files with the suffix ".MEM". I have found that if I
put in filename XYZ.MEM I get XYZ.MEM.prn, but I can get round this by
printing to file, selecting the correct folder and entering file name in
quotes "XYZ.MEM". I would like to automate this for the user entering the
full location c:\my folder\"XYZ.MEM", but this is rejected as an invalid file
name. Can anyone suggest a way round this problem?

Thanks
Dudley
 
J

Jonathan West

Dudley said:
I have to produce print files with the suffix ".MEM". I have found that if
I
put in filename XYZ.MEM I get XYZ.MEM.prn, but I can get round this by
printing to file, selecting the correct folder and entering file name in
quotes "XYZ.MEM". I would like to automate this for the user entering the
full location c:\my folder\"XYZ.MEM", but this is rejected as an invalid
file
name. Can anyone suggest a way round this problem?


You automate this using the Printout method. Set the OutputFileName
parameter to the full pathname of the file including the filename extension,
"c:\my folder\XYZ.MEM" in your example, and set PrintToFile to True

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
D

Dudley

Thanks for that. I had actually done what you suggested, but I had only
looked at the result when I did 'record macro', and the filename was
'.MEM.prn'. When I do 'run macro' it comes out OK as '.MEM'.

Regards
Dudley
 

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