PC Review


Reply
Thread Tools Rate Thread

Attachments to Email with SendObject

 
 
ant1983
Guest
Posts: n/a
 
      24th Jan 2010
Hi Guyz,

I have a form (tblBooking subform1) (I know the naming is a mess!) - On that
form i have a button cmdEmailInvite which opens a report
rptTrainingConfirmation which runs off a query qryTrainingInvites.

Basically the cmdEmailInvite is a SendObject so sends that report to an
email as a pdf.

My problem is that i need other attachements on that email to and in another
post somene said Access cant attach external files to an email. Now firstly,
its not really an external file as the attachements i want attached are saved
in my database in another table as an attachemnt field type but anyway...

REgardless, i thought of another way to get around this.

I thought i could create Outlook Templates with my attachemnts saved in the
templates and then refer to that template in my code - would that work?

So i saved the template at the folowing location:

C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft

Then i went to the code and changed it to:

Private Sub cmdEmailInvite_Click()
On Error GoTo Err_cmdEMailInvite_Click

Dim stDocName As String

stDocName = "Training Confirmation"
DoCmd.SendObject acReport, stDocName, acFormatPDF, txtEmail, "", "",
"Training Confirmation: " & txtCourse & " on " & dateStartDate & " to " &
dateEndDate, "Dear Delegate Blach Blah" , ,
C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft

Exit_cmdEMailInvite_Click:
Exit Sub

Err_cmdEMailInvite_Click:
MsgBox Err.Description
Resume Exit_cmdEMailInvite_Click

End Sub

It doesnt work though. Brings up a "Compile Error - Syntax Error"

So basically my questions:

1 - Whats wrong with my code?
2 - Would the whole template idea work?

My 3rd question is basically if the above isnt possible. Somene said in
another post that i could use outlook automation. I have no idea what that
means - they referred me to
http://www.devhut.net/index.php?lang...13#OutlookAuto so...
3 - Where does that code go? on my command button or somewhere in Outlook?

Thanks a ton!

ant1983
 
Reply With Quote
 
 
 
 
Daniel Pineault
Guest
Posts: n/a
 
      24th Jan 2010
You will need to switch to outlook automation, or another alternate method as
sendobject only allows one attachment.

Outlook automation is simple, and you can get a sample function to work with
at:

http://www.devhut.net/index.php?lang...13#OutlookAuto

Save your attachments to the hard drive, soo generate your pdf first, then
simply use the above mentioned e-mail routine to send your message.
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"ant1983" wrote:

> Hi Guyz,
>
> I have a form (tblBooking subform1) (I know the naming is a mess!) - On that
> form i have a button cmdEmailInvite which opens a report
> rptTrainingConfirmation which runs off a query qryTrainingInvites.
>
> Basically the cmdEmailInvite is a SendObject so sends that report to an
> email as a pdf.
>
> My problem is that i need other attachements on that email to and in another
> post somene said Access cant attach external files to an email. Now firstly,
> its not really an external file as the attachements i want attached are saved
> in my database in another table as an attachemnt field type but anyway...
>
> REgardless, i thought of another way to get around this.
>
> I thought i could create Outlook Templates with my attachemnts saved in the
> templates and then refer to that template in my code - would that work?
>
> So i saved the template at the folowing location:
>
> C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
>
> Then i went to the code and changed it to:
>
> Private Sub cmdEmailInvite_Click()
> On Error GoTo Err_cmdEMailInvite_Click
>
> Dim stDocName As String
>
> stDocName = "Training Confirmation"
> DoCmd.SendObject acReport, stDocName, acFormatPDF, txtEmail, "", "",
> "Training Confirmation: " & txtCourse & " on " & dateStartDate & " to " &
> dateEndDate, "Dear Delegate Blach Blah" , ,
> C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
>
> Exit_cmdEMailInvite_Click:
> Exit Sub
>
> Err_cmdEMailInvite_Click:
> MsgBox Err.Description
> Resume Exit_cmdEMailInvite_Click
>
> End Sub
>
> It doesnt work though. Brings up a "Compile Error - Syntax Error"
>
> So basically my questions:
>
> 1 - Whats wrong with my code?
> 2 - Would the whole template idea work?
>
> My 3rd question is basically if the above isnt possible. Somene said in
> another post that i could use outlook automation. I have no idea what that
> means - they referred me to
> http://www.devhut.net/index.php?lang...13#OutlookAuto so...
> 3 - Where does that code go? on my command button or somewhere in Outlook?
>
> Thanks a ton!
>
> ant1983

 
Reply With Quote
 
ant1983
Guest
Posts: n/a
 
      24th Jan 2010
Thanks Daniel. You've mentioned that before and like i saidin my post i have
no idea what to do with that code. Ive asked some other questions. Can
anyone assist? Thanks.


"Daniel Pineault" wrote:

> You will need to switch to outlook automation, or another alternate method as
> sendobject only allows one attachment.
>
> Outlook automation is simple, and you can get a sample function to work with
> at:
>
> http://www.devhut.net/index.php?lang...13#OutlookAuto
>
> Save your attachments to the hard drive, soo generate your pdf first, then
> simply use the above mentioned e-mail routine to send your message.
> --
> Hope this helps,
>
> Daniel Pineault
> http://www.cardaconsultants.com/
> For Access Tips and Examples: http://www.devhut.net
> Please rate this post using the vote buttons if it was helpful.
>
>
>
> "ant1983" wrote:
>
> > Hi Guyz,
> >
> > I have a form (tblBooking subform1) (I know the naming is a mess!) - On that
> > form i have a button cmdEmailInvite which opens a report
> > rptTrainingConfirmation which runs off a query qryTrainingInvites.
> >
> > Basically the cmdEmailInvite is a SendObject so sends that report to an
> > email as a pdf.
> >
> > My problem is that i need other attachements on that email to and in another
> > post somene said Access cant attach external files to an email. Now firstly,
> > its not really an external file as the attachements i want attached are saved
> > in my database in another table as an attachemnt field type but anyway...
> >
> > REgardless, i thought of another way to get around this.
> >
> > I thought i could create Outlook Templates with my attachemnts saved in the
> > templates and then refer to that template in my code - would that work?
> >
> > So i saved the template at the folowing location:
> >
> > C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
> >
> > Then i went to the code and changed it to:
> >
> > Private Sub cmdEmailInvite_Click()
> > On Error GoTo Err_cmdEMailInvite_Click
> >
> > Dim stDocName As String
> >
> > stDocName = "Training Confirmation"
> > DoCmd.SendObject acReport, stDocName, acFormatPDF, txtEmail, "", "",
> > "Training Confirmation: " & txtCourse & " on " & dateStartDate & " to " &
> > dateEndDate, "Dear Delegate Blach Blah" , ,
> > C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
> >
> > Exit_cmdEMailInvite_Click:
> > Exit Sub
> >
> > Err_cmdEMailInvite_Click:
> > MsgBox Err.Description
> > Resume Exit_cmdEMailInvite_Click
> >
> > End Sub
> >
> > It doesnt work though. Brings up a "Compile Error - Syntax Error"
> >
> > So basically my questions:
> >
> > 1 - Whats wrong with my code?
> > 2 - Would the whole template idea work?
> >
> > My 3rd question is basically if the above isnt possible. Somene said in
> > another post that i could use outlook automation. I have no idea what that
> > means - they referred me to
> > http://www.devhut.net/index.php?lang...13#OutlookAuto so...
> > 3 - Where does that code go? on my command button or somewhere in Outlook?
> >
> > Thanks a ton!
> >
> > ant1983

 
Reply With Quote
 
Daniel Pineault
Guest
Posts: n/a
 
      24th Jan 2010
We are all here to help. What do you not understand or know to do?

It is a standard function with input variables very similar to those used in
the sendobject().

If you explain what you need further help with, we will be more than willing
to assist. One way or another, sendobject will not do what you need it to do
in your scenario.
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"ant1983" wrote:

