另一个使用Outlook和VBA的电子邮件问题 [英] Another email question using Outlook and VBA

查看:76
本文介绍了另一个使用Outlook和VBA的电子邮件问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在解决这个前景问题,并且最终弄清楚为什么当一个人没有安装Outlook时缺少参考。

我的开发机器上有Office 365,这一直都是问题所在。 Office 365将Outlook放在与所有其他版本的Outlook不同的目录中。使用Office 365 outlook如果放在目录程序文件(x86)\ Microsoft Office / root / office 16中,那就是我的程序所看到的参考。我已经切换回Outlook 2007,现在引用指向c:\program files(x86)\ microsoft office\office12,似乎没有人获得引用。

My开发机器上仍然有Outlook 365,但是如果Outlook正在运行,程序将不会发送邮件,如果我关闭Outlook然后运行该程序的电子邮件部分,它将发送所有电子邮件。

我''使用下面的代码

I''ve been fighting this outlook problem and have finally figured out why the reference is missing when a person doesn''t have outlook installed.
I have Office 365 on my development machine, and this has been the problem all along. Office 365 puts outlook in a different directory than all other version of Outlook. With Office 365 outlook if placed in a directory Program files(x86)\Microsoft office/root/office 16 and that was the reference my program was look at. I''ve switched back to Outlook 2007 and now the reference is pointing to c:\program files (x86)\Microsoft office\office12 and it seems like nobody gets the reference.
My development machine still has Outlook 365 on it but the program will not send out mail if Outlook is running, if I close Outlook and then run the email part of the program it will send out all email.
I''m using the following code

展开 | 选择 | Wrap | 行号

推荐答案

我很困惑汤姆。您解释了找到Outlook可执行文件的文件夹,然后将您作为一个与此完全无关的问题(至少通过发布的代码)。你希望我们关注的实际问题是什么?
I''m confused Tom. You explain about the folder where the Outlook executable is found then you as a question entirely unrelated to that (going by the posted code at least). What''s the actual problem you''d like us to focus on?


对这种混乱感到抱歉。我只是对MS和我遇到的问题感到沮丧。

我的问题是当我尝试通过我的程序发送电子邮件如果Outlook运行时电子邮件没有被发送,他们不会甚至没有进入发件箱。但是,如果Outlook没有运行,那么电子邮件就会被发送出去了。

就像我在第一篇文章中提到的那样。当outlook正在运行时,Set MyObject = GetObject(,Outlook.application)显示Nothing。但是当Outlook没有运行时它会显示Outlook。

如果Outlook正在运行,有没有办法发送电子邮件。
Sorry about the confusion. I''m just frustrated with MS and the problems I''m having.
My problem is when I try and send emails out through my program if Outlook is running the emails are not sent, they don''t even go into the outbox. However if Outlook isn''t running then emails are sent out fine.
Like I mentioned in the first post. When outlook is running the Set MyObject = GetObject(, "Outlook.application'') shows "Nothing" but when Outlook isn''t running it shows Outlook.
Is there a way to have the email be sent if Outlook is running.


Tom,


你有没有试过看这篇文章:发送通过MS Outlook发送电子邮件?这是一种略有不同的方法,但我从来不必担心应用程序所在的路径。
Tom,

Have you tried looking at this article: Sending e-mails via MS Outlook? It is a slightly different approach, but I?ve never had to worry about the path in which the application resides.


这篇关于另一个使用Outlook和VBA的电子邮件问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