Integra for Notes Banner
  QuickReports Integra4Notes Integra Family of Products



How to set an e-mail address at runtime

When generating a Word, Excel or PDF file through an Integra export profile, Integra allows sending exported documents via e-mail. You can set this up in the Notes Action tab of an Integra profile, which allows you to determine to whom to send the exported documents and the content of the e-mail along with the attached document.

The code below can be used to set the value of the SendTo, CopyTo and BCC fields at runtime. This code would need to be added into the Script Callback tab located in the Advanced tab of an Integra profile. This sample code assumes that the source database contains a view called "Setup" that contains a single configuration document and that this document contains the information for the recipients contained in fields called SendTo, CopyTo and BCTo. The code will need to be altered to use the appropriate view name and field names.

Const CB_INITIALISE        = 3
Const CB_BFOREXPORT        = 10
Const CB_BFORREADNOTES     = 6
Const CB_BFORWRITECOM      = 1
Const CB_AFTERWRITECOM     = 9
Const CB_BFORCOMACTION     = 5
Const CB_BFORNOTESACTION   = 2
Const CB_TERMINATE         = 4

select case stats.cbstatus
case CB_INITIALISE
case CB_BFOREXPORT
     Dim view As NotesView
     Dim sdoc as NotesDocument

     ' this sample code assumes that your source database
     ' contains a view called "Setup" that contains a single
     ' configuration document. This document contains the
     ' information for recipients
     
     set view = stats.srcdb.GetView("Setup")
     Set sdoc = view.GetFirstDocument
     
     ' despite that you might have the information stored
     ' differently (in which case the above code lines need
     ' to be changed as required, the following three properties
     ' of the Integra runtime object struct have to be set
     ' accordingly.
     struct.SaveSendTo = sdoc.SendTo(0)
     struct.SaveCopyTo = sdoc.CopyTo(0)
     struct.SaveBCC    = sdoc.BCTo(0)

case CB_BFORREADNOTES
case CB_BFORWRITECOM
case CB_AFTERWRITECOM
case CB_BFORCOMACTION
case CB_BFORNOTESACTION
   if not stats.savdoc is nothing then
       ' before save as...
   else
       ' before send to
   end if
case CB_TERMINATE
end select

.




FAQ# 0207
Bookmark and Share

 
QUICK LINKS
 
 

 

  © Shireburn Software Ltd. 2008 - 2024