Вверх ↑
Главный модератор
Ответов: 2998
Рейтинг: 396
#1: 2006-01-05 11:39:00 ЛС | профиль | цитата
[code:1]Add(MainForm,16078593,35,77) {
Left=20
Top=105
Caption="word"
}
Add(ODialog,16073511,140,126)
{
Filter="*.doc|*.doc|All|*.*"
link(onExecute,11221787:doEvent1,[])
}
Add(VBJScript,7134762,231,154)
{
@Hint=#18:Read Word Document|
WorkPoints=#6:doWork|
EventPoints=#7:onEvent|6:onWord|7:onError|
Script=#15:Option Explicit|7:Dim FSO|27:Function doWork(Data,Index)|10: Dim strIn|19: strIn = CStr(Data)|53: Set FSO = CreateObject("Scripting.FileSystemObject")|8: Dim Ext|28: Ext = GetAnExtension(strIn)|28: If LCase(Ext) <> "doc" Then|19: Sys.onEvent strIn|5: Else|9: Dim WRD|44: Set WRD = CreateObject("WORD.Application")|21: WRD.Visible = False|26: WRD.Documents.Open strIn|31: WRD.Documents(strIn).Activate|12: Dim strOut|13: strOut = ""|20: Dim myRange, aWord|42: Set myRange = WRD.ActiveDocument.Content|33: For Each aWord In myRange.Words|31: strOut = Strout & aWord.Text|6: Next|10: WRD.Quit|19: Set WRD = Nothing|19: Sys.onWord strOut|7: End If|12:End Function|0:|33:Function GetAnExtension(FileSpec)|23: On Error Resume Next|50: GetAnExtension = FSO.GetExtensionName(FileSpec)|100: If CStr(Err.Number) <> 0 Then call LogMsg(EventError, "Can't get extension of file: " & FileSpec)|12:End Function|0:|27:Sub LogMsg(intType, strMsg)|37: Sys.onError strMsg & ";" & intType|7:End Sub|0:|
link(onWord,2115300:doText,[])
}
Add(ChildPanel,735914,98,126)
{
link(onEvent1,16073511:doExecute,[])
}
BEGIN_SDK
Add(EditMulti,12180049,3,3)
{
EventCount=1
Width=132
Height=116
}
Add(Panel,1112578,28,63)
{
Left=35
Top=105
Width=322
Height=33
Align=2
Point(doColor)
}
Add(Button,11007171,63,21)
{
Left=10
Top=5
Caption="Load"
link(onClick,12180049:onEvent1,[])
}
END_SDK
Add(StrList,2115300,280,140)
{
}
Add(ArrayEnum,4419120,294,196)
{
link(onItem,8415777:doAdd,[])
link(Array,2115300:Array,[])
}
Add(StringTable,8415777,343,196)
{
Width=392
Height=273
Align=5
Columns=#5:Words|
Grid=0
}
Add(Hub,11221787,182,126)
{
OutCount=4
link(onEvent1,2115300:doClear,[(269,132)(269,153)])
link(onEvent2,8415777:doClear,[(334,139)(334,209)])
link(onEvent3,7134762:doWork,[(224,146)(224,160)])
link(onEvent4,4419120:doEnum,[(218,153)(218,202)])
}
[/code:1]
карма: 6
Дорогу осилит идущий. Install/Update HiAsm.NET
0