This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
(ok, that was wierd, forum just posted when I clicked outside the entry box.)
If you're completely new to Notes, you'll need to go through a short tutorial on how to get a list of whatever databases, then docs you want to get at. There're a dozen different ways to do this. But maybe you just want to scan through the "($All)" NotesView in the mailbox.
There're also about a half-dozen ways to get the attachments, and then list their sizes.
In 8.5 for a mailbox, there's a fast way that requires thought, and there are many slow ways to get at this data. At this point you can load all the docs in the "($All)" view one by one, check off all the $File fields, and get their sizes, and just run through the entire store to make sure you've got the biggest attachment.
For lots of mail dbs, your progress will be kind of slow though.
8.5 does have the ability to re-sort the NotesView by descending size, though. So you could do that, then run through only the documents that are larger than the largest attachment you've found, and "break out" early when you see the doc size slip below the largest attachment size you've found.
Here're some pointers, bits & pieces of code you'll need to scan one database. This isn't intended to be complete code:
dim maxattach as long
dim result as variant
dim db as New NotesDatabase("server", "mail\maildb.nsf")
dim vw as NotesView
if not db.isOpen then
MsgBox "Couldn't open DB"
exit sub
end if
set vw = db.GetView("($All)")
if vw is nothing then exit sub
'sorting the view by the size column requires finding the column's **internal name**, in Designer it's the name on the last tab of the "size" column property, which is normally some number preceded with a "$" sign: "$nn"
'vw.resortview "$nn", False
'the business end: search through the docs looking for the largest attachment
set doc = vw.GetFirstDocument
do while not doc is nothing
'if you can sort the view by the size column, you can break out early
'if maxattach > doc.Size then exit do
result = Evaluate("@AttachmentLengths", doc)
if Cstr(result(0)) <> "" then
forall rr in result
if rr > maxattach then maxattach = rr
end forall
end if
set doc = vw.GetNextDocument(doc)
loop
Print "Largest attachment: " & maxattach
Feedback response number WEBBA6SP3N created by ~Sigmund Umwemanoni on 02/03/2016