Solved

Unable to send document link to email account

Posted on 2004-08-17
2
323 Views
Last Modified: 2013-12-18
I want user to send this document link to other user email when user click on a mailsend button.
There is a names field called mailto which contains multiple user email addresses.
Thus when user has finished choosing the selected recipients, he will click on the mailsend button to send the document to them. But when click on mailsend button, i get the following error : Couldn't get dafault view id for database

Pls help.
Thanks.

Code for mailsend button:

Sub Click(Source As Button)    
      
      Dim ws As New NotesUIWorkspace
      Dim uidoc As NotesUIDocument
      Set uidoc=ws.CurrentDocument
      Call uidoc.Save
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim newDoc As NotesDocument
      Dim curdoc As NotesDocument
      Dim rtitem As NotesRichTextItem
      Set db = session.CurrentDatabase
      Set curdoc = uidoc.Document
            
      Set newDoc = New NotesDocument(db)
      
      newDoc.Form = "Memo"              
      newDoc.Subject = "<From Sales Meeting DB>" + "[" + uidoc.FieldGetText("Group") + "]" + uidoc.FieldGetText("Subject")
      
      pText ="The following was issued from " + uidoc.FieldGetText("pic") +Chr(10)+Chr(10)_          
      + "   <Subject>  : "+ uidoc.FieldGetText("Subject") + Chr(10) + Chr(10)_
      + "   <Group>  : "+ uidoc.FieldGetText("Group") + Chr(10)_
      + "   <Region>  : "+ uidoc.FieldGetText("Customer") + Chr(10)_
      + "   <Category>  : "+ uidoc.FieldGetText("Category") + Chr(10) + Chr(10)_
      + "   <Contents> : " + Chr(10)          
      
      Text_2 = "    Sales Meeting Document Link (for Notes user only) ->  "
      
      Set rtitem = New NotesRichTextItem(newDoc, "Body")
      
      Call rtitem.Appendtext( pText )      
      Call rtitem.AddNewLine(1)    
      Call rtitem.Appendtext( Text_2 )    
      Call rtitem.AppendDocLink(curdoc,"")       
      Call newdoc.Send(False,uidoc.FieldGetText("mailto"))
                    
      
      Messagebox("Mail send completed.")
      
      Call uidoc.Save()    
      Call uidoc.close
            
      Exit Sub

      
End Sub
0
Comment
Question by:kopibean
  • 2
2 Comments
 
LVL 19

Expert Comment

by:madheeswar
ID: 11827448
I suspect ur getting error here:
pText ="The following was issued from " + uidoc.FieldGetText("pic") +Chr(10)+Chr(10)_          
     + "   <Subject>  : "+ uidoc.FieldGetText("Subject") + Chr(10) + Chr(10)_
     + "   <Group>  : "+ uidoc.FieldGetText("Group") + Chr(10)_
     + "   <Region>  : "+ uidoc.FieldGetText("Customer") + Chr(10)_
     + "   <Category>  : "+ uidoc.FieldGetText("Category") + Chr(10) + Chr(10)_
     + "   <Contents> : " + Chr(10)  

And debug the script and you can see which line the error comes.
0
 
LVL 19

Accepted Solution

by:
madheeswar earned 30 total points
ID: 11827744
If you have any views, make it a defualt view and test this code.

I Tested your code and it looks OK.
if you don't have any views, then create a view and make it as default.

IGNORE my first post.

THANKS.
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

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
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 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