Skip to main content link. Accesskey S
  • Anonymous
  • Log on
  • Help
  • IBM logo
  • Lotus Notes and Domino Application Development wiki
  • All Wikis
  • Home
  • Community Articles
  • Product Documentation
  • Learning Center


Search

Advanced Search

Categories

Tag Cloud

  • 6.0
  • 6.5
  • 8.0
  • 8.5
  • 8.5.1
  • 8.5.2
  • 8.5.3
  • action bar
  • Agents
  • Ajax
  • app dev
  • Application
  • beginner
  • C&S
  • calendaring and scheduling
  • client
  • composite applications
  • Controls
  • converters
  • css
  • Custom controls
  • Data Binding
  • db2
  • design elements
  • dialog boxes
  • Documents
  • Dojo
  • Domino
  • Domino Designer
  • Domino Designer 8.5
  • DXL
  • Eclipse
  • error handling
  • errors
  • extensions
  • FAQ
  • Forms
  • formulas
  • getting started
  • globalization
  • Help
  • html
  • Installation
  • interface
  • internationalization
  • iPhone
  • Java
  • JavaScript
  • localization
  • Lotus Domino Designer
  • LotusScript
  • LotusSphere
  • LotusTechInfo
  • menu bar
  • Mobile
  • new user
  • Notes
  • Notes 8
  • notes.ini
  • NSD
  • OpenNTF
  • partial update
  • performance
  • Pickers
  • Portal
  • presentations
  • programming
  • Redbooks
  • Requested Articles
  • roadmap
  • rooms and resources
  • samples
  • Scripting
  • security
  • tabs
  • templates
  • themes
  • Tips
  • toolbar
  • troubleshooting
  • tutorials
  • validation
  • variables
  • video
  • VideoFest
  • View
  • view control
  • ViewPanel
  • Views
  • web
  • Web apps
  • Web services
  • webdev
  • XML
  • Xpage
  • XPages
  • XPages Extensibility API
  • xsp-config
  • データソース
  • 九州地区ノーツパートナー会
InformationInformation
You are currently viewing machine translated content. IBM translation might be available. Click IBM Translated Product Documentation to see what is available.X


Home > Demonstrations > Launching the first attachment of a document from a docLink
Rate this article 1 starRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Launching the first attachment of a document from a docLink 

expanded Abstract
collapsed Abstract
Simple way to have the attachment of a document be launched upon clicking a docLink.
Launching the first attachment of a document from a docLink
 
I had a request to send a docLink in an email message that when clicked would not just open the Lotus Notes document, but would rather open the first attachment stored in the document.
 
I knew I could do it with a url from the browser with something like this:
 
server/filepath/filename/view/docid/$file/filename?openelement
 
But I wasn't sure how to meet the requirement in the Notes client with a docLink.
 
I spoke with Chris Toohey and Jamie Magee and they both what I will discuss below, except both indicated that the url would work in the notes client use if you put Notes://server/filepath/filename/view/docid/$file/filename?openelement.
The idea worked, but I couldn't get the url to work. But a regular docLink worked which is better than a URL.
 
First create a form, call it (launcher) | launcher. The form does not need any fields on it. Set the Form Launch property>Auto Launch to First Attachment.
 
Then create a view, call it (fileLauncher) | fileLauncher. Put one column in the view. The formula for the column should be @Text(@documentUniqueId). Make sure the column is sorted.
 
In the Form Formula of the view, put "launcher".
 
To create a mail message with a docLink that launches the attachment, I then created an action button on the form where the attachments are stored with the following code:
 
Sub Click(Source As Button)
 Dim workspace As New NotesUIWorkspace
 Dim uiDoc As NotesUidocument
 Dim doc As NotesDocument
 Dim session As New NotesSession
 Dim db As NotesDatabase
 Dim view As NotesView
 Dim launcherDoc As NotesDocument
 Dim memo As NotesDocument
 Dim rtitem As NotesRichTextItem
 
 Set uidoc = workspace.currentdocument
 Set doc = uidoc.document
 
 Set db = session.currentdatabase
 Set view = db.getview("fileLauncher")
 Set launcherDoc = view.GetDocumentByKey(doc.UniversalID)
 If launcherDoc Is Nothing Then
 Else
  Set memo = db.CreateDocument
  Set rtitem = New NotesRichTextItem(memo,"Body")
  Call rtitem.AppendDocLink(launcherDoc,"launch attachment")
  memo.sendto= "Betsy Thiede"
  Call memo.Send(False)
 End If
End Sub
 
When I received the mail message, and clicked on the docLink, the attachment opened up just like I wanted it to. Hooray.
 
If I just used the code listed below, the document opened, but not the attachment.
 
Sub Click(Source As Button)
    Dim workspace As New NotesUIWorkspace
    Dim uiDoc As NotesUidocument
    Dim doc As NotesDocument
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim view As NotesView
    Dim launcherDoc As NotesDocument
    Dim memo As NotesDocument
    Dim rtitem As NotesRichTextItem
 
    Set uidoc = workspace.currentdocument
    Set doc = uidoc.document
 
    Set db = session.currentdatabase
    Set memo = db.CreateDocument
    Set rtitem = New NotesRichTextItem(memo,"Body")
    Call rtitem.AppendDocLink(doc,"docLink")
     memo.sendto= "Betsy Thiede"
     Call memo.Send(False)

End Sub

expanded Article information
collapsed Article information
Category:
Demonstrations
Tags:

This Version: Version 1 March 29, 2010 10:04:47 AM by Betsy Thiede  

expanded Attachments (0)
collapsed Attachments (0)

 


expanded Versions (1)
collapsed Versions (1)
Version Comparison     
Version Date Changed by               Summary of changes
This version (1) Mar 29, 2010 10:04:47 AM Betsy Thiede  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedSubscribe to RSSHelpAbout
  • All Lotus and WebSphere Portal wikis
  • IBM developerWorks
  • IBM Software support
  • IBM Social Business User Experience Blog
  • IBMSocialBizUX on Twitter
  • IBMSocialBizUX on Facebook
  • Lotus product forums
  • IBM Social Business UX blog
  • IBM Collaboration Solutions
  • Recently added feedRecently added
  • Recently edited feedRecently edited
  • Recently added comments feedRecently Added Comments
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Contact IBM
  • IBM Terms of use
  • Wiki terms of use