My email code suddenly doesn't work anymore.

All of a sudden this email code doesn't work anymore.  I had written it for 
an Access 2000 application.  The IT department upgraded to MS Office 2003 
about close to a month ago, but this code has continued to work up until a 
few days ago.  I don't know what has happened to cause it to stop working.  
We use Outlook with exchange server.  Is there anything that could have 
changed on the Exchange server to cause this to stop working?  I haven't 
changed my references either.  I still have the Microsoft Outlook 11 Object 
Library selected.  When I attempt to run the code and it fails, I click debug 
and the following line is highlighted yellow:

objMail = objOutlook.CreateItem(olMailItem)

When I mouse over it I get a tooltip that says: objMail = nothing


Here is my code:
------------------------------------------------------------------------------------------------
'Send Email to an FSR

Dim objOutlook As New Outlook.Application
Dim objMail As MailItem

Set objOutlook = New Outlook.Application
Set objMail = objOutlook.CreateItem(olMailItem)

EmailAddr = Me.Email
CopyEmailAddr = ""
Subj = "Information about the FSR Update database."
Body = "tsup dog"

PathName = ""

With objMail
    .To = EmailAddr
    .cc = CopyEmailAddr
    .Subject = Subj
    .Body = Body
    .NoAging = True
    .Display
End With

'****** Send the email without prompts  *******
SendKeys "%{s}", True
'****************************************************

Set objMail = Nothing
Set objOutlook = Nothing
-----------------------------------------------------------------------------------------------

When I run it with error handling, it gives me this error: 
Run-time error '-2079129597 (84130003)': The operation failed.

Again, this just suddenly stopped working.  Any ideas?
0
Utf
3/4/2008 12:28:01 AM
access.formscoding 7494 articles. 0 followers. Follow

4 Replies
941 Views

Similar Articles

[PageSpeed] 15

You have not dim'd these variables:

EmailAddr
CopyEmailAddr
Subj
Body

That could be a possible cause. Why not just use the for and literal values 
directly?
-- 
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Jonathan Brown" <JonathanBrown@discussions.microsoft.com> wrote in message 
news:44692358-6995-47AA-8A44-41E28885C91E@microsoft.com...
> All of a sudden this email code doesn't work anymore.  I had written it 
> for
> an Access 2000 application.  The IT department upgraded to MS Office 2003
> about close to a month ago, but this code has continued to work up until a
> few days ago.  I don't know what has happened to cause it to stop working.
> We use Outlook with exchange server.  Is there anything that could have
> changed on the Exchange server to cause this to stop working?  I haven't
> changed my references either.  I still have the Microsoft Outlook 11 
> Object
> Library selected.  When I attempt to run the code and it fails, I click 
> debug
> and the following line is highlighted yellow:
>
> objMail = objOutlook.CreateItem(olMailItem)
>
> When I mouse over it I get a tooltip that says: objMail = nothing
>
>
> Here is my code:
> ------------------------------------------------------------------------------------------------
> 'Send Email to an FSR
>
> Dim objOutlook As New Outlook.Application
> Dim objMail As MailItem
>
> Set objOutlook = New Outlook.Application
> Set objMail = objOutlook.CreateItem(olMailItem)
>
> EmailAddr = Me.Email
> CopyEmailAddr = ""
> Subj = "Information about the FSR Update database."
> Body = "tsup dog"
>
> PathName = ""
>
> With objMail
>    .To = EmailAddr
>    .cc = CopyEmailAddr
>    .Subject = Subj
>    .Body = Body
>    .NoAging = True
>    .Display
> End With
>
> '****** Send the email without prompts  *******
> SendKeys "%{s}", True
> '****************************************************
>
> Set objMail = Nothing
> Set objOutlook = Nothing
> -----------------------------------------------------------------------------------------------
>
> When I run it with error handling, it gives me this error:
> Run-time error '-2079129597 (84130003)': The operation failed.
>
> Again, this just suddenly stopped working.  Any ideas? 


