Solved

check attachment name

Posted on 2001-06-07
3
192 Views
Last Modified: 2013-12-18
Hi,

the following codes check the filename of attachments.
It always returns me the first filename. The no. of times it is printed tallies with the no. of attachments. However, if I close the current document, re-open it and run the same codes, it returns me the correct filenames.

It works the same if I save the current doc instead of creating a temporary document.

Is this got to do with Notes itself?

Thanks.
   

  'Check filename attached
     Set tmpdoc = New notesdocument(db)
     Call doc.Copyallitems(tmpdoc, True)
     tmpdoc.Form = "TEMP"
     Call tmpdoc.save(True, True) 'create temporary doc to check attachments
     
     If Not (tmpdoc Is Nothing) Then
          Forall attmt In tmpdoc.Items
               If attmt.Name = "$FILE" Then
                    Print attmt.values(0)
               End If
          End Forall
     End If
0
Comment
Question by:PinkDolphin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6166644
You code should be :
Forall attmt in doc.EmbeddedObjects
   Print attmt.name
End Forall

This code will run through all attachments in the current document (I suppose doc refers to the original document in your code) and print theire respective names.

Regards,

Jean Marie
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 50 total points
ID: 6167732
Jerrith, Even in your case the doc has to be saved as the embeddedobjects is realized only when the doc is saved.

PinkDolphin,
Use Jerrith's method to access the attachments, Anyway you have to save the document to access the attachments in your doc. This is notes limitation.

~Hemanth
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6167758
Ah yes, I thought he was referring to an existing document, not a newly created one.
My bad, thanks for the correction Hemanth.

So for a complete code this would be :
'First save the document to actually create the attachments
call doc.Save(True,False)
'Now walk through all attachments to get the names
Forall attmt in doc.EmbeddedObjects
  Print attmt.name
End Forall
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question