Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys, I'm just wondering if I can get a system table with all table names and table fields, why I can't get a table with the id's of the existing objects and their caption names???
Until now, I was doing a macro looping over all sheets and get all the ids of the objects "enabling dynamic data update". But right now I have 10 sheets and more than 50 objects, so my document got stuck in the process because of the big amount of data.
This is my macro that loops over all sheets and objects (obviously it got stuck because of the big amount of operations):
function getSheetObjects
for i = 0 to ActiveDocument.NoOfSheets - 1
set ss= ActiveDocument.GetSheet(i)
arrCurrentSheet = split(ss.GetProperties.SheetId,"\")
currentSheet = arrCurrentSheet(1)
Objects = ActiveDocument.GetSheetByID(currentSheet).GetSheetObjects
For j = lBound(Objects) To uBound(Objects)
If Objects(j).GetObjectType > 9 Then 'Charts
arChartId = split(Objects(j).GetObjectId ,"\")
chartId = arChartId(1)
set obj = ActiveDocument.GetSheetObject(chartId)
caption = obj.GetCaption.Name.v
query = "INSERT INTO Objects ('Id Object','Name Object') VALUES ('" & chartId & "','" & caption & "')"
ActiveDocument.DynamicUpdateCommand(query)
End If
next
next
end function
Any ideas about how to improve that??
Many thanks in advance!!
Hi Marcel,
I'm using v10 and there is an option to export the structure to a file.
Hope this solves your needs.
Regards,
Fernando
Thanks Fernando for your quick answer. In fact yes, you can export, import the structure. But the point is how to do it dynamically.
I mean, you can get easily a system table right clicking the button "system Table" :
But I want the same with objects.
Marcel,
I think the cleanest way to do this would be to use the -prj feature of QV10. A document could "self load" the files from it's -prj directory to get all the meta information it could possibly want.
-Rob
Thanks Rob, I'll find out what's this feature in the documentation, and I'll try it.
Regards, Marcel.