0
Arvin
3/4/2008 2:32:30 AM
oops, you're right.  In the code snippet below I forgot to include that, but 
I had dim'd those variables higher up in my proceedure.  And you're also 
correct, I could just use the literal values.

Unfortunately, that's not where the code is breaking though.  I think it's 
dieing at the set objOutlook = New Outlook.Application line.

Here's another thing to consider.  I copied the application to my personal 
laptop which is not used to connect to our corporate network, nor is it 
configured to use MS Exchange.  It also happens to have Office 2007 on it.  
When I copied it to my personal laptop, the code works no problem.

So now, I'm thinking that there's something going on with Outlook 2003, or 
Exchange Server.  Doing a Google search for that run-time error message I'm 
getting brings up a lot of threads from people who are having a lot of weird 
issues.

Anyway, let me know if you come up with any other ideas.

"Arvin Meyer [MVP]" wrote:

> You have not dim'd these variables:
> 
> EmailAddr
> CopyEmailAddr
> Subj
> Body
> 
> That could be a possible cause. Why not just use the for and literal values 
> directly?
> -- 
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
> 
> "Jonathan Brown" <JonathanBrown@discussions.microsoft.com> wrote in message 
> news:44692358-6995-47AA-8A44-41E28885C91E@microsoft.com...
> > All of a sudden this email code doesn't work anymore.  I had written it 
> > for
> > an Access 2000 application.  The IT department upgraded to MS Office 2003
> > about close to a month ago, but this code has continued to work up until a
> > few days ago.  I don't know what has happened to cause it to stop working.
> > We use Outlook with exchange server.  Is there anything that could have
> > changed on the Exchange server to cause this to stop working?  I haven't
> > changed my references either.  I still have the Microsoft Outlook 11 
> > Object
> > Library selected.  When I attempt to run the code and it fails, I click 
> > debug
> > and the following line is highlighted yellow:
> >
> > objMail = objOutlook.CreateItem(olMailItem)
> >
> > When I mouse over it I get a tooltip that says: objMail = nothing
> >
> >
> > Here is my code:
> > ------------------------------------------------------------------------------------------------
> > 'Send Email to an FSR
> >
> > Dim objOutlook As New Outlook.Application
> > Dim objMail As MailItem
> >
> > Set objOutlook = New Outlook.Application
> > Set objMail = objOutlook.CreateItem(olMailItem)
> >
> > EmailAddr = Me.Email
> > CopyEmailAddr = ""
> > Subj = "Information about the FSR Update database."
> > Body = "tsup dog"
> >
> > PathName = ""
> >
> > With objMail
> >    .To = EmailAddr
> >    .cc = CopyEmailAddr
> >    .Subject = Subj
> >    .Body = Body
> >    .NoAging = True
> >    .Display
> > End With
> >
> > '****** Send the email without prompts  *******
> > SendKeys "%{s}", True
> > '****************************************************
> >
> > Set objMail = Nothing
> > Set objOutlook = Nothing
> > -----------------------------------------------------------------------------------------------
> >
> > When I run it with error handling, it gives me this error:
> > Run-time error '-2079129597 (84130003)': The operation failed.
> >
> > Again, this just suddenly stopped working.  Any ideas? 
> 
> 
> 
0
Utf
3/4/2008 3:04:00 PM
It's fixed!!!! Okay, allow me to explain the situation. As I had mentinoed in 
one of my previous posts, I have to connect to our corporate network through 
Citrix. The IT department recently upgraded the version of Microsoft Office 
on the Citrix servers to MS Office 2003. 

The computers that all of my managers are using are still using Office 2000.

When I connect to the network through Citrix and go into my application to 
do anything, the Microsoft Outlook 9.0 Object Library reference gets replaced 
with the Microsoft Outlook 11.0 Object Library. When that happens, all of the 
computers that are still using Office 2000 stop working since they can't find 
the Microsoft Outlook 11.0 Object library.

So what I had to do was login through Citrix, then use Remote Desktop 
Connection to remote control on of my manager's computers and then open the 
application and fix the references.