> Thanks Daniel. You've mentioned that before and like i saidin my post i have
> no idea what to do with that code. Ive asked some other questions. Can
> anyone assist? Thanks.
>
>
> "Daniel Pineault" wrote:
>
> > You will need to switch to outlook automation, or another alternate method as
> > sendobject only allows one attachment.
> >
> > Outlook automation is simple, and you can get a sample function to work with
> > at:
> >
> > http://www.devhut.net/index.php?lang...13#OutlookAuto
> >
> > Save your attachments to the hard drive, soo generate your pdf first, then
> > simply use the above mentioned e-mail routine to send your message.
> > --
> > Hope this helps,
> >
> > Daniel Pineault
> > http://www.cardaconsultants.com/
> > For Access Tips and Examples: http://www.devhut.net
> > Please rate this post using the vote buttons if it was helpful.
> >
> >
> >
> > "ant1983" wrote:
> >
> > > Hi Guyz,
> > >
> > > I have a form (tblBooking subform1) (I know the naming is a mess!) - On that
> > > form i have a button cmdEmailInvite which opens a report
> > > rptTrainingConfirmation which runs off a query qryTrainingInvites.
> > >
> > > Basically the cmdEmailInvite is a SendObject so sends that report to an
> > > email as a pdf.
> > >
> > > My problem is that i need other attachements on that email to and in another
> > > post somene said Access cant attach external files to an email. Now firstly,
> > > its not really an external file as the attachements i want attached are saved
> > > in my database in another table as an attachemnt field type but anyway...
> > >
> > > REgardless, i thought of another way to get around this.
> > >
> > > I thought i could create Outlook Templates with my attachemnts saved in the
> > > templates and then refer to that template in my code - would that work?
> > >
> > > So i saved the template at the folowing location:
> > >
> > > C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
> > >
> > > Then i went to the code and changed it to:
> > >
> > > Private Sub cmdEmailInvite_Click()
> > > On Error GoTo Err_cmdEMailInvite_Click
> > >
> > > Dim stDocName As String
> > >
> > > stDocName = "Training Confirmation"
> > > DoCmd.SendObject acReport, stDocName, acFormatPDF, txtEmail, "", "",
> > > "Training Confirmation: " & txtCourse & " on " & dateStartDate & " to " &
> > > dateEndDate, "Dear Delegate Blach Blah" , ,
> > > C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
> > >
> > > Exit_cmdEMailInvite_Click:
> > > Exit Sub
> > >
> > > Err_cmdEMailInvite_Click:
> > > MsgBox Err.Description
> > > Resume Exit_cmdEMailInvite_Click
> > >
> > > End Sub
> > >
> > > It doesnt work though. Brings up a "Compile Error - Syntax Error"
> > >
> > > So basically my questions:
> > >
> > > 1 - Whats wrong with my code?
> > > 2 - Would the whole template idea work?
> > >
> > > My 3rd question is basically if the above isnt possible. Somene said in
> > > another post that i could use outlook automation. I have no idea what that
> > > means - they referred me to
> > > http://www.devhut.net/index.php?lang...13#OutlookAuto so...
> > > 3 - Where does that code go? on my command button or somewhere in Outlook?
> > >
> > > Thanks a ton!
> > >
> > > ant1983

 
Reply With Quote
 
Gina Whipp
Guest
Posts: n/a
 
      25th Jan 2010
Ant1983,

The code on that page must copied into a module and then named anything
expect the same name as the function. Is that the part you are not
understanding?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
"ant1983" <(E-Mail Removed)> wrote in message
news:7D0CA7F5-871E-40FA-BDDE-(E-Mail Removed)...
Thanks Daniel. You've mentioned that before and like i saidin my post i
have
no idea what to do with that code. Ive asked some other questions. Can
anyone assist? Thanks.


"Daniel Pineault" wrote:

