473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

auto email pdf

Des
I was wondering if anyone could help me out with this. I use Access
2003 to generate certain files and then I convert them to pdf, I was
wondering if anyone would know the code I could use where I would have
the ability to have them automatically emailed after they're converted
to different sources?

I can be emailed via de***********@aol.com

Thanks..

Apr 24 '07 #1
10 7901
Look in Access Help for the "SendObject" command.
"Des" <de***********@aol.comwrote in message
news:11*********************@o40g2000prh.googlegro ups.com...
>I was wondering if anyone could help me out with this. I use Access
2003 to generate certain files and then I convert them to pdf, I was
wondering if anyone would know the code I could use where I would have
the ability to have them automatically emailed after they're converted
to different sources?

I can be emailed via de***********@aol.com

Thanks..

Apr 24 '07 #2
Ed Robichaud wrote:
Look in Access Help for the "SendObject" command.
SendObject allows you to send non-Access documents as attachments?

To the OP, you might want to start here.
http://www.granite.ab.ca/access/email.htm

>

"Des" <de***********@aol.comwrote in message
news:11*********************@o40g2000prh.googlegro ups.com...
>>I was wondering if anyone could help me out with this. I use Access
2003 to generate certain files and then I convert them to pdf, I was
wondering if anyone would know the code I could use where I would have
the ability to have them automatically emailed after they're converted
to different sources?

I can be emailed via de***********@aol.com

Thanks..


Apr 24 '07 #3
On Apr 24, 5:46 am, "Ed Robichaud" <edrobich...@wdn.comwrote:
Look in Access Help for the "SendObject" command.

"Des" <despairing...@aol.comwrote in message

news:11*********************@o40g2000prh.googlegro ups.com...
I was wondering if anyone could help me out with this. I use Access
2003 to generate certain files and then I convert them to pdf, I was
wondering if anyone would know the code I could use where I would have
the ability to have them automatically emailed after they're converted
to different sources?
I can be emailed via despairing...@aol.com
Thanks..- Hide quoted text -

- Show quoted text -
this might help you
http://office.microsoft.com/en-gb/te...033.aspx?Categ...

Apr 24 '07 #4
SendObject will not allow you to send a file. You will need a function
opening an Outlook object. Following is a function I have adapted to send a
list of files.

'---------------------
' Create a email with attachments
' stSendTo Email address
' stBody Body of the message
' stSubject Subject of the message
' astAttach Array of strings listing the path to the attachments
' intAcount Number of attachments
' intSend True if the message should be sent without preview

Public Function EmailAttach(ByRef stSendTo As String, ByRef stBody As
String, ByRef stSubject As String, _
astAttach() As String, intAcount As
Integer, intSend As Integer) As Integer

On Error GoTo EmailAttach

Dim oLook As Object
Dim oMail As Object
Dim i As Integer

Set oLook = CreateObject("Outlook.Application")
Set oMail = oLook.CreateItem(0)
With oMail
.To = stSendTo
.Body = stBody
.Subject = stSubject
.ReadReceiptRequested = True

If intAcount <0 Then
For i = 1 To intAcount
.Attachments.Add (astAttach(i - 1))
Next
End If

If intSend = True Then
.Send ' Windows may complain about
security
Else
.Display
End If

End With

Set oMail = Nothing
Set oLook = Nothing
EmailAttach = True
Exit Function

EmailAttach:

MsgBox "The following error was noted : " & Err.Description & Chr$(10) &
Chr$(13) & _
"Your email may not have been sent.", vbCritical, "Error"

On Error Resume Next
Set oMail = Nothing
Set oLook = Nothing
EmailAttach = False

End Function

"Ed Robichaud" <ed*********@wdn.comwrote in message
news:46**********************@news.wdn.com...
Look in Access Help for the "SendObject" command.
"Des" <de***********@aol.comwrote in message
news:11*********************@o40g2000prh.googlegro ups.com...
I was wondering if anyone could help me out with this. I use Access
2003 to generate certain files and then I convert them to pdf, I was
wondering if anyone would know the code I could use where I would have
the ability to have them automatically emailed after they're converted
to different sources?

I can be emailed via de***********@aol.com

Thanks..


Apr 24 '07 #5
Des
On Apr 24, 7:46 am, "Ed Robichaud" <edrobich...@wdn.comwrote:
Look in Access Help for the "SendObject" command.

"Des" <despairing...@aol.comwrote in message

news:11*********************@o40g2000prh.googlegro ups.com...
I was wondering if anyone could help me out with this. I use Access
2003 to generate certain files and then I convert them to pdf, I was
wondering if anyone would know the code I could use where I would have
the ability to have them automatically emailed after they're converted
to different sources?
I can be emailed via despairing...@aol.com
Thanks..
That doesn't really help me. I use access to bring data in and then I
convert it to pdf and from there is where I would like to set up the
auto email function. I'm assuming it's just a simple batch function
and possibly a script. If anyone has done something like this before,
please let me know. Thanks again for the help.

Apr 25 '07 #6
There is a great addon from ACG Soft that allows both PDF and
emailing.

It works with all different types of PDF drivers, email clients,
etc.

I highly recommend them.

http://www.groupacg.com/

On Apr 24, 8:46 am, "Ed Robichaud" <edrobich...@wdn.comwrote:
Look in Access Help for the "SendObject" command.

"Des" <despairing...@aol.comwrote in message

news:11*********************@o40g2000prh.googlegro ups.com...
I was wondering if anyone could help me out with this. I use Access
2003 to generate certain files and then I convert them to pdf, I was
wondering if anyone would know the code I could use where I would have
the ability to have them automatically emailed after they're converted
to different sources?
I can be emailed via despairing...@aol.com
Thanks..- Hide quoted text -

- Show quoted text -

Apr 25 '07 #7
Des wrote:
On Apr 24, 7:46 am, "Ed Robichaud" <edrobich...@wdn.comwrote:
>>Look in Access Help for the "SendObject" command.

"Des" <despairing...@aol.comwrote in message

news:11*********************@o40g2000prh.googleg roups.com...

>>>I was wondering if anyone could help me out with this. I use Access
2003 to generate certain files and then I convert them to pdf, I was
wondering if anyone would know the code I could use where I would have
the ability to have them automatically emailed after they're converted
to different sources?
>>>I can be emailed via despairing...@aol.com
>>>Thanks..


That doesn't really help me. I use access to bring data in and then I
convert it to pdf and from there is where I would like to set up the
auto email function. I'm assuming it's just a simple batch function
and possibly a script. If anyone has done something like this before,
please let me know. Thanks again for the help.
There are many options. One I prefer is to use the CDO library which can easily be used in
Access VBA or vbScript.

Here is sample code (in vbScript):

Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).

Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Sample CDO Message"
objMessage.From = """Me"" <me@my.com>"
objMessage.To = "so******@yahoo.com"
objMessage.TextBody = "This is some sample message text.." & vbCRLF & _
"It was sent using the CDO Library."

' ==This section provides the configuration information for the remote SMTP server.

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

' Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.your.com"

' Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoNTLM

' Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "youruserid"

' Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "yourpassword"

' Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

' Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

' Connection Timeout in seconds (the maximum time CDO will try to
' establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

objMessage.Configuration.Fields.Update

' ==End remote SMTP server configuration section==

objMessage.Send

Set objMessage = Nothing

--
---------------
John Mishefske, Microsoft Access MVP
Apr 26 '07 #8

"John Mishefske" <jm**********@SPAMyahoo.comwrote in message
news:46***********************@roadrunner.com...
Des wrote:
On Apr 24, 7:46 am, "Ed Robichaud" <edrobich...@wdn.comwrote:
>Look in Access Help for the "SendObject" command.

"Des" <despairing...@aol.comwrote in message

news:11*********************@o40g2000prh.googlegr oups.com...
I was wondering if anyone could help me out with this. I use Access
2003 to generate certain files and then I convert them to pdf, I was
wondering if anyone would know the code I could use where I would have
the ability to have them automatically emailed after they're converted
to different sources?

I can be emailed via despairing...@aol.com

Thanks..

That doesn't really help me. I use access to bring data in and then I
convert it to pdf and from there is where I would like to set up the
auto email function. I'm assuming it's just a simple batch function
and possibly a script. If anyone has done something like this before,
please let me know. Thanks again for the help.

There are many options. One I prefer is to use the CDO library which can
easily be used in
Access VBA or vbScript.

Here is sample code (in vbScript):

Const cdoSendUsingPickup = 1 'Send message using the local SMTP service
pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over
the network).
>
Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Sample CDO Message"
objMessage.From = """Me"" <me@my.com>"
objMessage.To = "so******@yahoo.com"
objMessage.TextBody = "This is some sample message text.." & vbCRLF & _
"It was sent using the CDO Library."

