标签: outlook-2010

如何检测是否在 Outlook 2007 或 2010 中打开了 HTML 电子邮件?

我目前正在尝试为我工作的公司撰写时事通讯。新闻通讯在所有主要互联网浏览器(IE 5.55 到 9、Chrome、Firefox、Opera)中都能正确显示,但是当有人在 Outlook 2007 或 2010 中打开它时,所有字体看起来都“炸了”。

我知道这个问题是因为 Outlook 像 Word 一样呈现 HTML 的方式,如果我手动“缩小”字体,它们在 Outlook 中看起来不错,但在任何其他电子邮件软件中都没有。

我的问题是这个。有没有办法检测是否正在 Outlook 甚至 Word 中打开电子邮件?鉴于 Outlook 不允许使用 JavaScript,此解决方案必须是纯 HTML。我的计划是检测电子邮件浏览器并动态更改字体(一种 if-else)。

感谢您的帮助!

html html-email outlook-2007 outlook-2010

3
推荐指数
1
解决办法
4548
查看次数

Outlook(2007和2010)中HTML电子邮件表格中TD元素下方的空间不一致

我研究了这个问题,在网上找到了许多建议的修复,但没有任何工作.

问题是我正在设计的HTML电子邮件中表格中特定TD元素之间的差距.它仅在Outlook 2007和2010中以这种方式显示.

这是一个屏幕抓取问题链接

在右侧边栏中,"Level 2"与其上方的薄圆角框之间应该没有间隙.

以下是创建蓝色框的嵌套表的代码:

<table class="box" width="200" border="0" cellspacing="0" cellpadding="0"><tr><td style='line-height:0;font-size:0'><img src="http://dl.dropbox.com/u/16792732/wave-email-images/box_dark_top.gif" style="display:block" width="200" height="10" /></td></tr><tr><td class="box_dark"><h2>Level 2<br /><span class="white">Care Assistants</span></h2><h2>Level 3<br /><span class="white">Senior Carers</span></h2><h2 class="norule">Level 5<br /><span class="white">Managers and Deputy Managers</span></h2></td></tr><tr><td style='line-height:0'><img src="http://dl.dropbox.com/u/16792732/wave-email-images/box_dark_bottom.gif" style="display:block" width="200" height="10" /></td></tr></table>
Run Code Online (Sandbox Code Playgroud)

正如您所看到的,我删除了所有空白区域,因为我在其中一个解决方案中提到了这一点.我还在TD元素中插入了'line-height:0; font-size:0'样式,在图像本身中插入了'display:block'样式,同样是所有建议的解决方法.这些都没有产生任何影响.

此问题不会出现在任何其他电子邮件客户端或浏览器中.

请帮忙!

html email outlook outlook-2007 outlook-2010

3
推荐指数
1
解决办法
1万
查看次数

Outlook筛选项 - 获取一周范围内的所有定期约会

我试图在周范围内获得所有约会,但重复出现的约会没有出现.

这是代码:

    var outlook = new Microsoft.Office.Interop.Outlook.Application();
    var calendar = outlook.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar);
    calendar.Items.IncludeRecurrences = true;

    string filter = String.Format("[Start] >= {0} And [End] < {1}",
            DateTime.Now.Date.ToString("ddddd h:nn AMPM"),
            DateTime.Now.Date.AddDays(5).ToString("ddddd h:nn AMPM"));
    Outlook.AppointmentItem appointment;
    foreach (var item in calendar.Items.Restrict(filter))
    {
        appointment = item as Outlook.AppointmentItem;
        if (appointment != null)
        {
            MessageBox.Show(appointment.Start.ToString());
        }
    }
Run Code Online (Sandbox Code Playgroud)

如何获取Outlook中显示的所有定期约会一周?

c# office-interop outlook-2010

3
推荐指数
1
解决办法
5066
查看次数

Outlook 2010 DragDrop Bug

我有一个Outlook 2010 Add-In当用户拖动并在下降电子邮件TreeViewListView.要获取这些电子邮件,我使用以下代码:

Outlook._Application myOlApp = new Outlook.ApplicationClass();
Outlook.Selection droppedMails = myOlApp.ActiveExplorer().Selection;
Run Code Online (Sandbox Code Playgroud)

问题是如果用户选择三个电子邮件,则lostMails将有三封电子邮件,但在第一次选择之后如果他选择一封,则lostMails将为四封.

我的问题是为什么myOlApp.ActiveExplorer().选择不是第二次清除?我必须发布Outlook对象吗?

编辑:

Outlook中的电子邮件预览也停止工作.因此,拖放后每个选定的电子邮件都不会更改预览.

当用户单击Outlook中的另一个文件夹时,问题将得到解决.

感谢您的时间.

c# outlook-addin outlook-2010

3
推荐指数
1
解决办法
988
查看次数

无法将功能区控件添加到Outlook 2010 Addin

在学习使用我的Outlook插件(VS2010)中的功能区UI时,我删除并添加了多次功能区项目.从昨天开始,当我添加一个功能区项目时,一些自动生成的代码没有编译.

partial class ThisRibbonCollection
{
    internal MyRibbon MyRibbon
    {
        get { return this.GetRibbon<MyRibbon>(); }
    }
}
Run Code Online (Sandbox Code Playgroud)

抛出的错误是

'MyAddin.ThisRibbonCollection'不包含'GetRibbon'的定义,并且没有扩展方法'GetRibbon'接受类型'MyAddin.ThisRibbonCollection'的第一个参数可以找到(你是否缺少using指令或汇编引用?)

所以,为了摆脱这个,我注释掉了代码块并编译了它.现在,我面临的问题是我无法通过此处提到的Globals对象访问功能区.在运行时访问Ribbon.我尝试"grepping"整个解决方案的特定于功能区的代码并删除它们并尝试添加功能区项目,但问题仍然存在.

我可以从我的功能区上的控件访问我的插件,但反过来没有发生.

c# vsto ribbon visual-studio-2010 outlook-2010

3
推荐指数
2
解决办法
2749
查看次数

C# Outlook 2010 插件 - AppointmentItem.ItemProperties.Add Exception

我正在开发一个 Outlook 加载项,该加载项将表单区域添加到 IPM.Appointment 消息类。当显示该区域时,它首先会向 AppointmentItem 添加一些属性。

Outlook.AppointmentItem appItem;

private void FormRegion_FormRegionShowing(object sender, System.EventArgs e)
{
    try
    {
        appItem = (Outlook.AppointmentItem)this.OutlookItem;

        appItem.ItemProperties.Add("CustomProperty", Outlook.OlUserPropertyType.olText);
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.ToString());
    }
}
Run Code Online (Sandbox Code Playgroud)

这在我的日历上运行良好,但如果我尝试将插件与我具有编辑者或所有者访问权限的委托日历一起使用,则会引发以下异常:

System.UnauthorizedAccessException: You don't have appropriate permission to perform this operation.
  at Microsoft.Office.Interop.Outlook.Itemproperties.Add(String Name, OlUserPropertType Type, ObjectAddToFolderFields, Object DisplayFormat)
  at ThisAddin.FormRegion.FormRegion_FormRegionShowing(Ovject sender,EventArgs e)
Run Code Online (Sandbox Code Playgroud)

感谢任何和所有的帮助!

c# vsto outlook-addin outlook-2010

3
推荐指数
1
解决办法
1422
查看次数

将邮件状态更改为"读入Outlook"

我编写了一个代码,可以从Outlook 2010中读取所有未读邮件并将其写入文件中.之后我想改变邮件的状态为Read in outlook.

我该怎么做?

我正在使用Interop访问邮件.

        Microsoft.Office.Interop.Outlook.Application app = null;
        Microsoft.Office.Interop.Outlook._NameSpace ns = null;
        Microsoft.Office.Interop.Outlook.MailItem item = null;
        Microsoft.Office.Interop.Outlook.MAPIFolder inboxFolder = null;
        Microsoft.Office.Interop.Outlook.Items unreadItems = null;

        app = new Microsoft.Office.Interop.Outlook.Application();//.CreateItem(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);

        ns = app.GetNamespace("MAPI");

        inboxFolder = ns.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);

        unreadItems = inboxFolder.Items.Restrict("[Unread]=true");
Run Code Online (Sandbox Code Playgroud)

c# outlook office-interop outlook-2010

3
推荐指数
1
解决办法
7491
查看次数

Outlook 2010 HTML电子邮件中链接的背景颜色

此链接中的背景颜色(红色)仅应用于文本,而不是整个链接.

该链接也有填充.

这适用于Outlook 2010.

有谁知道如何让背景颜色填充链接?

这是一张图片:

Windows上的Outlook 2010

<a href="#" class="btn" style="font-size: 13px; border: 1px solid #c5c4c4; color: #3c3c3c; padding: 7px 25px; display: inline-block; border-radius: 5px; font-weight: bold; text-decoration: none; background-color: red; background: -moz-linear-gradient(top,  #ffffff 0%, #e5e5e5 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5)); background: -webkit-linear-gradient(top,  #ffffff 0%,#e5e5e5 100%); background: -o-linear-gradient(top,  #ffffff 0%,#e5e5e5 100%); background: -ms-linear-gradient(top,  #ffffff 0%,#e5e5e5 100%); background: linear-gradient(to bottom,  #ffffff 0%,#e5e5e5 100%);">
  Accept
</a>
Run Code Online (Sandbox Code Playgroud)

这是可读格式的css:

font-size: 13px;
border: 1px solid #c5c4c4;
color: #3c3c3c;
padding: 7px 25px;
display: …
Run Code Online (Sandbox Code Playgroud)

html css html-email outlook-2010

3
推荐指数
1
解决办法
2517
查看次数

如何在Outlook 2010中更改所有假期的颜色?

我通过添加我的国定假日

Outlook -> Options -> Calendar -> Calendar options -> Add holidays

现在,我想一次更改所有假期的颜色。有任何想法吗?

outlook outlook-2010

3
推荐指数
1
解决办法
8054
查看次数

如何在Outlook(2010)全局地址列表中搜索名称?

我有一个名单,其中一些是完整的,一些是截断的.我想在Outlook地址列表中搜索这些名称的匹配项.

我最接近的是这个来自ActiveState Code的 Python代码,但是它不搜索全局地址,只搜索我的(本地?)列表,其中有3个地址,这显然是不对的.应该有成千上万的记录.

任何提示欢迎.我用Google搜索并阅读了几十页,但没有结论.我宁愿不直接连接到LDAP,我认为这是我的组织中的政策违规,除此之外我不确定是否可能.如果可能,希望通过Outlook API执行此操作.

DEBUG=1

class MSOutlook:
    def __init__(self):
        self.outlookFound = 0
        try:
            self.oOutlookApp = \
                win32com.client.gencache.EnsureDispatch("Outlook.Application")
            self.outlookFound = 1
        except:
            print("MSOutlook: unable to load Outlook")

        self.records = []


    def loadContacts(self, keys=None):
        if not self.outlookFound:
            return

        # this should use more try/except blocks or nested blocks
        onMAPI = self.oOutlookApp.GetNamespace("MAPI")
        ofContacts = \
            onMAPI.GetDefaultFolder(win32com.client.constants.olFolderContacts)

        if DEBUG:
            print("number of contacts:", len(ofContacts.Items))

        for oc in range(len(ofContacts.Items)):
            contact = ofContacts.Items.Item(oc + 1)
            if contact.Class == win32com.client.constants.olContact:
                if keys is None:
                    # …
Run Code Online (Sandbox Code Playgroud)

python perl outlook vba outlook-2010

3
推荐指数
2
解决办法
3365
查看次数