> You will need to switch to outlook automation, or another alternate method
> as
> sendobject only allows one attachment.
>
> Outlook automation is simple, and you can get a sample function to work
> with
> at:
>
> http://www.devhut.net/index.php?lang...13#OutlookAuto
>
> Save your attachments to the hard drive, soo generate your pdf first, then
> simply use the above mentioned e-mail routine to send your message.
> --
> Hope this helps,
>
> Daniel Pineault
> http://www.cardaconsultants.com/
> For Access Tips and Examples: http://www.devhut.net
> Please rate this post using the vote buttons if it was helpful.
>
>
>
> "ant1983" wrote:
>
> > Hi Guyz,
> >
> > I have a form (tblBooking subform1) (I know the naming is a mess!) - On
> > that
> > form i have a button cmdEmailInvite which opens a report
> > rptTrainingConfirmation which runs off a query qryTrainingInvites.
> >
> > Basically the cmdEmailInvite is a SendObject so sends that report to an
> > email as a pdf.
> >
> > My problem is that i need other attachements on that email to and in
> > another
> > post somene said Access cant attach external files to an email. Now
> > firstly,
> > its not really an external file as the attachements i want attached are
> > saved
> > in my database in another table as an attachemnt field type but
> > anyway...
> >
> > REgardless, i thought of another way to get around this.
> >
> > I thought i could create Outlook Templates with my attachemnts saved in
> > the
> > templates and then refer to that template in my code - would that work?
> >
> > So i saved the template at the folowing location:
> >
> > C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
> >
> > Then i went to the code and changed it to:
> >
> > Private Sub cmdEmailInvite_Click()
> > On Error GoTo Err_cmdEMailInvite_Click
> >
> > Dim stDocName As String
> >
> > stDocName = "Training Confirmation"
> > DoCmd.SendObject acReport, stDocName, acFormatPDF, txtEmail, "", "",
> > "Training Confirmation: " & txtCourse & " on " & dateStartDate & " to "
> > &
> > dateEndDate, "Dear Delegate Blach Blah" , ,
> > C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
> >
> > Exit_cmdEMailInvite_Click:
> > Exit Sub
> >
> > Err_cmdEMailInvite_Click:
> > MsgBox Err.Description
> > Resume Exit_cmdEMailInvite_Click
> >
> > End Sub
> >
> > It doesnt work though. Brings up a "Compile Error - Syntax Error"
> >
> > So basically my questions:
> >
> > 1 - Whats wrong with my code?
> > 2 - Would the whole template idea work?
> >
> > My 3rd question is basically if the above isnt possible. Somene said in
> > another post that i could use outlook automation. I have no idea what
> > that
> > means - they referred me to
> > http://www.devhut.net/index.php?lang...13#OutlookAuto
> > so...
> > 3 - Where does that code go? on my command button or somewhere in
> > Outlook?
> >
> > Thanks a ton!
> >
> > ant1983



 
Reply With Quote
 
ant1983
Guest
Posts: n/a
 
      31st Jan 2010
LOL - Yeah i didnt quite get that part

So, where do i find the modules? Im running 2007.

"Gina Whipp" wrote:

> Ant1983,
>
> The code on that page must copied into a module and then named anything
> expect the same name as the function. Is that the part you are not
> understanding?
>
> --
> Gina Whipp
> 2010 Microsoft MVP (Access)
>
> "I feel I have been denied critical, need to know, information!" - Tremors
> II
>
> http://www.regina-whipp.com/index_files/TipList.htm
> "ant1983" <(E-Mail Removed)> wrote in message
> news:7D0CA7F5-871E-40FA-BDDE-(E-Mail Removed)...
> Thanks Daniel. You've mentioned that before and like i saidin my post i
> have
> no idea what to do with that code. Ive asked some other questions. Can
> anyone assist? Thanks.
>
>
> "Daniel Pineault" wrote:
>
> > You will need to switch to outlook automation, or another alternate method
> > as
> > sendobject only allows one attachment.
> >
> > Outlook automation is simple, and you can get a sample function to work
> > with
> > at:
> >
> > http://www.devhut.net/index.php?lang...13#OutlookAuto
> >
> > Save your attachments to the hard drive, soo generate your pdf first, then
> > simply use the above mentioned e-mail routine to send your message.
> > --
> > Hope this helps,
> >
> > Daniel Pineault
> > http://www.cardaconsultants.com/
> > For Access Tips and Examples: http://www.devhut.net
> > Please rate this post using the vote buttons if it was helpful.
> >
> >
> >
> > "ant1983" wrote:
> >
> > > Hi Guyz,
> > >
> > > I have a form (tblBooking subform1) (I know the naming is a mess!) - On
> > > that
> > > form i have a button cmdEmailInvite which opens a report
> > > rptTrainingConfirmation which runs off a query qryTrainingInvites.
> > >
> > > Basically the cmdEmailInvite is a SendObject so sends that report to an
> > > email as a pdf.
> > >
> > > My problem is that i need other attachements on that email to and in
> > > another
> > > post somene said Access cant attach external files to an email. Now
> > > firstly,
> > > its not really an external file as the attachements i want attached are
> > > saved
> > > in my database in another table as an attachemnt field type but
> > > anyway...
> > >
> > > REgardless, i thought of another way to get around this.
> > >
> > > I thought i could create Outlook Templates with my attachemnts saved in
> > > the
> > > templates and then refer to that template in my code - would that work?
> > >
> > > So i saved the template at the folowing location:
> > >
> > > C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
> > >
> > > Then i went to the code and changed it to:
> > >
> > > Private Sub cmdEmailInvite_Click()
> > > On Error GoTo Err_cmdEMailInvite_Click
> > >
> > > Dim stDocName As String
> > >
> > > stDocName = "Training Confirmation"
> > > DoCmd.SendObject acReport, stDocName, acFormatPDF, txtEmail, "", "",
> > > "Training Confirmation: " & txtCourse & " on " & dateStartDate & " to "
> > > &
> > > dateEndDate, "Dear Delegate Blach Blah" , ,
> > > C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
> > >
> > > Exit_cmdEMailInvite_Click:
> > > Exit Sub
> > >
> > > Err_cmdEMailInvite_Click:
> > > MsgBox Err.Description
> > > Resume Exit_cmdEMailInvite_Click
> > >
> > > End Sub
> > >
> > > It doesnt work though. Brings up a "Compile Error - Syntax Error"
> > >
> > > So basically my questions:
> > >
> > > 1 - Whats wrong with my code?
> > > 2 - Would the whole template idea work?
> > >
> > > My 3rd question is basically if the above isnt possible. Somene said in
> > > another post that i could use outlook automation. I have no idea what
> > > that
> > > means - they referred me to
> > > http://www.devhut.net/index.php?lang...13#OutlookAuto
> > > so...
> > > 3 - Where does that code go? on my command button or somewhere in
> > > Outlook?
> > >
> > > Thanks a ton!
> > >
> > > ant1983

>
>
> .
>

 
Reply With Quote
 
ant1983
Guest
Posts: n/a
 
      31st Jan 2010
OK - I found the modules (2007 is sooo different!)

i copied that code in a new module and then saved it as modSendEmail. What
do i do now?

1 - Do i amend the code to what is appropriate to my code?
2 - Do i attach it to some kind of button or something?

"ant1983" wrote:

> LOL - Yeah i didnt quite get that part
>
> So, where do i find the modules? Im running 2007.
>
> "Gina Whipp" wrote:
>
> > Ant1983,
> >
> > The code on that page must copied into a module and then named anything
> > expect the same name as the function. Is that the part you are not
> > understanding?
> >
> > --
> > Gina Whipp
> > 2010 Microsoft MVP (Access)
> >
> > "I feel I have been denied critical, need to know, information!" - Tremors
> > II
> >
> > http://www.regina-whipp.com/index_files/TipList.htm
> > "ant1983" <(E-Mail Removed)> wrote in message
> > news:7D0CA7F5-871E-40FA-BDDE-(E-Mail Removed)...
> > Thanks Daniel. You've mentioned that before and like i saidin my post i
> > have
> > no idea what to do with that code. Ive asked some other questions. Can
> > anyone assist? Thanks.
> >
> >
> > "Daniel Pineault" wrote:
> >
> > > You will need to switch to outlook automation, or another alternate method
> > > as
> > > sendobject only allows one attachment.
> > >
> > > Outlook automation is simple, and you can get a sample function to work
> > > with
> > > at:
> > >
> > > http://www.devhut.net/index.php?lang...13#OutlookAuto
> > >
> > > Save your attachments to the hard drive, soo generate your pdf first, then
> > > simply use the above mentioned e-mail routine to send your message.
> > > --
> > > Hope this helps,
> > >
> > > Daniel Pineault
> > > http://www.cardaconsultants.com/
> > > For Access Tips and Examples: http://www.devhut.net
> > > Please rate this post using the vote buttons if it was helpful.
> > >
> > >
> > >
> > > "ant1983" wrote:
> > >
> > > > Hi Guyz,
> > > >
> > > > I have a form (tblBooking subform1) (I know the naming is a mess!) - On
> > > > that
> > > > form i have a button cmdEmailInvite which opens a report
> > > > rptTrainingConfirmation which runs off a query qryTrainingInvites.
> > > >
> > > > Basically the cmdEmailInvite is a SendObject so sends that report to an
> > > > email as a pdf.
> > > >
> > > > My problem is that i need other attachements on that email to and in
> > > > another
> > > > post somene said Access cant attach external files to an email. Now
> > > > firstly,
> > > > its not really an external file as the attachements i want attached are
> > > > saved
> > > > in my database in another table as an attachemnt field type but
> > > > anyway...
> > > >
> > > > REgardless, i thought of another way to get around this.
> > > >
> > > > I thought i could create Outlook Templates with my attachemnts saved in
> > > > the
> > > > templates and then refer to that template in my code - would that work?
> > > >
> > > > So i saved the template at the folowing location:
> > > >
> > > > C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
> > > >
> > > > Then i went to the code and changed it to:
> > > >
> > > > Private Sub cmdEmailInvite_Click()
> > > > On Error GoTo Err_cmdEMailInvite_Click
> > > >
> > > > Dim stDocName As String
> > > >
> > > > stDocName = "Training Confirmation"
> > > > DoCmd.SendObject acReport, stDocName, acFormatPDF, txtEmail, "", "",
> > > > "Training Confirmation: " & txtCourse & " on " & dateStartDate & " to "
> > > > &
> > > > dateEndDate, "Dear Delegate Blach Blah" , ,
> > > > C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
> > > >
> > > > Exit_cmdEMailInvite_Click:
> > > > Exit Sub
> > > >
> > > > Err_cmdEMailInvite_Click:
> > > > MsgBox Err.Description
> > > > Resume Exit_cmdEMailInvite_Click
> > > >
> > > > End Sub
> > > >
> > > > It doesnt work though. Brings up a "Compile Error - Syntax Error"
> > > >
> > > > So basically my questions:
> > > >
> > > > 1 - Whats wrong with my code?
> > > > 2 - Would the whole template idea work?
> > > >
> > > > My 3rd question is basically if the above isnt possible. Somene said in
> > > > another post that i could use outlook automation. I have no idea what
> > > > that
> > > > means - they referred me to
> > > > http://www.devhut.net/index.php?lang...13#OutlookAuto
> > > > so...
> > > > 3 - Where does that code go? on my command button or somewhere in
> > > > Outlook?
> > > >
> > > > Thanks a ton!
> > > >
> > > > ant1983

> >
> >
> > .
> >

 
Reply With Quote
 
Gina Whipp
Guest
Posts: n/a
 
      31st Jan 2010
ant1983,

1. There is nothing to amend.
2. It would be attached to a button

Do you save your documents to a .PDF? And where are they on your hard
drive? I am also sensing that your knowledge of VBA is limited, is this
true?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"ant1983" <(E-Mail Removed)> wrote in message
news:3506A684-74E5-497A-8BE0-(E-Mail Removed)...
OK - I found the modules (2007 is sooo different!)

i copied that code in a new module and then saved it as modSendEmail. What
do i do now?

1 - Do i amend the code to what is appropriate to my code?
2 - Do i attach it to some kind of button or something?

"ant1983" wrote:

