Domino 9 und frühere Versionen > Entwicklung

Mail nach Word und nu speichern?

<< < (2/4) > >>

shizen:

wordapp.Document.saveas("c:\hello.doc")


bringt: Instance member DOCUMENT dows not exist  :( >:( :(

koehlerbv:
Schau noch mal in der Doku nach - das heisst doch Documents AFAIK.

Bernhard

shizen:
auch das geht nich, ihr dürft VBA nich mit VB verwechseln  :-\

aber ich es mit VB auch noch nich gepackt :-(

Semeaphoros:
shizen: wenn Du über CreateObject eine Word Applikation öffnest, verwendest Du via COM VBA und nicht VB.

Bernhard: Documents ist die Collection aller Dokumente Document ist ein einzelnes Dokument, man müsste natürlich dafür zuerst das aktuelle Dokument aus der Collection rausziehen zB als Documents(0)

shizen:
so gehts  :D ;D :D


Sub Click(Source As Button)
   Dim ws As New NotesUIWorkspace
   Dim uidoc As NotesUIDocument
   Dim doc As NotesDocument
   Dim wordapp As Variant
   Dim body As Notesitem
   Dim rtitem As Variant
   Dim result As Integer
   
   Set uidoc = ws.CurrentDocument
   Set doc = uidoc.Document
   
   'neues Word Dokument öffnen
   Set wordapp = createObject("Word.Application")
   'anzeigen
   wordapp.visible = True
   'neues Dokument
   wordapp.Documents.add
   'Felder reinschreiben
   wordapp.Selection.TypeText("Am: " & doc.DeliveredDate(0))
   wordapp.selection.typeparagraph
   wordapp.selection.typeparagraph
   wordapp.Selection.TypeText("Von: " & doc.from(0))
   wordapp.selection.typeparagraph
   wordapp.Selection.TypeText("An: " & doc.sendto(0))
   wordapp.selection.typeparagraph
   wordapp.Selection.TypeText("Kopie: " & doc.copyto(0))
   wordapp.selection.typeparagraph
   wordapp.selection.typeparagraph
   wordapp.Selection.TypeText("Betreff: " & doc.subject(0))
   wordapp.selection.typeparagraph
   wordapp.selection.typeparagraph
   wordapp.selection.typeparagraph
   'eigentlichen Inhalt schreiben
   Set body = doc.GetFirstItem("Body")
   wordapp.Selection.TypeText(body.text)
   wordapp.Documents(1).saveas("c:\hello.doc")
   wordapp.quit
   'Anhänge speichern
   Set rtitem = doc.GetFirstItem( "Body" )
   'gibt es Anhänge
   If ( rtitem.Type = RICHTEXT ) And (rtitem.EmbeddedObjects<>"") Then
      Forall o In rtitem.EmbeddedObjects
         If ( o.Type = EMBED_ATTACHMENT ) Then
            'Call o.ExtractFile( "c:\" & o.Source )
            result = Shell("calc.exe",1)
         End If
      End Forall
   End If

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln