Tuesday, 3 September 2013

creating fields in lotus notes document?

creating fields in lotus notes document?

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
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 I could do:
Call doc.ReplaceItemValue("$COST", "The cost is $3000")
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!

No comments:

Post a Comment