Domino 9 und frühere Versionen > Entwicklung
Mail nach Word und nu speichern?
shizen:
Hab ne Mail nach word geschoben und nu krieg ich Word nich wieder zu, also ohne Prompt!
Einer ne Idee?
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.save("NoPrompt:=True")
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
Grüße
Axel:
Hi,
versuch's mal so:
...
wordapp.Documents.save("NoPrompt:=True")
wordapp.quit 0
'Anhänge speichern
Set rtitem
...
Axel
shizen:
geht, aber wo isses hin ??? ??? ???
wie kann ich festlegen, wo und unter welchem Namen es gespeichert wird?
Grüße
koehlerbv:
Statt der Save-Methode musst Du SaveAs ("Dateiname") verwenden.
Bernhard
Semeaphoros:
Du verwendest Document.SaveAs anstatt von Documents.Save, dazu wäre die VBA-Hilfe sehr hilfreich gewesen
Navigation
[0] Themen-Index
[#] Nächste Seite
Zur normalen Ansicht wechseln