Solved

Launching a attachment using LS

Posted on 2004-08-17
10
249 Views
Last Modified: 2013-12-18
Hi all,

I like to launch a attachment using LS! I want to launch the attachment from a view (the document that is selected)

Is there a way to do this ?

Greetings,

Bob
0
Comment
Question by:oosterbaan
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 19

Expert Comment

by:madheeswar
ID: 11818827
in form properties, there is auto launch attachments.
Select that property.
And in action button in View,
@Command([EditDocument])

and in form postopen,
Source.close
0
 
LVL 1

Author Comment

by:oosterbaan
ID: 11819111
Hi madheeswar,

Thx for your comment!

Hmmm....this is a nice idea, but the user will not be able to open the document whitout starting the attachment!
Isn't there a way to start the attachment from the harddrive? You can then detach the file in a temp folder and then start it?

Greetings,

Bob
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 11821228
Is the name of the attachment fixed in all the cases?
Is this a normal memo? Or based on some other form?
How was the document attached? Is it embedded in a RT field?
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 11821434
Okay, assume that it is a normal memo. How would u detach and launch attachments? Here is the code. Put it in an agent and then u r ready to go.




Sub Initialize
      Dim SN As NotesSession
      Dim DB As NotesDatabase
      Dim DC As NotesDocument
      
      Set SN = New NotesSession
      Set DC = SN.DocumentContext
      
      Dim rtitem As Variant
      Set rtitem = DC.GetFirstItem( "Body" )
      If ( rtitem.Type = RICHTEXT ) Then
            Forall o In rtitem.EmbeddedObjects
                  Call o.ExtractFile ("c:\temp\" + "give_a_name_here")
            End Forall
      End If
End Sub


0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 19

Accepted Solution

by:
RanjeetRain earned 63 total points
ID: 11821520
And if they are not embedded in a RT field, rather directly attached, you may use the GetAttachment method of NotesDocument class to get to the attachment. Here is the sample code:




Sub Initialize
      Dim SN As NotesSession
      Dim DB As NotesDatabase
      Dim DC As NotesDocument
      
      Set SN = New NotesSession
      Set DC = SN.DocumentContext
      
      Dim object As NotesEmbeddedObject
      Set object = DC.GetAttachment("attachment_file_name")
      If (Not object Is Nothing) Then
            ' Detach and Launch the object as shown above
      End If
End Sub


0
 
LVL 31

Assisted Solution

by:qwaletee
qwaletee earned 62 total points
ID: 11823356
I've provided solutions for this in teh past on this site.  You would need an action button on the view that when clicked, accesses the highlighted document, finds any attachments, gives an error if there are none or if there is more than one.

If there is only one, it should detach the file and use the shell function to "call" that file from the OS, which is (hopefully) configured to support the file's extension.

The tricky things I set up were:

1) Detaching the file to a location the user has privileges to (you can't just assume a particular folder if different PC's are set up differently or your Windows admins have locked down access to certain directories).

2) Handling conflicting file names

3) Cleaning up after yourself -- you don't want the file staying there forever!
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 13004819
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 13004848
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    Split: RanjeetRain {http:#11821520} & qwaletee {http:#11823356}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Zvonko
EE Cleanup Volunteer
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 13009182
Zvonko,

A cleanup volunteer providing solutions as well?  Cute!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now