Emailing Reports as PDFs - But FileName problem

Mlister51

New member
Local time
Today, 20:40
Joined
Feb 17, 2014
Messages
3
First off - I'm not using code, just using the macro builder functionality in 2010.

I want to send different reports to 20 odd people. Reports are ready and work. Macro builder is fine and seems to work. But, no matter what I do the file name of the PDF does not change - the content does, but the name won't, which is of no use to me and will confuse my 'users'.

Bit more info - my db is an Actions Log for a large project. I want to send User1 a list of their actions and User2 a list of theirs. Like i said above, the reports work fine. The macro appears to work fine as well. And the user does indeed receive a list of their actions - but the PDF file is called ActionsForUser1 for all the reports. So User2 gets a report with their actions in it (that bit works) but the filename says User1.

Grrrrrrrrrrrrrr. Should not be difficult. IT's like everything is working as I want it to, but every PDF report outut will always be called the same damn thing!! :mad::mad::mad:

Any ideas?
 
Let me know when you are ready to move on to VBA. I (or) any other member will be able to guide you.

Until then, good luck :)
 
I don't believe it's possible to pull the current user's username via a macro. If there is, I've certainly never heard of it, and I'm sure Paul would have had the answer for you. Is the reason code isn't an option personal preference or a limitation of your system?

I guess you could create the same macro for each user, and have each select his or her own personal version, but that is a lot of unnecessary maintenance.
 
Code - don't use it cos I don't know how. I've used a tiny bit of code over the years, for things like spell checking fields 'on exit' - but that's it.

Re my problem - I haven't explained it very well i guess as it's not to do with usernames.

I'll try again.

I've got three reports - A, B and C.
They work fine and show the right data.
When I build a macro to send report A (as a PDF) to user 1 it works fine - it sends the right message, the right report to the right user.
When I build another macro to send report B to user 2 it seems to work fine - user 2 gets the report, indeed they get the right report in terms of the data, but the PDF file is called report A. In other words, no matter what I do, every PDF file (report) I send to every user is called the same thing even though they contain different (and correct) data! I could tell the users to simply ignore the name of the PDF, but that's a bit rubbish to be honest!!

Make any more sense?
 
Okay, that certainly helps a bit. I actually generally avoid macros, and my quick runthrough here didn't show a macro command that jumped out at me, suggesting you might be using RunCommand to do this. That said, this is just an off the cuff idea, but I assume you've checked the 'output to' parameter of whatever command you're using to save the file?
 
Last edited:
Hi Mlister51,
I had a similar problem here and in the course of trying to solve it found that the report's caption is used as the pdf name. You should be able to change that to feed a static name through to your reports, although I'm not an expert, it worked for me! If you want to be a bit flash, you can use the code shown in the report's on load and change the fields a bit. So the pdf name might include the current date?
Paul helped me to move away from macros, its not as difficult as you might think. If you're a logical enough thinker to macro things, you're half-way there!
Hope that helps :)
 

Users who are viewing this thread

Back
Top Bottom