Where I can set the Access 2007 temporary file area for PDF exports?

  • Thread starter Milhouse Van Houten
  • Start date
M

Milhouse Van Houten

Annoyingly, Access uses the destination directory to store a .TMP file when
you're exporting to PDF and overwriting a preexisting PDF. It's only
momentary, but it's long enough for Sharepoint to notice the file and send
me an alert about a new file addition, the .TMP, in addition to the actual
file I'm exporting (I have alert monitoring set on the Sharepoint
directory).

If there was a way to set Access to use a different directory, then I could
avoid the problem.

Thanks
 
A

Albert D. Kallal

Well, assuming the .tmp file is created in the target where you send the
pdf, then I would send the pdf to an temp dir, or at least one that not
going to cause any alerts by SharePoint. You then would have to execute a
line of code to copy the pdf to its correct final location. this would avoid
the issues with the temp file.

So, you can't set the location of the .tmp file, but you can set/specify
where the pdf goes. So, send the pdf to a known location, and then execute a
filecopy command after to the correct location.
 
M

Milhouse Van Houten

Filecopy sounds like an excellent workaround. Thanks.

Do you have a method in mind to handle the variability of the filenames,
however? The name of the file that the user makes up, which varies, has to
find its way into the macro somehow, and after some searching around for an
answer nothing is really jumping out at me.
 
A

Albert D. Kallal

Milhouse Van Houten said:
Filecopy sounds like an excellent workaround. Thanks.

Do you have a method in mind to handle the variability of the filenames,
however? The name of the file that the user makes up, which varies, has
to find its way into the macro somehow, and after some searching around
for an answer nothing is really jumping out at me.

I would likely build my own prompt for the output file name (and, simply
eliminate the need for the user to even type in the path name).

The code that sends the pdf would thus use a file name you choose, (and
know), and then execute a filecopy command to the resulting correct dir and
file you received from the user....

DoCmd.OutputTo acOutputReport, Screen.ActiveReport.Name, acFormatPDF,
strFileName

In above strFileName can your non sharepoint dir, you then go:

strSPFile = \\path name to SharePoint\dir name\ & strUserFileName & ".pdf"

FileCopy strFileName, strSPFile

The part that prompts the user for the output file would have to check if
the user supplied the .pdf extension or add it as above example...

It not clear if the user is viewing an report when this occurs, but if yes,
then simply creating your own PDF option on the ribbon that executes the
above code. I have a custom PDF code sample for a2007 here that does quite
much of what you need here:

http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm

(grab last example PDF and email -- works with 2007 runtime also and puts a
pdf option in the ribbon)
 
M

Milhouse Van Houten

Albert D. Kallal said:
I would likely build my own prompt for the output file name (and, simply
eliminate the need for the user to even type in the path name).

The code that sends the pdf would thus use a file name you choose, (and
know), and then execute a filecopy command to the resulting correct dir
and file you received from the user....

DoCmd.OutputTo acOutputReport, Screen.ActiveReport.Name, acFormatPDF,
strFileName
..
.. etc
..
Thanks for all that! It's a lot to chew on but should be enough to get me
going.
 

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