Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Adding CC to Newsletter

Posted on 2008-10-20
10
Medium Priority
?
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

715 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