Integra for Notes Banner
  QuickReports Integra4Notes Integra Family of Products



How does Integra handle attachments in fields?


When exporting Notes documents to Word or Excel, attachments or objects stored in rich text fields on the Notes documents will be ignored by Integra. However, attachments can be handled using Integra's advanced callback feature where advanced users can use Lotus Script to manipulate attachments in rich-text fields and programmatically detach these attachments/objects to the file system or to reattach these attachments/objects as embedded objects within the created Word document.

The following example code shows how to manually detach files from with Integra exported Notes documents. Please refer to the MS Office COM documentation on how to import detached files into the current Word or Excel document created with Integra for Notes. The example code indicates how to access the Word or Excel COM created at Integra for Notes at runtime.

Const CB_INITIALISE = 3
Const CB_BFORREADNOTES = 6
Const CB_BFORREADCOM = 7
Const CB_BFORWRITECOM = 1
Const CB_AFTERWRITECOM = 9
Const CB_BFORWRITENOTES = 8
Const CB_BFORCOMACTION = 5
Const CB_BFORNOTESACTION = 2
Const CB_TERMINATE = 4

Dim prof As NotesDocument
Dim path As String
Dim fnam() As String
Dim x As integer

select case stats.cbstatus
case CB_INITIALISE
case CB_BFORREADNOTES
case CB_BFORREADCOM
case CB_BFORWRITECOM
    path = GetIntegraDataDir()
    if not right(path,1)="\" then
      path = path + "\"
    end if

    x = -1
    Forall obj In stats.expdoc.Items
      If obj.type = 1084 Then
        Set emb = stats.expdoc.GetAttachment(obj.values(0))

        x = x + 1

        redim preserve fnam(x) as string

        fnam(x) = path & obj.values(0)

        Call emb.ExtractFile(fnam(x))
      End If
    End Forall

    ' To utilise the filenames in the CB_AFTERWRITECOM
    ' event, we need to temporarely save the fnam() array.
    ' This can be achieved by saving the information in
    ' the user's profile in the Integra for Notes database.
    Set prof = GetUserProfile()

    If Not prof Is Nothing Then
      prof.Custom_Filenames = fnam

      Call prof.save(true,false)
    End If
case CB_AFTERWRITECOM
    ' in the AFTERWRITECOM event it is possible to use
    ' Word or excel COM methods to import the detached files if
    ' Word or Excel provide the necessary import filter for each of
    ' the detached file types.

    ' you can access the Word application & document object
    ' via the Integra stats runtime object:
    ' stats.WordAppl
    ' stats.WordDoc

    ' you can access the Excel application, workbook & spreadsheet object
    ' via the Integra stats runtime object:
    ' stats.XlsAppl
    ' stats.XlsWBook
    ' stats.XlsSheet

    Set prof = GetUserProfile()
    ' having received the user profile you can loop through
    ' the filenames temporarely stored in the field
    ' Custom_Filenames
case CB_BFORWRITENOTES
case CB_BFORCOMACTION
case CB_BFORNOTESACTION
case CB_TERMINATE
end select

.




FAQ# 0051
Bookmark and Share

 
QUICK LINKS
 
 

 

  © Shireburn Software Ltd. 2008 - 2024