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
Prev Previous Post   Next Post Next
  #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


 




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:26 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.