Autor Thema: rtf-attachment druck  (Gelesen 1121 mal)

Offline Leela

  • Frischling
  • *
  • Beiträge: 1
  • Geschlecht: Weiblich
rtf-attachment druck
« am: 25.08.04 - 10:44:26 »
Hallo zusammen,
ich habe leider ein Problem im 6er Client, im 5er funktionierts einwandfrei.
Ich bekomme in der Zeile  Set embedded = doc.GetAttachment( item.values(0) )   
immer die Meldung: Variant does not contain a container!

hat jemand eine Idee? danke schon mal...

Sub Initialize
   
   Dim session As New notessession
   Dim db As notesdatabase
   Dim ws As New notesuiworkspace   
   Dim doc As notesdocument
   Dim doc2 As notesuidocument
   Dim dc As notesdocumentcollection
   Dim rtitem As notesrichtextitem
   Dim embedded As NotesEmbeddedObject
   Dim item As Variant
   Dim loopindex As Long
   Dim poc As Integer
   Dim resul As String
   Dim xlapp As Variant
   
   Set db = session.currentdatabase
   Set dc = db.Unprocesseddocuments
   
   For loopindex = 1 To dc.count
      
      Set doc = dc.getnthdocument(loopindex)
      Set doc2 = ws.editdocument(False,doc)
      
      If (doc.hasitem("$File")) Then
         Set item = doc.getfirstitem("$File")
         Set embedded = doc.GetAttachment( item.values(0) )         
         fname = "C:\TEMP\" & item.values(0)
         poc = Instr(1, fname, ".")
         resul = Mid$(fname, poc, 4)
         Call embedded.extractfile(fname)
         'Print(resul)
         
         
         If Lcase$(resul) = ".rtf" Then
               'Print("------IN DOC")
            Call doc2.print(1)
            Dim wordapp As Variant
            Dim worddoc As Variant
            Set wordapp = createobject("Word.application")
            Call wordapp.documents.open(fname)            
            Call wordapp.printout()
            For i = 1 To 10000
               Print i
            Next
            Call wordapp.quit
            For i = 1 To 4000
               Print i
            Next   
            
         Else
            Call doc2.print(1)
                  'Call doc2.close(True)
                  'Print("------ANDERER ANHANG")
         End If
         
         
         
         Kill fname
         
      Else
         Call doc2.print(1)
         'Call doc2.close(True)
         'Print("KEIN ANHANG")
      End If
      
      Print(" ")
      doc.putinfolder("($Inbox)")
'       doc.removefromfolder("($Inbox)")
      Call doc2.close(True)
   Next
   
End Sub

Offline Axel

  • Moderator
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 8.658
  • Geschlecht: Männlich
  • It's not a bug, it's Notes
Re:rtf-attachment druck
« Antwort #1 am: 25.08.04 - 13:54:57 »
Hi,

versuch's doch mal mit dem RTF-Feld in dem die Datei angehängt wurde und nicht mit $File.

Hier ein Beispiel aus der Designer-Hilfe:
Dim doc As NotesDocument
Dim rtitem As Variant
Dim object As NotesEmbeddedObject
'...set value of doc...
Set rtitem = doc.GetFirstItem( "Body" )
If ( rtitem.Type = RICHTEXT ) Then
  ' check for attachment in Body item
  Set object = rtitem.GetEmbeddedObject( "jill.sam" )
  If ( object Is Nothing ) Then
    ' check for attachment in rest of document
    Set object = doc.GetAttachment( "jill.sam" )
  End If
End If



Axel
« Letzte Änderung: 25.08.04 - 13:56:09 von Axel »
Ohne Computer wären wir noch lange nicht hinterm Mond!

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz