Solved

Link not working when mailed from sub

Posted on 2004-08-03
3
268 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

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.

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…
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.
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

827 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