Now, Is there a way to have both references in there? Could I have the 
Microsoft Outlook 9.0, 10.0, 11.0, and 12.0 libraries in there so that it'll 
work no matter what version of Office is running? 

"Arvin Meyer [MVP]" wrote:

> You have not dim'd these variables:
> 
> EmailAddr
> CopyEmailAddr
> Subj
> Body
> 
> That could be a possible cause. Why not just use the for and literal values 
> directly?
> -- 
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
> 
> "Jonathan Brown" <JonathanBrown@discussions.microsoft.com> wrote in message 
> news:44692358-6995-47AA-8A44-41E28885C91E@microsoft.com...
> > All of a sudden this email code doesn't work anymore.  I had written it 
> > for
> > an Access 2000 application.  The IT department upgraded to MS Office 2003
> > about close to a month ago, but this code has continued to work up until a
> > few days ago.  I don't know what has happened to cause it to stop working.
> > We use Outlook with exchange server.  Is there anything that could have
> > changed on the Exchange server to cause this to stop working?  I haven't
> > changed my references either.  I still have the Microsoft Outlook 11 
> > Object
> > Library selected.  When I attempt to run the code and it fails, I click 
> > debug
> > and the following line is highlighted yellow:
> >
> > objMail = objOutlook.CreateItem(olMailItem)
> >
> > When I mouse over it I get a tooltip that says: objMail = nothing
> >
> >
> > Here is my code:
> > ------------------------------------------------------------------------------------------------
> > 'Send Email to an FSR
> >
> > Dim objOutlook As New Outlook.Application
> > Dim objMail As MailItem
> >
> > Set objOutlook = New Outlook.Application
> > Set objMail = objOutlook.CreateItem(olMailItem)
> >
> > EmailAddr = Me.Email
> > CopyEmailAddr = ""
> > Subj = "Information about the FSR Update database."
> > Body = "tsup dog"
> >
> > PathName = ""
> >
> > With objMail
> >    .To = EmailAddr
> >    .cc = CopyEmailAddr
> >    .Subject = Subj
> >    .Body = Body
> >    .NoAging = True
> >    .Display
> > End With
> >
> > '****** Send the email without prompts  *******
> > SendKeys "%{s}", True
> > '****************************************************
> >
> > Set objMail = Nothing
> > Set objOutlook = Nothing
> > -----------------------------------------------------------------------------------------------
> >
> > When I run it with error handling, it gives me this error:
> > Run-time error '-2079129597 (84130003)': The operation failed.
> >
> > Again, this just suddenly stopped working.  Any ideas? 
> 
> 
> 
0
Utf
3/5/2008 1:17:00 AM
Jonathan Brown <JonathanBrown@discussions.microsoft.com> wrote:

>Now, Is there a way to have both references in there? Could I have the 
>Microsoft Outlook 9.0, 10.0, 11.0, and 12.0 libraries in there so that it'll 
>work no matter what version of Office is running? 

Better yet have no references at all to Outlook.  Use late binding.

Late binding means you can safely remove the reference and only have
an error when the app executes lines of code in question.  Rather than
erroring out while starting up the app and not allowing the users in
the app at all.  Or when hitting a mid, left or trim function call.  

This also is very useful when you don't know  version of the external
application will reside on the target system.  Or if your organization
is in the middle of moving from one version to another.

For more information including additional text and some detailed links
see the "Late Binding in Microsoft Access" page at
http://www.granite.ab.ca/access/latebinding.htm

Tony
-- 
Tony Toews, Microsoft Access MVP
   Please respond only in the newsgroups so that others can 
read the entire thread of messages.
   Microsoft Access Links, Hints, Tips & Accounting Systems at 
http://www.granite.ab.ca/accsmstr.htm
   Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
0
Tony
3/15/2008 3:29:14 AM
Reply:

Similar Artilces:

