473,748 Members | 11,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Email report using GroupWise

41 New Member
Hi. I have an Access DB that is for contracts. I have used the code found on Tony's site for emailing a report per person containing only their information using GroupWise. It works great but I have a problem. Right now, the code before the GroupWise code, generates reports based on time criteria. If the query has no records for a person then a report isn't created. Trouble is, the code for GroupWise email sends the auto email message even though there isn't an attachment. How can I tell it to not send the auto email message to a recipient if there isn't a report as an attachment? Thanks in advance. I've been trying to find an answer all morning!
Jan 30 '07 #1
46 3524
NeoPa
32,571 Recognized Expert Moderator MVP
To be honest, without having the code to reference it's going to be quite hard to know which bit(s) of it needs to be changed. Most things can be done in various ways in Access (Can be a blessing but can also be a chore) so there's really no way to guess.
Try posting the relevant section of the code (or all of it if it's not too voluminous).
Jan 31 '07 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
Hi. I have an Access DB that is for contracts. I have used the code found on Tony's site for emailing a report per person containing only their information using GroupWise. It works great but I have a problem. Right now, the code before the GroupWise code, generates reports based on time criteria. If the query has no records for a person then a report isn't created. Trouble is, the code for GroupWise email sends the auto email message even though there isn't an attachment. How can I tell it to not send the auto email message to a recipient if there isn't a report as an attachment? Thanks in advance. I've been trying to find an answer all morning!
Post the piece of code that runs the report and calls the groupwise function. It's a matter of deciding to ignore the latter line of code if the report has no records. Once we see the code it will give a better idea of how that can be done.

Mary
Jan 31 '07 #3
pixie
41 New Member
Here is the code for one person. Before this code runs, the DB creates a report, per person, if there is data. Looking forward to your help! I just can't figure it out!

Expand|Select|Wrap|Line Numbers
  1. Sub RunLRiouxEMail()
  2.  
  3. On Error GoTo Err_Handler
  4. Dim strTemp As String
  5. Dim varAttach(2) As Variant
  6. Dim strRecTo(1, 0) As String
  7. Dim strRecCc(1, 0) As String
  8. Dim lngCount As Long
  9. Dim varProxies As Variant
  10. Dim cGW As GW
  11.  
  12.  
  13. varAttach(0) = "C:\Documents and Settings\reo\My Documents\ContractReports\ReportsRioux.rtf"
  14.  
  15. strRecTo(0, 0) = "lmr@propeople.org"
  16. strRecTo(1, 0) = "lmr@propeople.org"
  17.  
  18. strRecCc(0, 0) = "plm@propeople.org"
  19.  
  20. Set cGW = New GW
  21. With cGW
  22.   .Login
  23.   .BodyText = "Attached please find a word document that lists: " & _
  24.               "contract reports that are over due and contract reports " & _
  25.               "that are due within one to three weeks.  " & vbCrLf & vbCrLf & _
  26.               "Please ensure that the reports are completed and sent " & _
  27.               "to the contract officer on time.  A copy of the dated cover " & _
  28.               "letter transmitting the report and the report itself should " & _
  29.               "be sent to the Accounting Specialist in the Finance Office.  " & _
  30.               "The Accounting Specialist will update the Contracts database " & _
  31.               "with the date the report was submitted and file the report " & _
  32.               "in the contract file for the compliance audits." & vbCrLf & vbCrLf & _
  33.               "If no document is attached to this automated e-mail then " & _
  34.               "you have no past due reports and no reports due within " & _
  35.               "the next three weeks." & vbCrLf & vbCrLf & _
  36.               "For questions please contact the Accounting Specialist " & _
  37.               "at 874-1140 ext 356. Thank you."
  38.   .Subject = "Contract Reports"
  39.   .RecTo = strRecTo
  40.   .RecCc = strRecCc
  41.   .FileAttachments = varAttach
  42.   .FromText = "Finance Department"
  43.   .Priority = "High"
  44.   strTemp = .CreateMessage
  45.   .ResolveRecipients strTemp
  46.   If IsArray(.NonResolved) Then MsgBox "Some unresolved recipients."
  47.   .SendMessage strTemp
  48.   .DeleteMessage strTemp, True
  49. End With
  50.  
  51.  
  52.  
  53. Exit_Here:
  54.   Set cGW = Nothing
  55.   Exit Sub
  56.  
  57. Err_Handler:
  58.   MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical
  59.   Resume Exit_Here
  60.  
  61. End Sub
Jan 31 '07 #4
pixie
41 New Member
Here is the code that creates a report for one person.

Expand|Select|Wrap|Line Numbers
  1.  DoCmd.OpenQuery "qryTimeToMailNoel", acNormal, acEdit
  2.         If DCount("*", "qryTimeToMailNoel") = 0 Then
  3.     DoCmd.Close acQuery, "qryTimeToMailNoel"
  4.         Else
  5.     DoCmd.OpenReport "rptReportsNoel", acPreview, "", ""
  6.     DoCmd.Close acReport, "rptReportsNoel"
  7.     DoCmd.Close acQuery, "qryTimeToMailNoel"
  8.     DoCmd.OutputTo acReport, "rptReportsNoel", _
  9.                    "RichTextFormat(*.rtf)", _                   "g:\accounting\development\ReportsNoel.rtf", _
  10.                    False, ""
  11.     DoCmd.OutputTo acReport, "rptReportsNoel", _                   "RichTextFormat(*.rtf)", _
  12.                    "C:\Documents and Settings\reo\My Documents\ContractReports\ReportsNoel.rtf", _
  13.                    False, ""
  14.         End If
Jan 31 '07 #5
MMcCarthy
14,534 Recognized Expert Moderator MVP
Here is the code that creates a report for one person.

Expand|Select|Wrap|Line Numbers
  1.  DoCmd.OpenQuery "qryTimeToMailNoel", acNormal, acEdit
  2.         If DCount("*", "qryTimeToMailNoel") = 0 Then
  3.     DoCmd.Close acQuery, "qryTimeToMailNoel"
  4.         Else
  5.     DoCmd.OpenReport "rptReportsNoel", acPreview, "", ""
  6.     DoCmd.Close acReport, "rptReportsNoel"
  7.     DoCmd.Close acQuery, "qryTimeToMailNoel"
  8.     DoCmd.OutputTo acReport, "rptReportsNoel", _
  9.                    "RichTextFormat(*.rtf)", _                   "g:\accounting\development\ReportsNoel.rtf", _
  10.                    False, ""
  11.     DoCmd.OutputTo acReport, "rptReportsNoel", _                   "RichTextFormat(*.rtf)", _
  12.                    "C:\Documents and Settings\reo\My Documents\ContractReports\ReportsNoel.rtf", _
  13.                    False, ""
  14.         End If
Where is the line of code that actually calls the mailout function?
Jan 31 '07 #6
pixie
41 New Member
The one above is run by a macro which has another RunCode to run the following function

Expand|Select|Wrap|Line Numbers
  1. Function ROconnerMail()
  2. Call RunROconnerEMail
  3. End Function
This calls the following:

Expand|Select|Wrap|Line Numbers
  1. Sub RunROconnerEMail()
  2.  
  3. On Error GoTo Err_Handler
  4. Dim strTemp As String
  5. Dim varAttach(2) As Variant
  6. Dim strRecTo(1, 0) As String
  7. Dim strRecCc(1, 0) As String
  8. Dim lngCount As Long
  9. Dim varProxies As Variant
  10. Dim cGW As GW
  11.  
  12.  
  13. varAttach(0) = "C:\Documents and Settings\reo\My Documents\" & _
  14.                "ContractReports\ReportsOConnor.rtf"
  15.  
  16. strRecTo(0, 0) = "reo@propeople.org"
  17. strRecTo(1, 0) = "reo@propeople.org"
  18.  
  19. strRecCc(0, 0) = "tpg@propeople.org"
  20.  
  21. Set cGW = New GW
  22. With cGW
  23.   .Login
  24.   .BodyText = "Attached please find a word document that lists: " & _
  25.               "contract reports that are over due and contract reports " & _
  26.               "that are due within one to three weeks.  " & vbCrLf & vbCrLf & _
  27.               "Please ensure that the reports are completed and sent " & _
  28.               "to the contract officer on time.  A copy of the dated " & _
  29.               "cover letter transmitting the report and the report " & _
  30.               "itself should be sent to the Accounting Specialist in " & _
  31.               "the Finance Office.  The Accounting Specialist will " & _
  32.               "update the Contracts database with the date the report " & _
  33.               "was submitted and file the report in the contract file " & _
  34.               "for the compliance audits." & vbCrLf & vbCrLf & _
  35.               "If no document is attached to this automated e-mail " & _
  36.               "then you have no past due reports and no reports due " & _
  37.               "within the next three weeks." & vbCrLf & vbCrLf & _
  38.               "For questions please contact the Accounting Specialist " & _
  39.               "at 874-1140 ext 356. Thank you."
  40.   .Subject = "Contract Reports"
  41.   .RecTo = strRecTo
  42.   .RecCc = strRecCc
  43.   .FileAttachments = varAttach
  44.   .FromText = "Finance Department"
  45.   .Priority = "High"
  46.   strTemp = .CreateMessage
  47.   .ResolveRecipients strTemp
  48.   If IsArray(.NonResolved) Then MsgBox "Some unresolved recipients."
  49.   .SendMessage strTemp
  50.   .DeleteMessage strTemp, True
  51. End With
  52.  
  53.  
  54.  
  55. Exit_Here:
  56.   Set cGW = Nothing
  57. Exit Sub

I appreciate the time you are spending as this is getting really frustrating; anything I try doesn't work.
Jan 31 '07 #7
NeoPa
32,571 Recognized Expert Moderator MVP
Pixie,
If you post code without the tags (as it instructs you to do in the Reply window) then anyone trying to help you will find it difficult to understand what you're doing or what your code is doing. I've fixed up your earlier posts for you but the underlying code is not laid out for reading. If I fix this last one up it's just going to hide most of the info as some of the lines are so long (.BodyText=...) . If you want the help then please at least don't make things harder for those who try to give it. I will go through your last post now trying to make it readable, but please, in future, include the tags and lay the code out in a way that is easily read.

MODERATOR.
Jan 31 '07 #8
pixie
41 New Member
I'm sorry. I will review the guidelines and comply in the future.
Jan 31 '07 #9
NeoPa
32,571 Recognized Expert Moderator MVP
That was a quick response :)
I don't mean to sound heavy, but it can cause a lot of delays sometimes.

I actually enjoyed going through your code though. It's a shame I don't have that level of experience with the objects that drive MS Outlook - but that's another story...
Jan 31 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4361
by: Atim | last post by:
I'm trying to create an email message in Novell Groupwise (from Access) which the user can edit before sending. Using the code below, I can create a message just fine, but the problem is that it gets sent out automatically, which is not what I want. If I comment out the Call Message.Send part of the code, it stores the message in the Work in Progress Folder, which is great - but it deletes all the recipients' addresses in the "TO:"...
2
4211
by: acewood1 | last post by:
I've done some searching in the archives but can't seem to find an easy answer as to how to send a Groupwise email through Access 2003. I just need to open a new email and populate the "To:" line with the email address on a form. In Access 97 this simple line on a command button got the job done. DoCmd.SendObject , "", "", Me.txtEmail, "", "", "", "", True, "" I've been to Dev Ashish's site and saw the code written by Dimitri...
5
1693
by: amjad | last post by:
hi how to send email through groupwise not smtp with asp.net 1.1 lang=c sharp.. thanks
13
4417
by: mcsheepie | last post by:
Hi I've been happily using Dimitri Furman's email code to send messages but since upgrading to Groupwise 7 i've hit a slight problem. The code works great and sends the email as expected, however if you specify a proxy account to send the message from it does this, sends the email and then Access crashes (generic, Access has encountered and error message). I can't seem to find out where its crashing, no error messages etc, debugging doesn't...
0
8828
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.