Domino 9 und frühere Versionen > ND6: Entwicklung
Text aus MS Word in Notes Kopieren per Script
MrJingels:
So, teilweise mit eurer Hilfe habe ich dies nun selbst hinbekommen.
Hier das Script:
Sub Click(Source As Button)
Dim ws As NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim WordDocument As Variant
Dim WordApplication As Variant
Set ws = New NotesUIWorkspace
Set uidoc = ws.CurrentDocument
Set WordDocument= GetObject("D:\Dokument1.doc","Word.Document") 'Dokumet öffnen
Set WordApplication = WordDocument.Application 'Applikation zum Dokument
WordApplication.visible=True 'Applikation sichtbar machen
Forall selection In WordDocument.StoryRanges
Selection.WholeStory 'Alles markieren
Selection.Copy 'kopieren
End Forall
Call uidoc.GotoField("tmp") 'zum Feld im aktiven Dokuement springen
Call uidoc.Paste 'in Feld einfügen
Call uidoc.Save 'NotesDoc speichern
Call WordDocument.Close() 'nur aktuelles Dokument wird geschlossen
Set WordDocument = Nothing
If WordApplication.Documents.Count = 0 Then
Call WordApplication.Quit() ' geöffnete Word-Anwendung wird geschlossen
Set WordApplication = Nothing
End If
End Sub
Sollte jemand Tipps haben, wie es besser geht, dann bitte antworten.
Eines weiß ich selbst nicht so genau. Warum ich für die "Selection" den Forall-Teil verwenden muss. Ich habs aber nicht anders hinbekommen.
Navigation
[0] Themen-Index
[*] Vorherige Sete
Zur normalen Ansicht wechseln