Solved

Launching a attachment using LS

Posted on 2004-08-17
10
250 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
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.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

22 Experts available now in Live!

Get 1:1 Help Now