F
как правильно открыть агентом по событию OLE Excel файл с диска? GetObject ругается
Dim xlApp As Variant
Set xlApp = CreateObject("Excel.Application")
With xlApp
.Workbooks.Add
.Workbooks.open "d:\temp\123.xls"
.visible = True
End With
Спс. Отсутсвие знаний
А как правильно теперь этот файл прикрепить к документу?
Attaches a file to a document.
Syntax
@Command( [EditInsertFileAttachment] )
or
@Command( [EditInsertFileAttachment] ; file ; compress )
Parameters
file
Text. Optional. The name of the file you want to attach. Be sure to include the complete path specification (appropriate to the user's operating system).
compress
Number. Optional. Specify "1" if you want to compress the attachment. Specify "0" if you do not.
Without a file parameter, displays the Create Attachment dialog box. If a file is specified, attaches that file to the document without opening the Create Attachment dialog box.
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")
Вот пример из хелпа:Ну и последний вопрос по этой теме - как OLE объект сохранить на диск-то?
Set rtitem = doc.GetFirstItem( "Body" )
If ( rtitem.Type = RICHTEXT ) Then
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) _
And ( o.FileSize > MAX ) Then
fileCount = fileCount + 1
Call o.ExtractFile _
( "c:\reports\newfile" & Cstr(fileCount) )
Call o.Remove
Call doc.Save( True, True )
End If
End Forall
End If
Гм... как бы в методе EMBED_ATTACHMENT указать лотусу, чтобы он распознавал файл как EXCEL
Forall o In rtItem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
If (Right$(o.Source, 3)<>"xls") Then
' .....
end if
end if
end forall
Взломай свой первый сервер и прокачай скилл — Начни игру на HackerLab