[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

NotesDocument->Remove(), then dies

Sorry - this is in perl.  I don't know vb.

I spinning thru the documents in my inbox.  I've cut out all but the
problem, which is, I remove an unwanted document and the
program dies.  Can you delete a document within an enumeration?
If not, how?  Tag it?  I'll build an array of documents to delete.  Great, if
it works, but still curious about this attempt to delete/remove here.

New to notes.  Any suggestions helpful.

Thanks

while ($MDoc=$mailvw->GetNextDocument($MDoc)) {
  getDoc($MDoc);
}

# ------------------------------------------------------------------------
sub getDoc {
  my $doc = shift;
  $doc->Remove(1);
}

0
hank1
Asked:
hank1
1 Solution
 
Bozzie4Commented:
Problem is you delete $MDoc, and then want to use in to Getnextdocument.

You can solve this by already fetching the next document BEFORE you delete the current document.

cheers,

Tom
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now