Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Adding CC to Newsletter

Posted on 2008-10-20
10
Medium Priority
?
267 Views
Last Modified: 2013-12-18
What would be the code to add a CC and/or a BCC to the newsletter code below.
Sub Click(Source As Button)
	Dim s As New NotesSession
	Dim w As New NotesUIWorkspace
	Dim db As NotesDatabase
	Dim v As NotesView
	Dim c As NotesDocumentCollection
	Dim doc As NotesDocument
	Dim key As String
	Dim cur As NotesDocument
	Set db = s.CurrentDatabase
	Set doc = w.CurrentDocument.Document
	key = doc.ussales(0)    'get the name of office (view category) from the current document
	Set v = db.GetView( "newsletter" ) 'maybe you'll have to create the view that is categorized by office
	Set c = v.GetAllDocumentsByKey( key, True )
	Dim newDoc As New NotesDocument( db )
	Dim rt As NotesRichTextItem
	Set rt = newDoc.CreateRichTextItem( "Body" )
	Dim rtsHeader As NotesRichTextStyle, rtsNormal As NotesRichTextStyle
	Set rtsHeader = s.CreateRichTextStyle  
	Set rtsNormal = s.CreateRichTextStyle
	
	rtsHeader.NotesFont = FONT_COURIER   'it's fixed size font, good for tabbed tables
	rtsHeader.FontSize = 12
	rtsHeader.Bold = True
	
	rtsNormal.NotesFont = FONT_COURIER
	rtsNormal.FontSize = 10
	rtsNormal.Bold = False
	
	Call rt.AppendStyle( rtsHeader )
	
	Call rt.AddNewLine( 3 )
	Call rt.AppendText( "Employee #" )
	Call rt.AddTab( 1 )
	Call rt.AppendText( "Current Asset" )
	Call rt.AddTab( 2 )
	Call rt.AppendText( "New Asset " )
	Call rt.AddTab( 2 )
	Call rt.AppendText( "New  Mon Asset" )
	Call rt.AddNewLine( 1 )
	
	Call rt.AppendStyle( rtsNormal )     'The style that would be applied on text bellow header
	
	Set cur = c.GetFirstDocument
	Do Until cur Is Nothing
		Call rt.AddNewLine( 1 )
		Call rt.AppendText( cur.emp_num(0) )
		Call rt.AddTab( 2 )
		Call rt.AppendText( cur.current_asset(0) )
		Call rt.AddTab( 3 )
		Call rt.AppendText( cur.new_asset(0) )
		Call rt.AddTab( 3 )
		Call rt.AppendText( cur.new_mon_asset(0) )
		Call rt.AddTab( 2 )
		Call rt.AppendDocLink( cur, "Link to document " )  'add link to doc to the end
		
		Set cur = c.GetNextDocument( cur )
	Loop
	newDoc.Form = "Memo"
	newDoc.Subject = "IBPC Refresh DLM Update SBS"' + cur.office_num_adjusted
	Call newDoc.Save( True, True )
	Call newDoc.Send( True, "Field Technology" )

Open in new window

0
Comment
Question by:jforget1
  • 5
  • 3
  • 2
10 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 22757642
Call newdoc.ReplaceItemValue("SendTo", array_of_recievers)
Call newdoc.ReplaceItemValue("CopyTo", array_of_CC_recievers)
Call newdoc.ReplaceItemValue("BlindCopyTo", array_of_BCC_recievers)

Call newdoc.Send(False)

Why Send(True)?? Not good, IMHO.
0
 
LVL 22

Accepted Solution

by:
mbonaci earned 2000 total points
ID: 22757655
newDoc.CopyTo = "CC Address"
newDoc.BlindCopyTo = "BCC Address"


In case of any problems try this:

newDoc.EnterCopyTo = "CC Address"
newDoc.EnterBlindCopyTo = "BCC Address"


Marko
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 22757661
receiver of course... :$
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 22757973
Why did you accept the second (best) answer?
0
 

Author Comment

by:jforget1
ID: 22760047
Because it was the least complicated and it worked on the first try. Arrays scare me a little. :>)


Any idea on how I can get the code right to update the value of 2 fields on the record the user is on.

      Call doc.FieldSetText("status", "Reclamation Approved")
      Call doc.FieldSetText("reclamation_approved_flag", "done")
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 22760395
Yep, but not in this question. Piggy-backers scare me off a little... ;-)
0
 

Author Comment

by:jforget1
ID: 22760451
I will be happy to post a new ?
0
 
LVL 22

Expert Comment

by:mbonaci
ID: 22760509
Jforget,

FieldSetText is used when the user has document opened in edit mode and is the method of NotesUIDocument, not NotesDocument.

You can replace FieldSetText with ReplaceItemValue, like this:

      Call doc.ReplaceItemValue(FieldName, NewValue)

or in your case:

      Call doc.ReplaceItemValue("status", "Reclamation Approved")
      Call doc.ReplaceItemValue("reclamation_approved_flag", "done")


Thanks for the points,
Mb¤
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 22760602
LOL
0
 

Author Comment

by:jforget1
ID: 22760920
Thanks Mb.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

876 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