' ==This section provides the configuration information for the remote
SMTP server.
>
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

' Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mail.your.com"
>
' Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") =
cdoNTLM
>
' Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"youruserid"
>
' Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"yourpassword"
>
' Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

' Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

' Connection Timeout in seconds (the maximum time CDO will try to
' establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 60
>
objMessage.Configuration.Fields.Update

' ==End remote SMTP server configuration section==

objMessage.Send

Set objMessage = Nothing

--
---------------
John Mishefske, Microsoft Access MVP
I was playing with your code, which worked perfect.

How do you attach a file or files to the message?
Apr 26 '07 #9
paii, Ron wrote:
"John Mishefske" <jm**********@SPAMyahoo.comwrote in message news:46***********************@roadrunner.com...
>There are many options. One I prefer is to use the CDO library which can easily be used in
Access VBA or vbScript.
--
---------------
John Mishefske, Microsoft Access MVP

I was playing with your code, which worked perfect.

How do you attach a file or files to the message?
The .AddAttachment method which takes a String file location:

objMessage.AddAttachment "c:\temp\test.doc"

You could put it a line above the objMessage.Send in my copied example.

Here are some resources to see sample coding:

http://www.paulsadowski.com/WSH/cdo.htm

http://www.pa-software.com/scripts/?tp=vbs&sc=cdoemail

http://msdn2.microsoft.com/en-us/library/ms526983.aspx
--
---------------
John Mishefske, Microsoft Access MVP
Apr 27 '07 #10

"John Mishefske" <jm**********@SPAMyahoo.comwrote in message
news:46**********************@roadrunner.com...
paii, Ron wrote:
"John Mishefske" <jm**********@SPAMyahoo.comwrote in message
news:46***********************@roadrunner.com...
There are many options. One I prefer is to use the CDO library which
can easily be used in
Access VBA or vbScript.
--
---------------
John Mishefske, Microsoft Access MVP
I was playing with your code, which worked perfect.

How do you attach a file or files to the message?

The .AddAttachment method which takes a String file location:

objMessage.AddAttachment "c:\temp\test.doc"

You could put it a line above the objMessage.Send in my copied example.

Here are some resources to see sample coding:

http://www.paulsadowski.com/WSH/cdo.htm

http://www.pa-software.com/scripts/?tp=vbs&sc=cdoemail

http://msdn2.microsoft.com/en-us/library/ms526983.aspx
--
---------------
John Mishefske, Microsoft Access MVP
Thank you very much, I will look into those recourses.
Apr 27 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tom | last post by:
I am trying to store information into a table that has an auto increment field. There is currently no data in the table. Using the code below I cannot insert data into the table. I get an error...
6
by: Corepaul | last post by:
I am new to Access 2000. My operating system is Windows 2000. In the early stage of development I noticed something weird. On my form, I have a Command Button named "btnAlbumUp". The first time...
9
by: Alan Mackenzie | last post by:
To all those who use (X)Emacs's CC Mode to edit C, C++, Java, Objective-C, Pike, AWK or IDL: To help direct the development of CC Mode, it would be useful to find out how people use the...
20
by: Vijay Kumar R. Zanvar | last post by:
Hello, Unlike register, auto keyword can not be used to declare formal parameter(s). Is there any specific reason for this? Kind regards, Vijay Kumar R. Zanvar
5
by: Paulovič Michal | last post by:
hi all, I have problem with SERIAL field type (or sequence functionality). I have table with three columns - ID, IDS, NAME. I want auto-increment IDS grouped by ID. Example: 1, 1, Ferdo 1, 2,...
13
by: S.Dickson | last post by:
I had an access database that i use as an ordering system. I have a form for entering customer details. When i add a new customer on the form the customer number is an auto number that appears when...
11
by: mp- | last post by:
I want to be able to allow people to check their email from my PHP online application. Given only the users 1) email address, 2) username (if applicable) and 3) password - how can I auto detect...
10
by: laredotornado | last post by:
Hi, I'm using php 5. Does anyone have any code or a function that auto submits a form that contains a single INPUT, of type = file? Thanks, - Dave
3
by: TS | last post by:
I am using IE 7. I have a website running on my local machine (localhost) and auto complete doesnt work for any of the textboxes, but going to web sites on the internet does support this so i know...
21
by: JOYCE | last post by:
Look the subject,that's my problem! I hope someone can help me, thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.