Domino 9 und frühere Versionen > Entwicklung
Problem mit CreateObject
robertpp:
Wenn du eine datei anhängst dann muss du erst doppelt auf die datei klicken und dann starten sagen und dann wird die datei im excel geöffnet!!!
Mit dem Script von mir wir die datei direkt im mail geöffnet das heißt im RTFeld kannst du lesen was in der exceldatei steht!!!
Ist das jetzt gut beschrieben?
robertpp
Rob Green:
ok, in meiner Sprache heißt das OLE Link..gut..dann laß mich etwas wursteln (prügel mich in den Untiefen der Busytime, des Schedul Managers, der Ressourc DB und Free Tim Search herum)...
hier schon mal was zum Lesen für Dich mit einer Backendklasse, die das kann, was Du gerne mit UI KLassen momentan machst und das dann nicht geht...also ein Ausweg:
EmbedObject method
Beispiel
Given the name of a file or an application, does one of the following:
Attaches the file you specify to a rich-text item.
Embeds an object in a rich-text item. The object is created using either the application or the file you specify.
Places an object link in a rich-text item. The link is created using the file you specify.
Hinweis EmbedObject is not supported on OS/2, on UNIX, and on the Macintosh.
Defined in
NotesRichTextItem
Syntax
Set notesEmbeddedObject = notesRichTextItem.EmbedObject( type%, class$, source$, [ name$ ] )
Parameters
type%
Constant. Indicates if you want to create an attachment, an embedded object, or a object link. May be any of the following:
EMBED_ATTACHMENT (1454)
EMBED_OBJECT (1453)
EMBED_OBJECTLINK (1452)
Hinweis The above constants are also used with the Type property in the NotesEmbeddedObject class.
class$
String.
If you are using EMBED_OBJECT and want to create an empty embedded object from an application, use this parameter to specify the name of the application (for example, "1-2-3 Worksheet") and specify an empty string ("") for source$. Case-sensitive.
If you are using EMBED_OBJECTLINK or EMBED_ATTACHMENT, specify an empty string ("").
source$
String.
If you are using EMBED_OBJECT and want to create an embedded object from a file, use this parameter to specify the name of the file, and specify an empty string ("") for class$.
If you are using EMBED_ATTACHMENT or EMBED_OBJECTLINK, use this parameter to specify the name of the file to attach or link.
name$
String. Optional. Name by which you can reference the NotesEmbeddedObject later. This parameter is only used for OLE/2 objects and does not include attachments.
Return value
notesEmbeddedObject
The newly attached file, embedded object, or linked object.
Usage
For this method to work you must set a default view in the database.
Files can be attached on any Notes platform, but objects and links can only be created on platforms supporting OLE.
Files can be embedded as OLE/2 objects only on platforms supporting OLE, but they can be embedded as OLE/1 objects on any Notes platform (if the file is of a supported type, such as a Lotus® application data file).
Beispiel
Siehe auch
EmbeddedObjects property (in NotesDocument)
EmbeddedObjects property (in NotesRichTextItem)
GetAttachment method (in NotesDocument)
GetEmbeddedObject method
HasEmbedded property (in NotesDocument)
NotesEmbeddedObject class
Working with a rich-text item
Rob Green:
dazu die Bsp:
This script is identical to the one above, except that it creates an embedded object using the file JIM.SAM.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim object As NotesEmbeddedObject
Set db = session.CurrentDatabase
Set doc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( doc, "Body" )
Set object = rtitem.EmbedObject _
( EMBED_OBJECT, "", "c:\jim.sam")
doc.Form = "Main Topic"
doc.Subject = _
"Here's Jim's document, as an embedded object"
Call doc.Save( True, True )
3. This script is identical to the one above, except that it creates an object link using the file JIM.SAM.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim object As NotesEmbeddedObject
Set db = session.CurrentDatabase
Set doc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( doc, "Body" )
Set object = rtitem.EmbedObject _
( EMBED_OBJECTLINK, "", "c:\jim.sam")
doc.Form = "Main Topic"
doc.Subject = "Here's Jim's document, as an object link"
Call doc.Save( True, True )
4. This script embeds a new, blank embedded object in the Body item of a document. The object is created using 1-2-3.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim object As NotesEmbeddedObject
Set db = session.CurrentDatabase
Set doc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( doc, "Body" )
Set object = rtitem.EmbedObject _
( EMBED_OBJECT, "1-2-3 Worksheet", "", _
"Quarterly Report" )
Call doc.Save( True, True )
robertpp:
OK ab jetzt heißt das bei mir auch OLE Link.. ich schau mir mal das an was du mir geschickt hast und vielleicht findest ja du dann noch die perfekte lösung für mein problem!!!
robertpp
Rob Green:
eigentlich brauchst Du nur das Beispiel mit
dem Set object = rtitem.EmbedObject ( EMBED_OBJECT, "", "c:\jim.sam") abzutippeln und einzubauen (klar, incl., dem Ansprechen des RT Feldes per Script)
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln