Results 1 to 9 of 9
  1. #1
    Nettie is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    21

    Sending Report via E-mail Error

    I am using Access 2007. When I open a report, sometimes I need to e-mail it to someone else. Previously I have been able to do this, but I just got a new computer and now the e-mail option is grayed out and I am not allowed to send it unless I first create a PDF. Also, I have created a command button in one of my forms that will send an e-mail with the report attached as a Snapshot. That is now also not working. I get Error Number 2950. How can I resolve this issue? Is it an Access 2007 issue or an issue with my e-mail client, which is GroupWise?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What is the exact message of the error?

    You are referring to the E-mail item on the Office button is greyed out?

    You say this previously worked with GroupWise?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Nettie is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    21
    I tried to do a screen print, but it wouldn't paste. A box comes up that says "Action Failed." Then it shows the Macro Name, the Condition is "True," Action Name is "Send Object" and then lists the Arguments and the Error Number 2950. The only option is to click a button that says "Stop All Macros" or I just X out.

    Yes, the e-mail item on the Office button is greyed out.

    Yes, it has worked previously with GroupWise.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Never heard of GroupWise. Did it get set as your default email app in the new computer setup?

    Can you do a test with Outlook? I have never tried email with anything else. I also don't use macros, only VBA.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Nettie is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    21
    Yes, GroupWise is set as my default email. I can email from within other Microsoft Office programs, like Word. We do not have Outlook installed on our computers, so unfortunately I cannot do a test with that.

  6. #6
    R_Badger is offline Knows a few tricks
    Windows XP Access 2003
    Join Date
    Feb 2012
    Location
    Suffolk, UK
    Posts
    262
    You said you used a macro, here is some code from a thread I posted on before, you may be able to adapt this to see if it works (again i haven't tried to send without using outlook myself so I'm not certain)

    Code:
    Private Sub Command25_Click()
     
              Dim objOutlook As Outlook.Application
              Dim objOutlookMsg As Outlook.MailItem
              Dim objOutlookRecip As Outlook.Recipient
              Dim objOutlookAttach As Outlook.Attachment
              Dim todayd as date
             
              todayd = Format(Date, "DDMMYY")
             
     
              ' Create the Outlook session.
              Set objOutlook = CreateObject("Outlook.Application")
     
              ' Create the message.
              Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
     
              With objOutlookMsg
                  ' Add the To recipient(s) to the message.
                  Set objOutlookRecip = .Recipients.Add("me@me.com")
                  objOutlookRecip.Type = olTo
     
                  ' Add the CC recipient(s) to the message.
                  Set objOutlookRecip = .Recipients.Add("you@you.com")
                  objOutlookRecip.Type = olCC
     
                 ' Add the BCC recipient(s) to the message.
                  Set objOutlookRecip = .Recipients.Add("them@them.com")
                  objOutlookRecip.Type = olBCC
     
                 ' Set the Subject, Body, and Importance of the message.
                 .Subject = "This is an Automation test with Microsoft Outlook"
                 .Body = "This is the body of the message." & vbCrLf & vbCrLf
                 .Importance = olImportanceHigh  'High importance
     
                 ' Add attachments to the message.
    ' **** Start of modified code ****
    dim reportpath as string
    ' prepares the variable
    Reportpath= "C:\report.snp"
    ' Sets a filename and path for your report to go to
                 docmd.outputto, acreport, "report name here", "SnapshotFormat(*.snp)", reportpath, False, "", 0
    ' Outputs the report in SNP format to the filename and path stated before
    Set objOutlookAttach = .Attachments.Add(reportpath)
    ' Should add the report as an attachment (i have not yet tested this)
                 kill reportpath
    'deletes the temporary report file created before
     ' **** End of modified code ****
    
                 ' Resolve each Recipient's name.
                 For Each objOutlookRecip In .Recipients
                     objOutlookRecip.Resolve
                 Next
     
                 ' Should we display the message before sending?
                 If DisplayMsg Then
                     .Display
                 Else
                     .Save
                     .Send
                 End If
              End With
              Set objOutlook = Nothing
    End Sub

  7. #7
    Nettie is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    21
    Where would I put that code?

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    The code would go behind the form that has the command button. If you have not created VBA code before review http://office.microsoft.com/en-us/ac...010341717.aspx
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    Nettie is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    21
    I copied your code and replaced all of the "outlook" words with "groupwise." Then I copied and pasted it into the background of the form, but nothing changed. I'm not very hip on VBA, so I may have done something wrong. But I don't think it is a code issue. Even when I open up a report I cannot e-mail it. I used to be able to send it as an attachment in an e-mail. Like I stated before, the e-mail option on the office button is greyed out now with my new computer. It doesn't matter where I am in Access, whether it is in a form, looking at a report, or in a table, the e-mail option does not work. Our IT department is checking also, but they have no one that is familiar with Access. It seems like there should be a simple solution to this. Hasn't anyone else ever had this problem? Is there a different version of Access 2007 that confuses other programs?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 09-12-2011, 11:30 AM
  2. Replies: 1
    Last Post: 05-10-2011, 09:48 AM
  3. Sending Outlook E-mail - Run-time error '429'
    By jgelpi16 in forum Programming
    Replies: 2
    Last Post: 03-01-2011, 09:30 AM
  4. Replies: 0
    Last Post: 07-06-2010, 08:12 AM
  5. Sending mail automatically
    By carstenhdk in forum Forms
    Replies: 1
    Last Post: 05-31-2010, 04:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums