Lotus Notes从文档中获取附件名称 [英] Lotus notes get attachment names from document

查看:849
本文介绍了Lotus Notes从文档中获取附件名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Notes 8.5.2开发一个Lotus Notes插件,用于将附件从eMail保存到Harddisk。但是当我尝试从Notes文档中读取附件名称时,我总是得到包含第一个附件名称+一些垃圾数据的相同字符串。

I'm developing an Lotus Notes plug-in for Notes 8.5.2 that saves the attachments from an eMail to the Harddisk. But when I try to read the attachment names from a Notes document I always get the same string containing the first attachment name + some junk data.

protected Vector<String> getAttachmentNames() throws NotesException,
        IOException {
    Vector<String> attachmentNames = new Vector<String>();
    Item item = null;
    Enumeration<?> itemsEnum = mailDoc.getItems().elements();
    while (itemsEnum.hasMoreElements()) {
        item = (Item) itemsEnum.nextElement();
        if (item.getType() == Item.ATTACHMENT) {
            attachmentNames.add(getAttachmentNameOf(item));
        }
    }
    return attachmentNames;
}

protected String getAttachmentNameOf(Item item) throws NotesException,
        IOException {
    return getAttachmentName(item.getValueString());
}

getAttachmentName只进行一些字符串格式化以生成唯一的文件名。

getAttachmentName only does some string formatting to generate a unique filename.

推荐答案

需要注意的事项。 MIME附件并不总是被识别为文档附件。因此,虽然您可以在Notes客户端中看到它,但您将无法以编程方式访问它。

Something to be aware of. MIME attachments are not always recognized as document attachments. So while you can see it in the notes client, you will not be able to programmatically access it.

以下技术说明详细介绍了它以及如何解决它。

The following tech note details it more and how to resolve it.

http://www-01.ibm.com/support/docview.wss? rs = 463& uid = swg21219985

这篇关于Lotus Notes从文档中获取附件名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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