Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

PreviousPrevious NextNext


Sue Z Sunshine 6.May.14 12:57 PM a Web browser
Notes Client 7.0.2 Windows XP


Users are getthing the error "A required argument has not been provided" when they try to use the NDL button on any document that has been archived. This works great for any other document not archived. I cannot find anywhere in the script that would prohibit use of the button when a document is archived. Any suggestions? Thanks!

Option Public
Option Explicit

'Generate .NDL files for attachment to email messages, for benefit of non-Notes Mail users
'Contains two subs:
' * NDLdoclink
' * NDLComposeBody
'
'Based on script posted on DANGsite:
' "Copyright 2004 DANGsite.com and pcorey.net All rights reserved."
' "Please feel free to use the code, but at least give reference to me (DANGsite.com) for code source."
'The resulting file will have extension .NDL and body as follows:
'<NDL>
'<REPLICA 9999999:9999999>
'<VIEW 9999999:9999999-9999999:9999999>
'<NOTE 9999999:9999999-9999999:9999999>
'<HINT>CN=MyServer/O=MyOrg</HINT>
'<REM>Database 'My database', View 'My View', Document 'My document'</REM>
'</NDL>
'
NDLComposeBody subroutine

Private m_filenumb As Integer
Private m_filenum As Integer
Sub NDLdoclinkToDesktop(db As NotesDatabase, doc As NotesDocument, Byval filename As String, Byval label As String)
'Generates .NDL doclink file for current doc and saves it to user's Windows desktop
'Document must have been saved prior to running this sub.
'Database must have an App Profile with an entry for the Enterprise Directory
'User must have an entry in Enterprise Directory with a valid Device ID.
'

Const openNDL = "<NDL>"
Const closeNDL = "</NDL>"
Const openHint = "<HINT>"
Const closeHint = "</HINT>"
Const leftopen = "<"
Const rightclose = ">"
Const openrem = "<REM>"
Const closerem = "</REM>"

Dim s As New NotesSession
Dim dbEDbook As NotesDatabase
Dim docEDbook As NotesDocument
Dim profDoc As NotesDocument
Dim v As NotesView
Dim strName As String
Dim strUserID As String
Dim fname As String
Dim path As String
Dim continue As Variant

'Retrieve the profile document and assign the Enterprise Directory assigned from profile document
Set profDoc = db.GetProfileDocument("frmAppProfile")
Set dbEDbook = s.GetDatabase(profDoc.ap_EDserver(0), profDoc.ap_EDfilepath(0))
Set v = dbEDbook.GetView( profDoc.ap_EDEmployeeOnlyView(0) )

strName = s.CommonUserName

Set docEDbook = v.GetDocumentByKey( strName )
If docEDbook Is Nothing Then
Messagebox "Unable to find desktop, so unable to create Notes Document Link at this time."
continue = False
Exit Sub
Else
strUserID = docEDbook.DeviceID(0)
path = "C:\Documents and Settings\" & strUserID & "\Desktop\" 'for NT
m_filenumb = 0
m_filenum% = Freefile()
fname = path & filename & "-" & m_filenumb
Open fname & ".NDL" For Output As m_filenum%
Print #m_filenum%, openNDL
Print #m_filenum%, leftopen & "REPLICA " & Mid$(db.ReplicaID, 1, 8) & ":" & Mid$(db.ReplicaID, 9, 8) & rightclose
Print #m_filenum%, openHint & db.Server & closeHint
'This is a document link
Print #m_filenum%, leftopen & "NOTE OF" & Mid$(doc.UniversalID, 1, 8) & ":" & Mid$(doc.UniversalID, 9, 8) & "-ON" & Mid$(doc.UniversalID, 17, 8) & ":" & Mid$(doc.UniversalID, 25, 8) & rightclose
Print #m_filenum%, openrem & label & closerem
Print #m_filenum%, closeNDL
Close m_filenum%

Messagebox filename & "-" & m_filenumb & ".NDL should now be on your desktop. Attach it to the Service Desk entry needed, then delete."

End If

End Sub
Sub NDLdoclinkToRoot(db As NotesDatabase, doc As NotesDocument, Byval filename As String, Byval label As String)
'Generates .NDL doclink file for current doc and saves it to user's root directory
'Document must have been saved prior to running this sub.
'Database must have an App Profile with an entry for the Enterprise Directory
'
'Versions:
' * 2004-09-20
'Construct the .NDL file on the user's c drive if Windows user or \home\notes\ if linux user
'Const path = "\home\notes\" ' for linux-unix
Const path = "c:\" 'for NT

Const openNDL = "<NDL>"
Const closeNDL = "</NDL>"
Const openHint = "<HINT>"
Const closeHint = "</HINT>"
Const leftopen = "<"
Const rightclose = ">"
Const openrem = "<REM>"
Const closerem = "</REM>"

Dim fname As String

m_filenumb = 0
m_filenum% = Freefile()
fname = path & filename & m_filenumb
Messagebox fname
Open fname & ".NDL" For Output As m_filenum%
Print #m_filenum%, openNDL
Print #m_filenum%, leftopen & "REPLICA " & Mid$(db.ReplicaID, 1, 8) & ":" & Mid$(db.ReplicaID, 9, 8) & rightclose
Print #m_filenum%, openHint & db.Server & closeHint
'This is a document link
Print #m_filenum%, leftopen & "NOTE OF" & Mid$(doc.UniversalID, 1, 8) & ":" & Mid$(doc.UniversalID, 9, 8) & "-ON" & Mid$(doc.UniversalID, 17, 8) & ":" & Mid$(doc.UniversalID, 25, 8) & rightclose
Print #m_filenum%, openrem & label & closerem
Print #m_filenum%, closeNDL
Close m_filenum%

End Sub
Sub NDLComposeBody(doc As NotesDocument, rtitem As NotesRichTextItem, bodytext As String, fname As String, label As String)
'Composes the part of the Body field which has the links.
Call rtitem.AppendText( bodytext )
Call rtitem.AddNewline(2)
Call rtitem.AppendText("Link for Outlook Mail users: --> ")
Call rtitem.EmbedObject( EMBED_ATTACHMENT, "", fname & ".NDL" )
Call rtitem.AddNewline(2)
Call rtitem.AppendText("__________________________________________________________________")
Call rtitem.AddNewline(2)
Call rtitem.AppendText("Link for Notes Mail users: --> ")
Call rtitem.AppendDocLink( doc, label )
End Sub






A required argument has not been pr... (Sue Z Sunshine 6.May.14)
. . What does the debugger tell you? (Doug Finner 6.May.14)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite