Preeti
Preeti

Reputation: 1386

How to get "Data Type" value of Body of a Lotus Notes Item using .NET?

I am trying to get Data Type (Body Format) of Mail,Calendar e.t.c. Body.

Getting Body content as:

String Body = (string)((object[])docInbox.GetItemValue("Body"))[0];

or

String Body = docInbox.GetFirstItem("Body").Text;

I tried it using:

String bodyFormat = ((object[])docInbox.GetItemValue("Body"))[0].GetType().ToString();

But in this case i am getting "System.String" value.But actually it is : "Rich Text".

Upvotes: 0

Views: 2900

Answers (4)

Ed Schembor
Ed Schembor

Reputation: 8560

If you are trying to get the Notes data type of the "Body" item, you can use the Type property of the NotesItem class. For example:

...
dim itemBody as notesItem, nType as integer
set itemBody = doc.getItem ("Body")
nType = itemBody.Type
...

RichText is 1, Text is 1280, Numeric is 768, etc. Domino Designer Help has the full list of values.

EDIT: You can find the full list of Type values here:

Upvotes: 2

Carlos
Carlos

Reputation: 1806

Try:

NotesRichTextItem rtItem = docInbox.GetFirstItem("Body")

String body = rtItem.GetFormattedText(False, 0)

or

String body = rtItem.GetUnformattedText()

Upvotes: 2

user170442
user170442

Reputation:

You have to look for You item in Items collection and then You can do

docInbox.Items[foundBodyItemIndex].Type

RichText has "1"

Upvotes: 0

Jan Jongboom
Jan Jongboom

Reputation: 27342

You're now getting the value through GetItemValue("Body"). Isn't there a method like

GetItem("Body")

which contains this information?

Upvotes: 0

Related Questions