Lebans report to pdf question

M

M. Murphy

I have been using Stephen Lebans report to pdf solution for a while now.
I have been using an "autonumber" type counter to make a unique file name,
and am using a pre determined path, it all works great.

Now my boss would like me to customize it, so that the save dialog box
appears (easy enough), BUT he would like the save dialog to use a certain
path, and not the my documents folder as it does by default. He would also
like (but not require) the same file naming convention that I use to be pre
filled in to the file name in the save dialog box. I would be happy if I
could just set the path, the file name part would be a bonus, but we can type
that if necessary.



Is there any way to do this?

TIA
 
M

M. Murphy

Thanks for the quick response,
I was really looking to modify the lebans code, so that the dialog box in
the report to pdf function was kind of pre filled in, but I will give this a
shot.
I tried to add a different function (browse folder dialog from the lebans
site) to my DB earlier today and had no luck. Its was little beyond my vb
skills to merge these together.
 
D

Douglas J. Steele

Afraid I don't have Stephen's code on this machine, so I can't say whether
you can just tweak his code.

Hopefully some other reader will pipe in.
 
M

M. Murphy

Douglas, Thanks for kickstarting my brain!

I have tweaked Stephen's code a little, now the dialog box starts in the
folder that I want.
I went into the module and adjusted clsDialog.InitDir (in the fFileDialog
section) to my liking, that is the initial directory that the dialog starts
in. Cool.
So, I figure that I could also tweak clsDialog.FileTitle as well. I am not
even sure if that will pre-fill in the file name, but what the hell, thats
how I learn. So I adjusted my code from my form and put it in the
clsDialog.FileTitle
Well, that did'nt work, apparently clsDialog.FileTitle is not the file
name.

Does anyone have any suggestions on passing my uniquely generated file name
into the module?
 
D

Douglas J. Steele

I believe you need to set the FileName property, not the FileTitle property.
 
R

Richard

Hi M. Murphy,

I also use that module, what would I change "clsDialog.InitDir" to open all
ways at the desktop?

Thanks
Richard
 
D

Douglas J. Steele

Copy the code from http://www.mvps.org/access/api/api0054.htm at "The Access
Web" into a new module

Which desktop do you want it to be on: the All Users one, or the current
user's?

For All Users, try

clsDialog.InitDir = fGetSpecialFolderLocation(CSIDL_COMMON_DESKTOPDIRECTORY)

For the current user's, try

clsDialog.InitDir = fGetSpecialFolderLocation(CSIDL_DESKTOPDIRECTORY)
 
M

M. Murphy

Great info in that link, that will come in handy down the road for me!!
Thank you!!!!

About my original issue, I don't see clsDialog.FileName in there, should I
just add it to that list?
 
M

M. Murphy

Ah, again I just jump right in, head first....

Yes I added the property clsDialog.FileName to that list, and it worked
perfectly. Added my cool unique file nameing code, with a little
modification (the module didn't like the Me! part, had to refer to the form
by its name), and bingo, it all works great now.

Stephen Lebans, you are the MAN!!!

Douglas, just conversing with you makes me think better, thank you for
listening to me, and your great information.
 

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