Saving to SnapShot / Excel etc. (A97)

K

Kahuna

Hi Folks - been using the following code to save a snapshot file for some
time, but just realised, users get a box that offers them the opportunity to
save in HTML, Excel, RTF etc in addition to SnapShot.

DoCmd.OutputTo acOutputReport, DocName, acFormatSNP, strFolder & "\" &
gr_graph_desc & ".snp"

Unfortunately this code does not limit the saving to the SnapShot format but
of course, it does append an .snp extension.

Seems the output box can only be intercepted if your using one of the other
formats (Excel etc acFormatXLS as above). If I try and save using the
following code:

DoCmd.OutputTo acOutputReport, gr_graph_desc, acFormatSNP

which should theoretically open the format selection form and then the 'save
to' dialog then the file is simply not saved (and that's regardless of the
format selected in the dialog)!!!

Is there anyway to suppress the format selection box with this code or - to
intercept the selection box result to append the correct extension?
 
R

Rick Brandt

Kahuna said:
Hi Folks - been using the following code to save a snapshot file for
some time, but just realised, users get a box that offers them the
opportunity to save in HTML, Excel, RTF etc in addition to SnapShot.

DoCmd.OutputTo acOutputReport, DocName, acFormatSNP, strFolder & "\" &
gr_graph_desc & ".snp"

Unfortunately this code does not limit the saving to the SnapShot
format but of course, it does append an .snp extension.

Seems the output box can only be intercepted if your using one of the
other formats (Excel etc acFormatXLS as above). If I try and save
using the following code:

DoCmd.OutputTo acOutputReport, gr_graph_desc, acFormatSNP

which should theoretically open the format selection form and then
the 'save to' dialog then the file is simply not saved (and that's
regardless of the format selected in the dialog)!!!

Is there anyway to suppress the format selection box with this code
or - to intercept the selection box result to append the correct
extension?

The constant acFormatSNP did not exist in Access 97. You have to use the
actual string "Snapshot Format" including the quotes. That is unless you
want to define the constant yourself.
 
K

Kahuna

Rick Brandt said:
The constant acFormatSNP did not exist in Access 97. You have to use the
actual string "Snapshot Format" including the quotes. That is unless you
want to define the constant yourself.
Rick - thanks for that - so if this is working (ie saving the file as a
snapshot) using the acFormatSNP but that constant doesn't exist in A97 -
what's going on?

I assume (with all the dangers that has inherent) that I can simply replace
the acFormatSNP with "Snapshot Format" then - as in:

DoCmd.OutputTo acOutputReport, DocName, "Snapshot Format", strFolder & "\" &
gr_graph_desc & ".snp"

or the preferred:

DoCmd.OutputTo acOutputReport, gr_graph_desc, "Snapshot Format"

To define the constant would it be:

Const acFormatSNP As String = "Snapshot Format" or is there some
'formatting' terminology I'll need to use?

Cheers Rick - great help as always.
 
K

Kahuna

--
Kahuna
------------
Rick - thanks for that - so if this is working (ie saving the file as a
snapshot) using the acFormatSNP but that constant doesn't exist in A97 -
what's going on?

I assume (with all the dangers that has inherent) that I can simply
replace the acFormatSNP with "Snapshot Format" then - as in:

DoCmd.OutputTo acOutputReport, DocName, "Snapshot Format", strFolder & "\"
& gr_graph_desc & ".snp"

or the preferred:

DoCmd.OutputTo acOutputReport, gr_graph_desc, "Snapshot Format"

To define the constant would it be:

Const acFormatSNP As String = "Snapshot Format" or is there some
'formatting' terminology I'll need to use?

Cheers Rick - great help as always.
Got that working great thanks Rick - redundant question in my last post.

Brings me back to my original challenge though (now that the selection box
has been bypassed), that if I exclude the Folder and FileName (in order to
open the save dialog and change it there) the file is not actually saved -
and the routine just ends! Any suggestions on what's occurring then?
 

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