在Lotus Notes文档中创建字段? [英] creating fields in lotus notes document?

查看:125
本文介绍了在Lotus Notes文档中创建字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将访问数据库中的项目导出到Lotus Notes中.我要导出到的文档是固定的,并且已将所有数据写入其中,我只需要以某种方式标记占位符,然后更新值即可.我已经阅读了文档,看来我将需要处理字段,然后调用一个方法来替换文本,如下所示:

I am trying to export items from my access database into lotus notes. The document I am trying to export to is a stationary, and has all the data written into it, I just need to somehow mark placeholders and then update the values. I have read the documentation and it appears I will need to address fields and then call a method to replace the text like so:

'where body is the field and the following string is what to replace field with
Call doc.ReplaceItemValue("body", "REPLACE BODY")

要清楚,我的整个代码如下:

To be clear, my entire code looks like:

Set session = CreateObject("Notes.NotesSession")
Set maildb = session.GetDatabase("server", "mail\box.nsf")

Set View = maildb.GetView("Stationery")
Set entries = View.AllEntries

Set entry = entries.GetFirstEntry

Set doc = entry.Document

Call doc.ReplaceItemValue("Subject", "Report - " & Date)
'add code here
Call doc.send(False, "person.to.receive@thisemail.com")


End Sub

我注意到在阅读文档时,似乎可以创建字段,然后处理这些字段以更新值.因此,例如,如果我有一个名为$ COST的字段,则可以这样做:

I have noticed that while perusing documentation, there seems to be an ability to create fields, and then address those fields to update values. So for example, if I have a field named $COST, then one could do:

Call doc.ReplaceItemValue("$COST", "The cost is $3000")

该字段应该更新以反映我通过该方法传递的值.我的大问题是,即使浏览文档,也无法弄清楚需要在自定义字段中添加的位置.看来该文档假定您知道如何创建这些字段并解决它们.还是只应该以编程方式创建这些字段,然后填写数据?我的客户是Lotus Notes8.谢谢!

And that field should be updated to reflect the value I passed through the method. My big problem is, even looking through documentation, I cannot figure out where I need to go to add in my custom fields. It seems that the documentation assumes that you know how to create these fields and just address them. Or am I only supposed to create these fields programatically and then fill in the data? My client is Lotus Notes 8. Thanks!

推荐答案

是的,关于IBM Lotus Notes数据库,这很酷:您可以将项目(=字段)放在Notes文档中,而无需事先定义字段.

Yes, that is the cool thing about IBM Lotus Notes databases: you can put items (=fields) in a Notes document without a prior definition of fields.

如果使用doc.ReplaceItemValue()在文档中创建项目并保存或发送文档,则这些项目就在那里.当您打开选定文档的属性框时,您可以检查项目.所有项目均列在文档属性的第二个选项卡上.

If you create items in a document with doc.ReplaceItemValue() and save or send the document then the items are just there. You can check the items when you open the property box for a selected document. All items are listed on document properties' second tab.

当然,另一个问题是在表单中定义字段,以便用户可以看到创建的项目,而无需查看文档属性框.在Designer中打开数据库,并将字段放在正确的位置和大小以形成表单.

Another question is of course to define fields in a form so that the created items are visible to user without looking at document properties box. Open database in Designer and put the fields in right position and size to form.

您的问题和评论,告诉您您要创建一个文档,将其填充数据并将其发送给用户.

Your question and comments telling that you want to create a document, fill it with data and send it to users.

如果所有用户都可以访问Notes服务器,则可以在现有数据库中创建该文档,并仅向用户发送链接邮件.这样,您可以创建一个美观的表单并放置所有数据字段.用户将通过链接访问数据库中的文档.

If all users have access to your Notes server then you can create that document in your existing database and send just a link mail to users. This way you can create a good looking form and position all your data fields. Users will access the document in database through link.

另一种方法是创建一个外观漂亮的HTML文件,将其附加到邮件中并发送. 在这种情况下,您可以将此代码添加到示例中的'add code here:

An alternative is to create an nice looking HTML file, attach it to the mail and send it. In this case you would add this code to your example at 'add code here:

Call doc.RemoveItem("Body")
Set rtitem = doc.CreateRichTextItem( "Body" )
Call rtitem.AppendText("your mail text")
Call rtitem.EmbedObject(EMBED_ATTACHMENT, "", "report.html")

这篇关于在Lotus Notes文档中创建字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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