Avatar billede Newbee1 Novice
14. april 2010 - 08:46 Der er 18 kommentarer og
1 løsning

Sned obejct

Hej

Jeg har en knap, som ved aktivering skal sende 3 x rapporter
til flere modtagere. Eks rapport1 og rapport2 og rapport3.

Ved at klikke på knappen aktiveres makro, som sender de 3 rapporter som .txt fil.

Hvordan kan jeg lave en makro, der sender flere rapporter på en gang ?


MVH

Tony
Avatar billede terry Ekspert
14. april 2010 - 08:58 #1
I think you will need to use Outlook using VBA code

You can find an example here where you can attach files

http://www.eksperten.dk/spm/670613
Avatar billede Newbee1 Novice
14. april 2010 - 09:07 #2
Hi Terry

Cannot use outlook, there are many users using the same
login, so outlook is not used on this computer.


Regards

Tony
Avatar billede terry Ekspert
14. april 2010 - 09:21 #3
I dont think you can attach more than one report at a time using Send Object :o(
Avatar billede terry Ekspert
14. april 2010 - 09:33 #4
Heres a link http://www.granite.ab.ca/access/email.htm whith some example for sending reports etc.

One of them "demonstrate sending multiple reports to multiple recipients ".

I've had a very quick look at it but I cant see that it can send more than one report in the same email!
Avatar billede terry Ekspert
14. april 2010 - 09:34 #5
I thinkyou will need to look at the link "Directly via the Winsock"
Avatar billede terry Ekspert
26. april 2010 - 08:39 #6
status please ?
Avatar billede Newbee1 Novice
26. april 2010 - 10:56 #7
Hi Terry


Installed Outlook on the computer, now I will
try to use the program code you linked to.

But because there are many users, i dont want to save the report on the hardrive first.

It should open the report automaticly, and the  attach it to the the email, is that possible ?

Tks, for your feed back.

Tony
Avatar billede terry Ekspert
26. april 2010 - 11:23 #8
"But because there are many users, i dont want to save the report on the hardrive first."

Why not? '
You can always delete them again once you have sent them
Avatar billede Newbee1 Novice
27. april 2010 - 08:21 #9
Hi Terry


Many users have to send the report 4 times a day.


I'am affraid to many mistakes, it hard to have diciplin,
with many users.  To many places where mistakes can happend.

The should be a button attached to a makro, to open and attach
the 3 reports, to an email. (no mistake will happend)

Regards

Tony
Avatar billede terry Ekspert
27. april 2010 - 11:47 #10
"To many places where mistakes can happend."

I agree, but if its all done in code then the users arent aware of this.

Access CAN NOT attach more than one file to a mail without using code. And to do this the reports will have to be saved to the HD
Avatar billede Newbee1 Novice
27. april 2010 - 22:28 #11
Hi Terry


Okay, can the code you linked to, open more than one report ?
(and how ?)

http://www.eksperten.dk/spm/670613


Regards

Tony
Avatar billede terry Ekspert
28. april 2010 - 08:51 #12
If you look at this part


vedhæftet.Add "C:\test.txt" '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Your file goes here


you just need to add another line for each attachment


vedhæftet.Add "C:\test2.txt" '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Your NEXT file goes here
Avatar billede Newbee1 Novice
28. april 2010 - 20:29 #13
Tks Terry


And it will automaticly save the files as Test1 and test2 ?


Regards


Tony
Avatar billede Newbee1 Novice
01. maj 2010 - 12:07 #14
Hi Terry

My last question, will it automaticly save 2 files ?

You wrote in #10, it will all happpens in the code, the user will
not be aware, that the files are saved on the harddisk.


Regards

Tony
Avatar billede terry Ekspert
01. maj 2010 - 12:25 #15
You need to use DoCmd.OutPutTo ... to save the reports first

http://www.blueclaw-db.com/docmd_outputto_example.htm
Avatar billede terry Ekspert
01. maj 2010 - 12:32 #16
Tony you should also follow up on other questions you have going on otherwise users may no be happy to help you

F.eks:
http://www.eksperten.dk/spm/906998
Avatar billede Newbee1 Novice
01. maj 2010 - 19:40 #17
Hi Terry


Yes you are right.


Sorry.
Avatar billede terry Ekspert
02. maj 2010 - 09:29 #18
have ýou tried the idea at #5?
Avatar billede Newbee1 Novice
10. august 2010 - 17:12 #19
Løsning:


At samle rapporterne til en rapport og derefter bruge send obect.


Tak for hjælpen
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester