Highlighted
Trey Thrasher
New Member.
44 views

Is there a way to loop through all open emails using C3PO or tokens?

I am writing a c3po application.  I want to be able to close an email and reply all to it.  I am having trouble because the token ItemReply does not work properly when All! and a MessageID. are in its parameters.  It will work properly if the MessageID parameter is left off but that will only reply to the currently open item. 

As a work around, I am trying to see if there is a way to loop through all open emails until I find the messageId that I am looking for so that I can use ItemReply without the messageid since it will be the currently open email.

 

The code that I am currently using to close the message and reply all are below:

procedure TInsertEmailForm.CloseCurrentWindow;
var
  vCommander: Variant;
  sResult, ReStr: AnsiString;
begin
  vCommander := CreateOleObject('GroupWiseCommander');
  vCommander.Execute(AnsiString('ItemMessageIDfromView()'), sResult);
  if sResult = MessageID then
    vCommander.Execute(AnsiString('CloseWindow()'), ReStr);
  vCommander := Unassigned;
end;
procedure TInsertEmailForm.ReplyAll;
var
  vCommander: Variant;
  sResult, ReStr: AnsiString;
begin
  vCommander := CreateOleObject('GroupWiseCommander');
  try
    vCommander.Execute(AnsiString('ItemMessageIDfromView()'), sResult);
    if sResult = MessageID then
      vCommander.Execute(AnsiString('ItemReplyOpenItem(All!;1)'), ReStr)   // this works
    else
      vCommander.Execute(AnsiString('ItemReply(All!;1;"' + MessageID +
        '")'), ReStr);  // this does not work
  except // ignore exception
  end;
  vCommander := Unassigned;
end;

 

Labels (3)
0 Likes
1 Reply
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Re: Is there a way to loop through all open emails using C3PO or tokens?

Sorry, I just passed this question on to the group responsible for the C3PO code without looking at the question. We are busy getting a release ready. It may be some time before they can answer the question. Just looking at the question, it would be better to figure out the problem with calling ItemReply(). It would probably be a problem with the formatting of your arguments. It looks like using ItemOpen() would be preferable to looping through the items.

Preston

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.