?
Solved

Scripting - Modify Send button - multiple batches

Posted on 2003-12-01
12
Medium Priority
?
290 Views
Last Modified: 2013-12-18
I have a requirement to break a mailing into several batches. The form contains a RichText field (Body) that I am having difficulty with. I have been unsuccesful accessing this field.

old button contents:
REM @Command([MailSend]);
REM @Command([FileSave]);
REM @Command([FileCloseWindow])

new script:
Sub Click(Source As Button)
     On Error Goto ErrorHandler
     
     Dim session As New NotesSession
     Dim workspace As New NotesUIWorkspace
     Dim db As NotesDatabase
     Dim uidoc As NotesUIDocument
     Dim doc As NotesDocument
     Set db = session.CurrentDatabase    
     Set uidoc = workspace.CurrentDocument
     Set doc = uidoc.Document
     
     saveBCC = Evaluate( "@Unique(BlindCopyTo)", doc )
     
     uLimit = Ubound(saveBCC)
     batchSize = 1
     y = 0  
     
     Set sentBCC = doc.GetFirstItem( "BlindCopyTo" )
     doc.BlindCopyTo = ""
     
     For x = 0 To uLimit
          sentBCC .AppendToTextList( saveBcc(x) )
          y = y + 1
          If y >= batchSize Or x = uLimit Then
REM               y =  Evaluate("@MailSend ")
               Call doc.Save( True, True)
               Call doc.Send( False )
               
               Messagebox "sentBcc: " & sentBCC .Text
               y = 0  
               doc.BlindCopyTo = ""
          End If
     Next x  
     Exit Sub
     
ErrorHandler:
     Messagebox "Error " & Err() & ":  " & Error()
     Exit Sub
     
End Sub
0
Comment
Question by:ba_pepper
[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
  • 4
  • 3
  • 2
  • +2
12 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9851841
I see this if condition confusing

If y >= batchSize Or x = uLimit Then, which says if y which is initialy 0 +1 >= 1... then resetting it back to 0 in the if condition.. is equivalent to true always. And you are looping x = 0 to ulimit, and again checking x = ulimit doesn't make sense.

What is your intention ?

If you want to breakup bcc field data into certain chunks then you can use counter which will collect subsets of the data and send it.. Also Where is Richtext field ?

~Hemanth
0
 

Author Comment

by:ba_pepper
ID: 9851859
possible, I would like to focus on accessing the RTF field -  Body, any ideas?
0
 
LVL 14

Expert Comment

by:p_partha
ID: 9852014
U mean u want to manipulate body field .. hope this example helps,
Dim doc As NotesDocument
Dim rtitem As Variant

Set rtitem = doc.GetFirstItem( "Body" )
If rtitem.Type = RICHTEXT Then
  Call rtitem.AddNewLine( 1 )
  Call rtitem.AppendText _
  ( "what ever u want to type u can type" )
End If
Call doc.Save( False, True )

Partha
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9852033
Well partha covered it pretty much.

0
 

Author Comment

by:ba_pepper
ID: 9852311
needed to focus on the uidoc.... Answer below


Sub Click(Source As Button)
     On Error Goto ErrorHandler
     
     Dim workspace As New NotesUIWorkspace
     Dim uidoc As NotesUIDocument
     Dim doc As NotesDocument    
     Set uidoc = workspace.CurrentDocument
     Set doc = uidoc.Document
     
     uidoc.Send
     
     Exit Sub
     
ErrorHandler:
     Messagebox "Error " & Err() & ":  " & Error()
     Exit Sub
     
End Sub
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9852336
Sub Click(Source As Button)
     On Error Goto ErrorHandler
     
     Dim workspace As New NotesUIWorkspace
     Dim uidoc As NotesUIDocument
     Dim doc As NotesDocument    
Dim rt as notesRichTextItem
     Set uidoc = workspace.CurrentDocument
     Set doc = uidoc.Document
     
set rt = doc.GetFirstItem("Body")
rt.AddNewLine(1)
rt.AppendText( "Here is my line added to the rich text")
Call doc.Send(false)
     
     Exit Sub
     
ErrorHandler:
     Messagebox "Error " & Err() & ":  " & Error()
     Exit Sub
     
End Sub
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9853193
Hi ba_pepper,

None of the experts here has any idea whether you still have a problem or not, nor what the problem was.  Is this closed?

Best regards,
qwaletee
0
 

Author Comment

by:ba_pepper
ID: 9857509
Sorry should have stated problem resolved.

Look at prior post for answer (code snippet).

The problem was when sending the doc the RTF field ( Body ) was not being included, the solution was send the uidoc.
0
 

Author Comment

by:ba_pepper
ID: 9857514
close this problem
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9872485
Ask for a refund using community support.
0
 

Accepted Solution

by:
SpazMODic earned 0 total points
ID: 9892411
PAQed, with points refunded (125)

SpazMODic
EE Moderator
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

770 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