Help Please: EM_NIFOPENCOLLECTION and changing ViewIcons

This is a discussion on Help Please: EM_NIFOPENCOLLECTION and changing ViewIcons within the lotus-notes-programmer forums in Other Technologies category; Hi, I'm a newbie at Notes. I'm trying to duplicate a mail solution from another program. I'm using the Lotus C-API, I've set up a EM_NIFOPENCOLLECTION notification. I can see the program trying to open the ($Inbox). I grab the hUnreadList, walk through the list and determine if I want to take special action on any of the new unread mail messages. I use IDScan to get the NoteID from the list, and then open the note using NSFNoteOpenExt(hDB,noteID,OPEN_RAW_MIME_PART|OPEN_ NOVERIFYDEFAULT,&nhNote). I want to read MIME_PART info if it is ...

Go Back   Database Forum > Other Technologies > lotus-notes-programmer

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 02-11-2004, 02:59 PM
Default Help Please: EM_NIFOPENCOLLECTION and changing ViewIcons

Hi, I'm a newbie at Notes. I'm trying to duplicate a mail solution from
another program.
I'm using the Lotus C-API, I've set up a EM_NIFOPENCOLLECTION notification.
I can see the program trying to open the ($Inbox). I grab the hUnreadList,
walk through the list and determine if I want to take special action on any
of the new unread mail messages.

I use IDScan to get the NoteID from the list, and then open the note using
NSFNoteOpenExt(hDB,noteID,OPEN_RAW_MIME_PART|OPEN_ NOVERIFYDEFAULT,&nhNote).
I want to read MIME_PART info if it is available instead of going through
TYPE_COMPOSITE records. I then close the note. If I am interested in this
note, I reopen the note using
NSFNoteOpenExt(hDB,noteID,OPEN_SUMMARY|OPEN_NOVERI FYDEFAULT,&nhNote); to get
the SummaryInfo fields.

At first, I tried setting the MAIL_VIEWICON_ITEM (aka "_ViewIcon") to the
number I wanted (using NSFNoteSetNumber).This changed the icon next to the
subject(colum $97), not on the left of the mail view where I wanted it
(colum $83), but also not the icon I wanted. Also, the body of the email
went missing since it seemed to no longer consider the note a mail format
note.

I tried setting the MAIL_VIEWICON2_ITEM (aka "_ViewIcon2") to the number
icon I wanted (using NSFNoteSetNumber). This also seemed to change the icon
next to the subject(colum $97), not on the left of the mail view (colum
$83) and the icon was not the one I wanted. Also, the body of the email went
missing since it seemed to no longer consider the note a mail format note.
(BTW, I tried this with new mail messages each time, rather than reopening
ones I had previously touched).

I finally found the view using Designer - Folders\($Inbox), and saw there is
a formula determining what icons are displayed in the column. I saw
reference to a tmpIcon, so I tried setting that in my code. It did indeed
set an icon in the left colum (the second position); however, the icon next
to the subject was still changed and the mail body was missing.

So, I tried changing the formula, by checking for the existance of my own
summary field.
This seems to put the icon in the left column where I want it; however, the
right icon column still is changed, and the body of the email message is
missing. BTW, I'll paste the existing formulas at the end of this message -
perhaps you can see something I missed.

I suspect that the act of opening the note in SUMMARY mode, and adding my
own flag is changing the message type in ways I haven't found yet. Does
anybody have any working code that adds an icon to the inbox view
successfully? Can anyone see anything I'm doing incorrectly? Is there a
better easier way? Also, if I do have to change the column formulas, does
anyone have any code examples showing how to do this programatically?

Thanks,
Scott

Colum $83 Formula:
REM {This icon formula is used in ($Inbox) folder, (MailThreads) view, and
($All) view};

CSisPrivate := @If(@IsUnavailable($PublicAccess) &
@IsAvailable($CSVersion);"1";"0");
isImportant := @If(Importance="1";"1";"0");

ViewIcon2 := @If(_ViewIcon = 158 & AppointmentType != "1" & BookFreeTime =
"1"; 12; _ViewIcon);


tmpIcon := @If(ExpireDate !="" ;64;displaycopyto_icon = "1";"sentto.gif";
@If(DeliveredDate = "";
@If(PostedDate="" | @IsUnavailable(PostedDate);
@If(@IsAvailable(IsMailStationery);
21;
@IsAvailable(_ViewIcon);
ViewIcon2;
58);
@If(IsImportant="1";
124;
122));
@IsAvailable(_ViewIcon);
ViewIcon2;
$TypeIcon));

REM; "If the Task has no icon, display the invitation icon - backward
compatibility";
varTaskIcon := @If(Form = "Task" & (!@IsAvailable(_ViewIcon) | ViewIcon2 =
"") & (!@IsAvailable(_ViewIcon2) | ViewIcon2 = ""); @False; @True);

iconOne := @If(!varTaskIcon; 133; @If(tmpIcon = ""; 0; tmpIcon));
iconTwo := @If(iconOne=124;0;CSisPrivate="1"; 164; isImportant="1"; 150;
0);

@If(@IsAvailable(MYICON):icon1="62":0);
iconOne:iconTwo

Column $97 formula:
@If(@TextToNumber(@Version) > 122;

@If(@IsAvailable(_ViewIcon2); _ViewIcon2;

@Contains(@LowerCase(@AttachmentNames) ; "smime.p7s")&
@IsAvailable($NoteHasNativeMime) & $NoteHasNativeMime="1";
12;

@Contains(@LowerCase(@AttachmentNames); "smime.p7m")&
@IsAvailable($NoteHasNativeMime) & $NoteHasNativeMime="1";
61;

@IsDocTruncated;
30;
@IsAvailable($ContentIcon);
$ContentIcon;
(@Contains(@LowerCase(From); " pager ") | @Contains(@LowerCase(SendTo);
" pager "));
46;
@Attachments;
@If(@Contains(@LowerCase(@AttachmentNames); "message.wav" :
"vmsg_hdr.wav");
44;
@Contains(@LowerCase(@AttachmentNames); ".wav");
15;
@Contains(@LowerCase(@AttachmentNames); ".tif");
47;
5);
0);
@IsAvailable($ContentIcon); $ContentIcon; @Attachments; 5; 0)


Reply With Quote
  #2  
Old 02-11-2004, 03:39 PM
Default Re: Help Please: EM_NIFOPENCOLLECTION and changing ViewIcons


"Scott" wrote in message
news:FXuWb.897$Le2.715-at-twister.socal.rr.com...

>>If I am interested in this note, I reopen the note using NSFNoteOpenExt
>>(hDB,noteID,OPEN_SUMMARY|OPEN_NOVERIFYDEFAULT,&nhNote);
>>to get the SummaryInfo fields.


I've confirmed that opening the summary info, and then updating the note is
causing the change in the right column icon and the loss of the email body.


Reply With Quote
  #3  
Old 02-11-2004, 05:46 PM
Default Re: Help Please: EM_NIFOPENCOLLECTION and changing ViewIcons


"Scott" wrote in message
news:FXuWb.897$Le2.715-at-twister.socal.rr.com...
> Hi, I'm a newbie at Notes. I'm trying to duplicate a mail solution from
> another program.


Wow, talk about newbie. I found all I had to do was modify the formula in
the Folder\($Inbox) view for the column. I added the following to the
folder:

iconTwo:=@If( @Contains($BODY;"[MYSTRING");iconTwo; 44);


Reply With Quote
  #4  
Old 02-12-2004, 05:36 AM
Default Re: Help Please: EM_NIFOPENCOLLECTION and changing ViewIcons

The formula always failed, so it took the FALSE value of the IF statement
and always gave me my iocn. My Bad. Back to the drawing board.

"Scott" wrote in message
news:RoxWb.3239$jf.2918-at-twister.socal.rr.com...
>
> "Scott" wrote in message
> news:FXuWb.897$Le2.715-at-twister.socal.rr.com...
> > Hi, I'm a newbie at Notes. I'm trying to duplicate a mail solution from
> > another program.

>
> Wow, talk about newbie. I found all I had to do was modify the formula in
> the Folder\($Inbox) view for the column. I added the following to the
> folder:
>
> iconTwo:=@If( @Contains($BODY;"[MYSTRING");iconTwo; 44);
>
>



Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 08:31 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Integrated by bbpixel2009 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.