MSMONEY 2007 WORKING SLOWLY
I USE MSMONEY THERE ARE SEVERAL YEARS. NOW I HAVE 2007. IT IS VERY SLOW, MAINLY WHEN ITt BEGINS, IT IS SEVERAL MINUTES PROCESSING, WITH CPU TO 100%. WHAT CAN BE? Please don't SHOUT. It hurts my eyes and is entirely unnecessary. Your Caps Lock key--learn it, use it, love it. Money's handling of scheduled bill data internally is hopelessly broken. Rather than fix that, they issued a tool to remove all the bad data they happily collect and leave lying around. We call it "Nuke The Bills." See http://umpmfaq.info/faqdb.php?q=187 for more information. It has fixed perfor...

Can Recieve email but cannot send out
For Outlook 2003, cannot send out. Have internet connection, and can receive emails. I have tried disabling firewall and Norton, but no luck. Any suggestions? are you getting any kind of error back? "Mark Sanford" <anonymous@discussions.microsoft.com> wrote in message news:cc5901c43909$3916a210$a301280a@phx.gbl... > For Outlook 2003, cannot send out. Have internet > connection, and can receive emails. I have tried > disabling firewall and Norton, but no luck. Any > suggestions? "Mark Sanford" <anonymous@discussions.microsoft.com> wrote in me...

Outlook, NT Exchange 4.5, VPN, Domain..... Can't make it all work. PLZ help, will reward.
Really stuck with the Outlook� Situation: NT SBS 4.5 server. 6 machines connected to it on a domain. All suck internet through a LAN broadband router. Server used to be configured on a modem dial-up and emails worked fine. Now with this new ADSL setup (new provider) emails get stuck on despatch. Finding the SMTP server configuration has been a task I didn't manage. Can anyone help? I can only find the SMTP settings for the administrator on the server but that is of no use� I found a setting where all mail is forwarded to an internet based server but no place for a password or login. The...

HELP, Navigation bar works in Firefox, not Explorer
I have recently uploaded a website created on FrontPage 2003 to GoDaddy. The home page navigation bar works well when viewed with Firefox, but not at all with Explorer 7. What's wrong???? Thanks, No idea. But your question seems to have nothing to do with Access, the Microsoft database application that this newsgroup is concerned with. Rob captain" <captain@discussions.microsoft.com> wrote in message news:1EAD2E1E-6F46-49F6-AB38-3F26A3B764ED@microsoft.com... >I have recently uploaded a website created on FrontPage 2003 to GoDaddy. >The > home page navigati...

HELP: Lost all my old emails
Hello, First there was the power failure. Then there was Windows XP recovery program (that ran automatically). Now, my desktop is blown away and all my Outlook emails and contacts are gone. Could these files be lurking in some obscure directory? Don't say search for dbx files. My computer doesn't have any. I'm running Windows XP media edition. Regards and thanks. do a search for pst files. or you can try .pab files for your personal address book. If those arent there.. You might be screwed! I save my pst files on my server where they are backed up.. for just this re...

My date format will not work.
If I type a date, 02/28/05 in a cell, it changes to somthing like 06/02/1955. Even when I change the format, date, and change selections, 2/28/2005, or Monday, February 28, 2005. It will default back to some other month, date and year. I know that it worked correctly on Friday, 2/25/05, does anyone know of a bug or update that could have caused this problem? Thanks Hi what happens if you use the short-cut key combination of control & semi-colon (;) to input the current date? Cheers JulieD "LJfeild" <LJfeild@discussions.microsoft.com> wrote in message news:CEA4F...

outlook email questionaire
I want to send an email to clients that has a questionaire on it with text answers. I want them to be able to answer the questions and then click a button at the bottom of the page that will send it directly to my email without them having to enter my address. How do I do this? Well, i's possible to do what you want (mail a form to someone that's editable on the receiving end and runs code to send mail when done) but is not easy. Check out www. outlookcode.com for some ideas on how to approach this. If you are not using an exchange server, I'd recommend using Form Regions...

Email
I have created a simple Access database that our HR department will use to input demographic information on a new employee, as well as what software, access, etc. a new employee will need. Again, it is VERY simple, but what I can't figure out is how to create a button that the HR staff can click on and the file, with all the information, is emailed to our IS department. Can this be done? You can setup a report to based on your current record and email it using SendObject or using Outlook automation. This does require a minimal amount of VBA programming in either case. If you sear...

Can't forward to an external email address...
We have a user that uses his external AOL account as well as his company email account. He has asked me to forward all company mail to his external AOL account. I figured I'd be able to just go into the delivery options on the "Exchange General" tab for his user profile and forward to the appropriate address. However, you cannot enter just any address in there, it forces you to select an address from the directory - of course his AOL address is not there. Is there an easy way to forward all mail from his internal account to an external account? I tried creating a rule on his Out...

email addresses in memory
An outlook 2003 user states that when sending out an email and when they type in a letter in the "to" area the email addresses that were in memory when you type a letter or name are gone. They said they didn't do anything different. The addresses are in the contact list but there is nothing in memory so you have to type the whole address in. Is this possible or can address in memory be deleted or removed? They are stored in the *.nk2 file located in Docs&Settings\Application Data\Microsoft\Outlook (by default) You dont have to type the address in, just click the &...

View & Edit the source HTML code in 2003.
I just upgraded from express to 2003, and I am not happy because the feature I use the most is gone. While composing a new message using Express there are three tabs at the bottom of the window “Edit” “Source” and “Preview”. I want to be able to change the Source HTML code using Outlook 2003. I have search the message board for an answer and was unable to find one. I have the message type set to HTML, but when I insert HTML tags in the message they do not do anything. I can’t find a separate HTML view, and I don’t want to use “Insert >> picture” or “Insert >> Hyperlink” every ...

Unlinking tracked emails in CRM 3.0
I find that once an email is linked to/tracked by CRM (Customer, Client, Activity) it can't be unlinked! only deleted. For example; A client uses an old CRM generated email containing the tracking token to ask about a new problem. CRM automatically tracks the new email to the old CRM case and I can't untrack it to link it to a new case. Any information would be helpful... Hi, Check out "How to "untrack" Microsoft CRM Outlook e-mails" on following blog http://blog.sonomapartners.com/ -- PLEASE do click on Yes or No button if this post was helpful or not for ou...

Open document with Word instead of Works
Our computer came originally installed with Works. When we loaded Microsoft Office (Home and Student Version) 2007, it seemed to load fine and is able to be used for word processing, excel spreadsheets, etc. But when we try to open documents sent via the web, it automatically defaults to Works. In Vista, tried to change the default, and the Microsoft Office suite is not listed on the choices for default programs. Help! Right-click on a file you've saved to your hard drive (you wouldn't try opening an attachment directly from email, would you?), choose "Open With,...

Korean email
I can type and send Korean characters in emails but cannot receive them in Outlook 2003. Any help? ...

retrieve unsaved work
I accidentally hit the no button when asked to save my work in exel. How can I retrieve this information You cannot retrieve this work if you were not running the AutoSave add-in which is not avilable in version 2002 and 2003. If you were, you may have a recently autosaved version. Otherwise.......out of luck. For future download Jan Karel Pieterse's AutoSafe add-in. It doesn't overwrite the existing workbook when it saves. It saves to a user selectable folder. And when it's done, it either deletes these backups (or puts them in the recycle bin). And the user can always r...

outlook express outgoing email disappears
I use Windows98 SE and Outlook Express6. Sometimes and with different addressees when I send an email it is received by the addressee ok but it is not in my sent items folder so I have no record of it! It does not happen every time -- perhaps about 1 in 6. I'M probably overlooking the obvious. Suggestions welcome. i suggest the outlook express newsgroup -Gary "Sean Dunne" <dunnes@iol.ie> wrote in message news:128d001c3f72d$d457f8f0$a101280a@phx.gbl... > I use Windows98 SE and Outlook Express6. Sometimes and > with different addressees when I send an email it...

Instant search of emails (10,000) fails
Failure of instant search requires reboot befor resolving for search or two and again fails ...

How do I Full screen an Email???
I looking for a way to look at an email that I receive in a full screen mode. The way I'm trying to see it is like I was in I.E. and pressed the f11 key or if I was in Word or Excel & used the Alt+V+U function for full screen. What I am trying to see just the heart of the email not the header or anything else but the email body Craig <cb3_3@hotmail.com> wrote: > I looking for a way to look at an email that I receive in > a full screen mode. The way I'm trying to see it is like > I was in I.E. and pressed the f11 key or if I was in > Word or Excel & us...

email forwarding to my other email
I have two email accounts. One I use for work and the other for personal. For some reason, my personal email is being forwarded to my work email. I don't know why and how do I stop it....? Are these POP3 accounts? Has it ever worked? Are they separate accounts, or addresses that are aliases for the same Inbox? Does your personal e-mail show in both places, or is it going to your work only? Any rules set up in WinMail, or on the server's Website? -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "az otr" <az otr@disc...

Code #2
The following code works well, however how can I change this to run with a command button. Also is there any way I could delete some columns from the sheets as well. Private Sub Workbook_Open() Dim wb As Workbook 'copy all sheets Worksheets.Copy Set wb = ActiveWorkbook Application.DisplayAlerts = False 'delete the sheets you want wb.Sheets(Array("Suspense", "RCA exc RIM", "Operations summary", "RCA incl RIM", "First Qtr", "Second Qtr", "Third Qtr", "Fourth Qtr")).Delete Application.DisplayAlerts = Tr...

Emails not leaving outbox
Hi all - I am having what seems to be a common problem, but all of the suggested fixes I found did not work. I have set up SQLServer to use MAPI to email notifications. I have Outlook 2000 installed and configured and working. The SQLServer notifications part isworking too. The only thing I can't figure out is the emails never leave the outbox until I start Outlook and click Send/Receive. Then they are all sent fine. I read some articles mentioning MAPISP32, which appears to be the culprit. From what I see it's supposed to spool emails that are in the Outlook outbox. I found after I ...

Missing text in email
I recently installed Exchange 2003. From time to time when my users send email outside the company there messages are missing text upon arrival. The text missing could be two sentences at the end of a paragraph and the next one starts okay, or it could be a very words missing here and that. Any ideas of this Michelle P. Michelle: I know you have probably thought about this already, but do you have any type of content inspection system installed on your Exchange server? Or anything installed that stamps a message disclaimer on the message. Is the message changed by the clien...

question about grouping the emails.
Hi, I am signed-up to a discussion group and i get question about a prob and also solutions as a reply. i am grouping the e-mails by subject, For example... subject: "problem with ABCDE" in reply the subject will be "RE: problem with ABCDE" now Outlook2003 is grouping these two into seperate groups and if there is a reply with subject "RE:RE: problem with ABCDE" it groups that seperately. i want to group the replies also into the same group. the reply to the emails are grouped seperately. i want to have an exception in the grouping saying to ignore the word...

I cannot click and drag e-mails anymore. What's wrong?
I have the ability to drag folders in outlook but not individual e-mails. Any ideas as to what has gone wrong? "Jeff" <Jeff@discussions.microsoft.com> wrote in message news:2F3E8109-D3A3-4127-8DC9-72E5858C8971@microsoft.com... >I have the ability to drag folders in outlook but not individual e-mails. Any > ideas as to what has gone wrong? Drag them to where and what happens when you try? What type of account and what version of Outlook? -- Brian Tillman [MVP-Outlook] ...

Outlook Client
Hi all, In the web client there is an email icon available from the views which allows you to send a direct email to the selected records in the view. Does anyone know if there is any way to call this from the Outlook client. Appreciate it :) cheers Nathan Hi, I'm afraid I can't help you out on this one. But I found that it's not only the icon missing in the Outlook client, but as soon as the Outlook client is active, the icon disappears in the Webclient also. This seems the same issue to me as the settings button disappearing when the Outlook client is active, wh...