Solved

Link not working when mailed from sub

Posted on 2004-08-03
3
264 Views
Last Modified: 2013-12-18
Hi Guys


I would like to know how to pass a uidococument to a sub
Both are within a button


I have the document doing everthing ,except the LINK is not working
Call SendMail(ApproverName,EmpName, THIS IS PROBABLY WRONG>>> HRDOC)

Sub SendMail(ApproverName As String,EmpName As String, THIS IS PROBABLY WRONG>>> HRdoc As NotesUIDocument)
      Dim ws As New NotesUIWorkspace
      Set HRDoc =ws.CurrentDocument
      Dim emailDoc As NotesDocument
      Dim rtitem As NotesRichTextItem
      Dim db As NotesDatabase
      Dim s As New NotesSession
      Set DB = S.CurrentDatabase
        'Start to build email
      Set emailDoc = New NotesDocument(db)
      Set rtitem = New NotesRichTextItem (emaildoc, "Body")      
      
              'Create the body field and put in a doclink
      Call rtitem.AppendText("A Change Request requires your approval.  It is for "+Empname+".")
      Call rtitem.AddNewLine(2)  
      Call rtitem.AppendDocLink(HRDoc, "Link to document")<<<HERE IS THE PROBLEM
      
      'E-mail those who need to know
      emailDoc.Form = "Memo"
      emailDoc.SendTo = ApproverName
      emailDoc.BlindCopyTo = ""
      emailDoc.Subject =  "HR Action Form - Your Signature is Required!"
      'Compute the computed fields to send mail
      Call emailDoc.ComputeWithForm(False, False)
      
      'Send the e-mail
      Call emailDoc.Send (False)
      
      Messagebox ("This Change Request has been sent to the Next Approver for Approval.")
      
0
Comment
Question by:imjamesw
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
qwaletee earned 500 total points
ID: 11708915
Hi imjamesw,

Call AppendDocLink ( HRDoc.document ...

AppendDocLink expects a backend NotesDocument, not a front end UIDOcument.  It also needs to be a document that was already saved, and the DB has to have a default view.

And if you are passing it in the parameters, you don't need to assign it from NotesUiWorkspace.  or vice versa.

Cheers!
0
 

Author Comment

by:imjamesw
ID: 11709108
ARE the parameters correct

Call SendMail(ApproverName,EmpName, THIS IS PROBABLY WRONG>>> HRDOC)


Sub SendMail(ApproverName As String,EmpName As String, THIS IS PROBABLY WRONG>>> HRdoc As NotesUIDocument)
0
 

Author Comment

by:imjamesw
ID: 11709434
I got it

Thanx
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 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