> LOL - Yeah i didnt quite get that part
>
> So, where do i find the modules? Im running 2007.
>
> "Gina Whipp" wrote:
>
> > Ant1983,
> >
> > The code on that page must copied into a module and then named anything
> > expect the same name as the function. Is that the part you are not
> > understanding?
> >
> > --
> > Gina Whipp
> > 2010 Microsoft MVP (Access)
> >
> > "I feel I have been denied critical, need to know, information!" -
> > Tremors
> > II
> >
> > http://www.regina-whipp.com/index_files/TipList.htm
> > "ant1983" <(E-Mail Removed)> wrote in message
> > news:7D0CA7F5-871E-40FA-BDDE-(E-Mail Removed)...
> > Thanks Daniel. You've mentioned that before and like i saidin my post i
> > have
> > no idea what to do with that code. Ive asked some other questions. Can
> > anyone assist? Thanks.
> >
> >
> > "Daniel Pineault" wrote:
> >
> > > You will need to switch to outlook automation, or another alternate
> > > method
> > > as
> > > sendobject only allows one attachment.
> > >
> > > Outlook automation is simple, and you can get a sample function to
> > > work
> > > with
> > > at:
> > >
> > > http://www.devhut.net/index.php?lang...13#OutlookAuto
> > >
> > > Save your attachments to the hard drive, soo generate your pdf first,
> > > then
> > > simply use the above mentioned e-mail routine to send your message.
> > > --
> > > Hope this helps,
> > >
> > > Daniel Pineault
> > > http://www.cardaconsultants.com/
> > > For Access Tips and Examples: http://www.devhut.net
> > > Please rate this post using the vote buttons if it was helpful.
> > >
> > >
> > >
> > > "ant1983" wrote:
> > >
> > > > Hi Guyz,
> > > >
> > > > I have a form (tblBooking subform1) (I know the naming is a mess!) -
> > > > On
> > > > that
> > > > form i have a button cmdEmailInvite which opens a report
> > > > rptTrainingConfirmation which runs off a query qryTrainingInvites.
> > > >
> > > > Basically the cmdEmailInvite is a SendObject so sends that report to
> > > > an
> > > > email as a pdf.
> > > >
> > > > My problem is that i need other attachements on that email to and in
> > > > another
> > > > post somene said Access cant attach external files to an email. Now
> > > > firstly,
> > > > its not really an external file as the attachements i want attached
> > > > are
> > > > saved
> > > > in my database in another table as an attachemnt field type but
> > > > anyway...
> > > >
> > > > REgardless, i thought of another way to get around this.
> > > >
> > > > I thought i could create Outlook Templates with my attachemnts saved
> > > > in
> > > > the
> > > > templates and then refer to that template in my code - would that
> > > > work?
> > > >
> > > > So i saved the template at the folowing location:
> > > >
> > > > C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
> > > >
> > > > Then i went to the code and changed it to:
> > > >
> > > > Private Sub cmdEmailInvite_Click()
> > > > On Error GoTo Err_cmdEMailInvite_Click
> > > >
> > > > Dim stDocName As String
> > > >
> > > > stDocName = "Training Confirmation"
> > > > DoCmd.SendObject acReport, stDocName, acFormatPDF, txtEmail, "",
> > > > "",
> > > > "Training Confirmation: " & txtCourse & " on " & dateStartDate & "
> > > > to "
> > > > &
> > > > dateEndDate, "Dear Delegate Blach Blah" , ,
> > > > C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
> > > >
> > > > Exit_cmdEMailInvite_Click:
> > > > Exit Sub
> > > >
> > > > Err_cmdEMailInvite_Click:
> > > > MsgBox Err.Description
> > > > Resume Exit_cmdEMailInvite_Click
> > > >
> > > > End Sub
> > > >
> > > > It doesnt work though. Brings up a "Compile Error - Syntax Error"
> > > >
> > > > So basically my questions:
> > > >
> > > > 1 - Whats wrong with my code?
> > > > 2 - Would the whole template idea work?
> > > >
> > > > My 3rd question is basically if the above isnt possible. Somene
> > > > said in
> > > > another post that i could use outlook automation. I have no idea
> > > > what
> > > > that
> > > > means - they referred me to
> > > > http://www.devhut.net/index.php?lang...13#OutlookAuto
> > > > so...
> > > > 3 - Where does that code go? on my command button or somewhere in
> > > > Outlook?
> > > >
> > > > Thanks a ton!
> > > >
> > > > ant1983

> >
> >
> > .
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
attachments in docmd.sendobject =?Utf-8?B?RG9uYmVueg==?= Microsoft Access VBA Modules 1 20th Jun 2006 12:14 AM
send two attachments using sendObject =?Utf-8?B?anVkaXRo?= Microsoft Access VBA Modules 2 7th Jun 2006 06:40 AM
Using SendObject to send email, want to send attachments Darhl Thomason Microsoft Access Form Coding 1 3rd Feb 2006 07:27 PM
Attachments in SendObject =?Utf-8?B?VGVycnk=?= Microsoft Access VBA Modules 2 31st Mar 2005 03:05 PM
Attachments to a docmd.sendobject ? Rick Microsoft Access VBA Modules 2 14th Jan 2004 08:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:23 PM.