A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - General Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Emailing from Access application - inconsistent behaviour with SendObject



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 1st 07, 02:55 PM posted to microsoft.public.access.formscoding,microsoft.public.outlook
Rob Parker
external usenet poster
 
Posts: 8
Default Emailing from Access application - inconsistent behaviour with SendObject

Apologies for the crosspost, but I'm not sure where this will get the best
response (and also not sure of which Outlook group to post to, so I've
chosen the top-level one). Application is Access 2003/Outlook 2003, running
on Win XP Pro (latest SP - corporate network environment).

I have an Access application which uses DoCmd.SendObject to email reports as
..snp files. Addressees are selected (indirectly) from a listbox for
particular reports, and VBA code modifies report design accordingly, then
uses the DoCmd.SendObject method to email to the appropriate addressee. The
code for this is as follows :

Private Sub btnSendSelected_Click()
Dim varWP As Variant
Dim strCap As String

For Each varWP In lboxWP.ItemsSelected
'Don't try to open report if no data
If DCount("*", "qryrptCAM", "WPID=" & CInt(Nz(lboxWP.ItemData(varWP),
0))) 0 Then
On Error Resume Next
Application.Echo False
DoCmd.OpenReport "rptWP", acViewDesign
Report_rptWP.Filter = "WPID=" & lboxWP.ItemData(varWP)
Report_rptWP.FilterOn = True
Report_rptWP.Caption = lboxWP.Column(1, varWP) & " Work Package
Report"
DoCmd.Close acReport, "rptWP", acSaveYes
Application.Echo True
DoCmd.SendObject acSendReport, "rptWP", acFormatSNP, lboxWP.Column(3,
varWP) & ", , , "HAWK LIF FSFT: Work Package Report", _
lboxWP.Column(4, varWP) & strSal & "Attached is a report for the " &
lboxWP.Column(1, varWP) _
& " Work Package." & strSig, chkEditDraft
On Error GoTo 0
Else
MsgBox "The '" & lboxWP.Column(1, varWP) & "'" & vbNewLine _
& "Work Package has no current orders," _
& vbNewLine & "or no current budget allocation.", vbInformation,
"No WP Report"
End If
Next varWP

'Reset report design to default
Application.Echo False
DoCmd.OpenReport "rptWP", acViewDesign
Report_rptWP.Filter = ""
Report_rptWP.FilterOn = False
Report_rptWP.Caption = "Work Package Report"
DoCmd.Close acReport, "rptWP", acSaveYes
Application.Echo True
End Sub


On the system I'm using for development, this works fine. Each time I
select one or more Work Packages (WPs) in the listbox and click the
SendSelected button, I get the (expected) dialog that a program is trying to
send an email message, and I can elect to allow this. Works fine, time
after time after time ...

My problem is that, on a different computer (but on the same network, with
the same Exchange server, and (apart from Access itself) almost certainly
the same default settings, the major (almost sole) user of this application
gets this dialog once, and subsequent attempts to email reports via this
code fail - silently, with no errors. I've removed the error-ignoring code
and replaced it with standard error-trapping, and no error occurs; but after
the first use, nothing happens - no dialog message, no email sent, no error
message. It seems (but I'm not completely sure about this) that the code
will again work properly, on the main user's system, after about an hour
from the first failure.

I suspect that this is an Outlook-related issue rather than an Access issue
(hence the cross-post), but I've no idea where to look. I've reported it to
the corporate IT HelpDesk, but it takes a while to get a real response from
them (and I'm not on-site permanently, as I'm a contract
developer/maintainer); the initial response was puzzlement ;-).

I'm aware of the Outlook Redemption library as a possible solution, but
that's not an approach that's going to be simple in this environment. Apart
from that, does anyone have any ideas/thought/solutions?

TIA,

Rob


  #2  
Old May 1st 07, 03:14 PM posted to microsoft.public.access.formscoding,microsoft.public.outlook
Brian Tillman
external usenet poster
 
Posts: 17,452
Default Emailing from Access application - inconsistent behaviour with SendObject

Rob Parker wrote:

Apologies for the crosspost, but I'm not sure where this will get the
best response (and also not sure of which Outlook group to post to,
so I've chosen the top-level one).


microsoft.public.outlook.program_vba or
microsoft.public.outlook.program_addins are probably better.
--
Brian Tillman

  #3  
Old May 2nd 07, 01:28 AM posted to microsoft.public.access.formscoding,microsoft.public.outlook
Rob Parker
external usenet poster
 
Posts: 8
Default Emailing from Access application - inconsistent behaviour with SendObject

Thanks for the advice, Brian.

I'll check out the suggestions in a couple of other replies, and if I still
need help I'l try posting to those groups.

Rob


"Brian Tillman" wrote in message
...
Rob Parker wrote:

Apologies for the crosspost, but I'm not sure where this will get the
best response (and also not sure of which Outlook group to post to,
so I've chosen the top-level one).


microsoft.public.outlook.program_vba or
microsoft.public.outlook.program_addins are probably better.
--
Brian Tillman



  #4  
Old May 1st 07, 03:50 PM posted to microsoft.public.access.formscoding,microsoft.public.outlook
Scott McDaniel
external usenet poster
 
Posts: 1
Default Emailing from Access application - inconsistent behaviour with SendObject

On Tue, 1 May 2007 23:55:10 +1000, "Rob Parker" wrote:

Sendobject failing when called in a loop is a know issue:

http://support.microsoft.com/default...b;en-us;260819

The resolution in that article is to obtain the latest Office 2000 service pack, however (IMO) if your application
relies heavily on email then you'll be better off handling it outside of Outlook. I've used the Internet Mail Library
from here for years:

www.codestone.co.uk

It works very well, handles attachments easily, and you can call it as many times as you like without issue. There are
so freeware email suggestions here;

http://www.granite.ab.ca/access/email.htm


Scott McDaniel

www.infotrakker.com
  #5  
Old May 2nd 07, 01:38 AM posted to microsoft.public.access.formscoding,microsoft.public.outlook
Rob Parker
external usenet poster
 
Posts: 8
Default Emailing from Access application - inconsistent behaviour with SendObject

Thanks Scott,

Although the kb article refers to Office 2000 and I've got an Office 2003
environment, the code there may provide a suitable solution. I'll give it a
try, and post back results. As for using an alternative email, that's not
an alternative - this application is used solely within an organisation with
a tightly controlled environment.

Rob


"Scott McDaniel" wrote in message
...
On Tue, 1 May 2007 23:55:10 +1000, "Rob Parker"
wrote:

Sendobject failing when called in a loop is a know issue:

http://support.microsoft.com/default...b;en-us;260819

The resolution in that article is to obtain the latest Office 2000 service
pack, however (IMO) if your application
relies heavily on email then you'll be better off handling it outside of
Outlook. I've used the Internet Mail Library
from here for years:

www.codestone.co.uk

It works very well, handles attachments easily, and you can call it as
many times as you like without issue. There are
so freeware email suggestions here;

http://www.granite.ab.ca/access/email.htm


Scott McDaniel

www.infotrakker.com



  #6  
Old May 1st 07, 03:52 PM posted to microsoft.public.access.formscoding,microsoft.public.outlook
Roger Carlson
external usenet poster
 
Posts: 1
Default Emailing from Access application - inconsistent behaviour with SendObject

Well, it sounds like this problem:
http://support.microsoft.com/default...;en-us;q260819

which goes back to Access 2000. I don't know of a fix other than Outlook
automation.

I wonder if there are setting differences between Outlook on the development
machine and on the user's machine.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L

"Rob Parker" wrote in message
...
Apologies for the crosspost, but I'm not sure where this will get the best
response (and also not sure of which Outlook group to post to, so I've
chosen the top-level one). Application is Access 2003/Outlook 2003,
running on Win XP Pro (latest SP - corporate network environment).

I have an Access application which uses DoCmd.SendObject to email reports
as .snp files. Addressees are selected (indirectly) from a listbox for
particular reports, and VBA code modifies report design accordingly, then
uses the DoCmd.SendObject method to email to the appropriate addressee.
The code for this is as follows :

Private Sub btnSendSelected_Click()
Dim varWP As Variant
Dim strCap As String

For Each varWP In lboxWP.ItemsSelected
'Don't try to open report if no data
If DCount("*", "qryrptCAM", "WPID=" & CInt(Nz(lboxWP.ItemData(varWP),
0))) 0 Then
On Error Resume Next
Application.Echo False
DoCmd.OpenReport "rptWP", acViewDesign
Report_rptWP.Filter = "WPID=" & lboxWP.ItemData(varWP)
Report_rptWP.FilterOn = True
Report_rptWP.Caption = lboxWP.Column(1, varWP) & " Work Package
Report"
DoCmd.Close acReport, "rptWP", acSaveYes
Application.Echo True
DoCmd.SendObject acSendReport, "rptWP", acFormatSNP, lboxWP.Column(3,
varWP) & ", , , "HAWK LIF FSFT: Work Package Report",
_
lboxWP.Column(4, varWP) & strSal & "Attached is a report for the "
& lboxWP.Column(1, varWP) _
& " Work Package." & strSig, chkEditDraft
On Error GoTo 0
Else
MsgBox "The '" & lboxWP.Column(1, varWP) & "'" & vbNewLine _
& "Work Package has no current orders," _
& vbNewLine & "or no current budget allocation.",
vbInformation, "No WP Report"
End If
Next varWP

'Reset report design to default
Application.Echo False
DoCmd.OpenReport "rptWP", acViewDesign
Report_rptWP.Filter = ""
Report_rptWP.FilterOn = False
Report_rptWP.Caption = "Work Package Report"
DoCmd.Close acReport, "rptWP", acSaveYes
Application.Echo True
End Sub


On the system I'm using for development, this works fine. Each time I
select one or more Work Packages (WPs) in the listbox and click the
SendSelected button, I get the (expected) dialog that a program is trying
to send an email message, and I can elect to allow this. Works fine, time
after time after time ...

My problem is that, on a different computer (but on the same network, with
the same Exchange server, and (apart from Access itself) almost certainly
the same default settings, the major (almost sole) user of this
application gets this dialog once, and subsequent attempts to email
reports via this code fail - silently, with no errors. I've removed the
error-ignoring code and replaced it with standard error-trapping, and no
error occurs; but after the first use, nothing happens - no dialog
message, no email sent, no error message. It seems (but I'm not
completely sure about this) that the code will again work properly, on the
main user's system, after about an hour from the first failure.

I suspect that this is an Outlook-related issue rather than an Access
issue (hence the cross-post), but I've no idea where to look. I've
reported it to the corporate IT HelpDesk, but it takes a while to get a
real response from them (and I'm not on-site permanently, as I'm a
contract developer/maintainer); the initial response was puzzlement ;-).

I'm aware of the Outlook Redemption library as a possible solution, but
that's not an approach that's going to be simple in this environment.
Apart from that, does anyone have any ideas/thought/solutions?

TIA,

Rob



  #7  
Old May 2nd 07, 01:41 AM posted to microsoft.public.access.formscoding,microsoft.public.outlook
Rob Parker
external usenet poster
 
Posts: 8
Default Emailing from Access application - inconsistent behaviour with SendObject

Thanks Roger,

I'll try the solution from the kb article.

Setting differences was something that I hoped someone would be able to help
with, as it's my feeling that that could be where the problem lies. But no
suggestions on that track yet.

Rob

"Roger Carlson" wrote in message
...
Well, it sounds like this problem:
http://support.microsoft.com/default...;en-us;q260819

which goes back to Access 2000. I don't know of a fix other than Outlook
automation.

I wonder if there are setting differences between Outlook on the
development machine and on the user's machine.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L

"Rob Parker" wrote in
message ...
Apologies for the crosspost, but I'm not sure where this will get the
best response (and also not sure of which Outlook group to post to, so
I've chosen the top-level one). Application is Access 2003/Outlook 2003,
running on Win XP Pro (latest SP - corporate network environment).

I have an Access application which uses DoCmd.SendObject to email reports
as .snp files. Addressees are selected (indirectly) from a listbox for
particular reports, and VBA code modifies report design accordingly, then
uses the DoCmd.SendObject method to email to the appropriate addressee.
The code for this is as follows :

Private Sub btnSendSelected_Click()
Dim varWP As Variant
Dim strCap As String

For Each varWP In lboxWP.ItemsSelected
'Don't try to open report if no data
If DCount("*", "qryrptCAM", "WPID=" & CInt(Nz(lboxWP.ItemData(varWP),
0))) 0 Then
On Error Resume Next
Application.Echo False
DoCmd.OpenReport "rptWP", acViewDesign
Report_rptWP.Filter = "WPID=" & lboxWP.ItemData(varWP)
Report_rptWP.FilterOn = True
Report_rptWP.Caption = lboxWP.Column(1, varWP) & " Work Package
Report"
DoCmd.Close acReport, "rptWP", acSaveYes
Application.Echo True
DoCmd.SendObject acSendReport, "rptWP", acFormatSNP,
lboxWP.Column(3, varWP) & ", , , "HAWK LIF FSFT:
Work Package Report", _
lboxWP.Column(4, varWP) & strSal & "Attached is a report for the "
& lboxWP.Column(1, varWP) _
& " Work Package." & strSig, chkEditDraft
On Error GoTo 0
Else
MsgBox "The '" & lboxWP.Column(1, varWP) & "'" & vbNewLine _
& "Work Package has no current orders," _
& vbNewLine & "or no current budget allocation.",
vbInformation, "No WP Report"
End If
Next varWP

'Reset report design to default
Application.Echo False
DoCmd.OpenReport "rptWP", acViewDesign
Report_rptWP.Filter = ""
Report_rptWP.FilterOn = False
Report_rptWP.Caption = "Work Package Report"
DoCmd.Close acReport, "rptWP", acSaveYes
Application.Echo True
End Sub


On the system I'm using for development, this works fine. Each time I
select one or more Work Packages (WPs) in the listbox and click the
SendSelected button, I get the (expected) dialog that a program is trying
to send an email message, and I can elect to allow this. Works fine,
time after time after time ...

My problem is that, on a different computer (but on the same network,
with the same Exchange server, and (apart from Access itself) almost
certainly the same default settings, the major (almost sole) user of this
application gets this dialog once, and subsequent attempts to email
reports via this code fail - silently, with no errors. I've removed the
error-ignoring code and replaced it with standard error-trapping, and no
error occurs; but after the first use, nothing happens - no dialog
message, no email sent, no error message. It seems (but I'm not
completely sure about this) that the code will again work properly, on
the main user's system, after about an hour from the first failure.

I suspect that this is an Outlook-related issue rather than an Access
issue (hence the cross-post), but I've no idea where to look. I've
reported it to the corporate IT HelpDesk, but it takes a while to get a
real response from them (and I'm not on-site permanently, as I'm a
contract developer/maintainer); the initial response was puzzlement ;-).

I'm aware of the Outlook Redemption library as a possible solution, but
that's not an approach that's going to be simple in this environment.
Apart from that, does anyone have any ideas/thought/solutions?

TIA,

Rob





  #8  
Old May 1st 07, 09:24 PM posted to microsoft.public.access.formscoding,microsoft.public.outlook
Aaron Kempf
external usenet poster
 
Posts: 2
Default Emailing from Access application - inconsistent behaviour with SendObject

if you want to send emails, you should use Access Data Projects

sending email from the desktop is insecure and unreliable

use Access Data Projects and xp_sendmail instead of this Docmd.crap


"Rob Parker" wrote in message
...
Apologies for the crosspost, but I'm not sure where this will get the best
response (and also not sure of which Outlook group to post to, so I've
chosen the top-level one). Application is Access 2003/Outlook 2003,

running
on Win XP Pro (latest SP - corporate network environment).

I have an Access application which uses DoCmd.SendObject to email reports

as
.snp files. Addressees are selected (indirectly) from a listbox for
particular reports, and VBA code modifies report design accordingly, then
uses the DoCmd.SendObject method to email to the appropriate addressee.

The
code for this is as follows :

Private Sub btnSendSelected_Click()
Dim varWP As Variant
Dim strCap As String

For Each varWP In lboxWP.ItemsSelected
'Don't try to open report if no data
If DCount("*", "qryrptCAM", "WPID=" & CInt(Nz(lboxWP.ItemData(varWP),
0))) 0 Then
On Error Resume Next
Application.Echo False
DoCmd.OpenReport "rptWP", acViewDesign
Report_rptWP.Filter = "WPID=" & lboxWP.ItemData(varWP)
Report_rptWP.FilterOn = True
Report_rptWP.Caption = lboxWP.Column(1, varWP) & " Work Package
Report"
DoCmd.Close acReport, "rptWP", acSaveYes
Application.Echo True
DoCmd.SendObject acSendReport, "rptWP", acFormatSNP,

lboxWP.Column(3,
varWP) & ", , , "HAWK LIF FSFT: Work Package Report",

_
lboxWP.Column(4, varWP) & strSal & "Attached is a report for the "

&
lboxWP.Column(1, varWP) _
& " Work Package." & strSig, chkEditDraft
On Error GoTo 0
Else
MsgBox "The '" & lboxWP.Column(1, varWP) & "'" & vbNewLine _
& "Work Package has no current orders," _
& vbNewLine & "or no current budget allocation.",

vbInformation,
"No WP Report"
End If
Next varWP

'Reset report design to default
Application.Echo False
DoCmd.OpenReport "rptWP", acViewDesign
Report_rptWP.Filter = ""
Report_rptWP.FilterOn = False
Report_rptWP.Caption = "Work Package Report"
DoCmd.Close acReport, "rptWP", acSaveYes
Application.Echo True
End Sub


On the system I'm using for development, this works fine. Each time I
select one or more Work Packages (WPs) in the listbox and click the
SendSelected button, I get the (expected) dialog that a program is trying

to
send an email message, and I can elect to allow this. Works fine, time
after time after time ...

My problem is that, on a different computer (but on the same network, with
the same Exchange server, and (apart from Access itself) almost certainly
the same default settings, the major (almost sole) user of this

application
gets this dialog once, and subsequent attempts to email reports via this
code fail - silently, with no errors. I've removed the error-ignoring

code
and replaced it with standard error-trapping, and no error occurs; but

after
the first use, nothing happens - no dialog message, no email sent, no

error
message. It seems (but I'm not completely sure about this) that the code
will again work properly, on the main user's system, after about an hour
from the first failure.

I suspect that this is an Outlook-related issue rather than an Access

issue
(hence the cross-post), but I've no idea where to look. I've reported it

to
the corporate IT HelpDesk, but it takes a while to get a real response

from
them (and I'm not on-site permanently, as I'm a contract
developer/maintainer); the initial response was puzzlement ;-).

I'm aware of the Outlook Redemption library as a possible solution, but
that's not an approach that's going to be simple in this environment.

Apart
from that, does anyone have any ideas/thought/solutions?

TIA,

Rob




 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook calendar access from .net application [email protected] Add-ins for Outlook 1 May 7th 07 02:30 PM
Using "SendObject" in access to send Email Steve S Outlook - Installation 6 April 23rd 07 10:44 PM
Info Help: Emailing from Access via Outlook Malhyp Outlook - Using Forms 3 March 1st 07 04:03 PM
Access.Application Type Undefined Michael Ryle Outlook and VBA 6 January 10th 07 08:41 PM
how to access java application from Outlook? Old_Mortality Add-ins for Outlook 0 May 24th 06 01:55 PM


All times are GMT +1. The time now is 06:10 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.