Solved

Launching a attachment using LS

Posted on 2004-08-17
10
253 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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
 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

813 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

10 Experts available now in Live!

Get 1:1 Help Now