473,763 Members | 8,483 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
46 3530
pixie
41 New Member
Thanks. I hope you or someone will be able to help me out. I tried doing
Expand|Select|Wrap|Line Numbers
  1. If varAttach(0).Count = O Then vbCancel Send End if
byt that didn't work. I am not sure what left to try. Looking forward to a response.
Feb 1 '07 #11
NeoPa
32,572 Recognized Expert Moderator MVP
The first thing you need to do is to determine what recognisable situation occurs when there are no items in your report. Does it fail to produce a file or does it produce a very small one. When you know that, we can look at ways of determining whether or not that state can be recognised by your code.
Feb 1 '07 #12
pixie
41 New Member
If there is no data, a report is not created and thus not saved in the folder. The folder gets cleaned out after each email run.
Feb 1 '07 #13
NeoPa
32,572 Recognized Expert Moderator MVP
That, we can work with.
It involves using Dir() but I'll have to look into it a bit before answering properly.
Feb 1 '07 #14
NeoPa
32,572 Recognized Expert Moderator MVP
Our first step is to put the following code in a general Module in your database.
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. 'Exist returns true if strFile exists.
  5. '22/05/2003 Rewritten with better code.
  6. '20/05/2005 Added finding of R/O, System & Hidden files
  7. Public Function Exist(strFile As String, _
  8.                       Optional intAttrib As Integer = &H7) As Boolean
  9.     Exist = (Dir(PathName:=strFile, Attributes:=intAttrib) <> "")
  10. End Function
Feb 1 '07 #15
NeoPa
32,572 Recognized Expert Moderator MVP
Working from the code you posted in post #7...
Expand|Select|Wrap|Line Numbers
  1. 'Line added
  2. Private Const conFile As String = _
  3.                   "C:\Documents and Settings\reo\My Documents\" & _
  4.                   "ContractReports\ReportsOConnor.rtf"
  5.  
  6. Function ROconnerMail()
  7. 'Line changed
  8.   If Exist(conFile) Then Call RunROconnerEMail(strFile:=conFile)
  9. End Function
  10.  
  11. 'Line changed
  12. Sub RunROconnerEMail(ByRef strFile As String)
  13.  
  14.   On Error GoTo Err_Handler
  15.   Dim strTemp As String
  16.   Dim varAttach(2) As Variant
  17.   Dim strRecTo(1, 0) As String
  18.   Dim strRecCc(1, 0) As String
  19.   Dim lngCount As Long
  20.   Dim varProxies As Variant
  21.   Dim cGW As GW
  22.  
  23. 'Line changed
  24.   varAttach(0) = strFile
  25.  
  26.   strRecTo(0, 0) = "reo@propeople.org"
  27.   strRecTo(1, 0) = "reo@propeople.org"
  28.   strRecCc(0, 0) = "tpg@propeople.org"
  29.  
  30.   Set cGW = New GW
  31.   With cGW
  32.     .Login
  33.     .BodyText = "Attached please find a word document that lists: " & _
  34.                 "contract reports that are over due and contract reports " & _
  35.                 "that are due within one to three weeks.  " & vbCrLf & vbCrLf & _
  36.                 "Please ensure that the reports are completed and sent " & _
  37.                 "to the contract officer on time.  A copy of the dated " & _
  38.                 "cover letter transmitting the report and the report " & _
  39.                 "itself should be sent to the Accounting Specialist in " & _
  40.                 "the Finance Office.  The Accounting Specialist will " & _
  41.                 "update the Contracts database with the date the report " & _
  42.                 "was submitted and file the report in the contract file " & _
  43.                 "for the compliance audits." & vbCrLf & vbCrLf & _
  44.                 "If no document is attached to this automated e-mail " & _
  45.                 "then you have no past due reports and no reports due " & _
  46.                 "within the next three weeks." & vbCrLf & vbCrLf & _
  47.                 "For questions please contact the Accounting Specialist " & _
  48.                 "at 874-1140 ext 356. Thank you."
  49.     .Subject = "Contract Reports"
  50.     .RecTo = strRecTo
  51.     .RecCc = strRecCc
  52.     .FileAttachments = varAttach
  53.     .FromText = "Finance Department"
  54.     .Priority = "High"
  55.     strTemp = .CreateMessage
  56.     .ResolveRecipients strTemp
  57.     If IsArray(.NonResolved) Then MsgBox "Some unresolved recipients."
  58.     .SendMessage strTemp
  59.     .DeleteMessage strTemp, True
  60.   End With
  61.  
  62. Exit_Here:
  63.   Set cGW = Nothing
  64. Exit Sub
Feb 1 '07 #16
pixie
41 New Member
OK. I have it in the General Module as its own module. What next? Boy, do I really appreciate all your attention and help.
Feb 1 '07 #17
NeoPa
32,572 Recognized Expert Moderator MVP
I hope you refreshed after posting and saw the other posts ;)
Feb 1 '07 #18
pixie
41 New Member
Good morning. I was in a meeting yesterday afternoon (a rare thing for me) so didn't see the rest of your reply till late. I just added it but for some reason I can't run it. Should the first two line changes go in a new module?
Feb 2 '07 #19
NeoPa
32,572 Recognized Expert Moderator MVP
I'm a bit confused by the last bit (your question).
Where do you have the code currently (Module names and Types pls)? What is the name of the form you're working in?
There is some flexibility here as to where things can go, so if I know what you have where, I can better explain where it would be easiest for you to put the changes.
Feb 2 '07 #20

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
4212
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
1694
by: amjad | last post by:
hi how to send email through groupwise not smtp with asp.net 1.1 lang=c sharp.. thanks
13
4418
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
9564
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9387
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
10148
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
10002
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...
0
9823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7368
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
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2794
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.