Если надо атрибутивку выкинуть в EXCEL , то есть такой код:
' Name: themes2excel.ave
'
' Description: See the "Shift click" instructions below for a script description.
'
' Requires: Microsoft Excel installed or accessible. The active document must be a view
' with active Themes.
'
'
' Date: 12-18-00
'***********************************************************************************************
' Get the active themes, exit it no themes
'***********************************************************************************************
theView = av.GetActiveDoc
theThemes = theView.GetActiveThemes
theThemeNumber = theThemes.count
if (theThemeNumber = 0) then
MsgBox.Error("Должна быть активная Тема!","Error")
return nil
end
tn = 0
for each i in theThemes
theFTab = i.GetFTab
'***counting themes***
tn = tn + 1
'**************************************************************************
' Check to see if Excel is running, if not start it up
'**************************************************************************
systemClient = DDEClient.Make( "Excel", "System")
if (systemClient.HasError) then
theExcelFile = MsgBox.Input("Is this the correct path to Excel.exe?", "Question",
"c:\program files\microsoft office\office\excel.exe")
if (theExcelFile = nil) then
exit
end
theExcelFileExists = true
ExcelRunning = False
systemClient.Close
if (theExcelFileExists = true) then
system.Execute(theExcelFile.AsString)
else
exit
end
else
systemClient.Close
ExcelRunning = True
end
systemClient = DDEClient.Make( "Excel", "System")
if (systemClient.HasError) then
MsgBox.error( systemClient.GetErrorMsg, " ")
return nil
end
'***********************************************************************************************
' Get the name of the new worksheet. Selection is an Excel item supported for the System topic.
'***********************************************************************************************
selection = systemClient.Request( "Selection" )
spreadsheet = selection.Left( selection.IndexOf("!"))
'*******************
' Ensure R1C1 format
'*******************
systemClient.Execute( "[Workspace(,,TRUE)]" )
systemClient.Close
'****************************************************************
' Open a new conversation with the Excel spreadsheet as the topic
'****************************************************************
ssClient = ddeClient.Make( "Excel", spreadsheet )
'************************************
' Get table information for later use
'************************************
themeName = theFTab.GetName
theFields = theFTab.GetFields
theSelection = theFTab.GetSelection
theSelection.SetAll
SelRecNum = theSelection.Count
'****************************************
' Write the table name to the spreadsheet
'****************************************
if (tn = 1) Then
row = 1
column = 1
else
'*************************************************
' Collects Record Number information
'*************************************************
theList = List.Make
aa = theThemeNumber - 1
for each x in 0..aa
theThemeNum = x
a = theThemes.Get(x)
b = a.GetFTab
c = b.GetSelection
c.SetAll
rc = c.Count
theList.Add(rc)
end
'********************************************************
' Extracts the Record Selection so it can append in Excel
'********************************************************
ln = tn - 2
if (tn > 1) then
SelRecNum = 0
for each x in 0..ln
theNum = theList.Get(x)
SelRecNum = SelRecNum + theNum + 3
end
row = SelRecNum + 1
Column = 1
end
end
ssClient.Poke( "R"+row.AsString+"C"+column.AsString, themeName )
'*********************
' Get input:
'*********************
oldSelRecs = theFtab.GetSelection.Clone
if (theFtab.GetSelection.Count > 0) then
SelRecs = theFtab.GetSelection
else
SelRecs = theFtab.GetSelection
SelRecs.SetAll
end
SelRecNum = SelRecs.Count
'***********************************************************************************************
' Ask the user which fields to include:
'***********************************************************************************************
fieldlist = Msgbox.MultiList(theFields,"Select Fields To Export"+nl+"(single click to toggle selection,"+nl+
" click and drag for multiple selection)","EXPORT "+themeName.AsString+" RECORDS TO EXCEL")
if (fieldlist= nil) then exit end
'*****************************
' Begin the export process
'*****************************
av.ShowMsg("Exporting to Excel ...")
if (tn = 1) Then
row = 2
column = 1
else &