Message 1 of 3
How to use VBA to create a custom property for a sheet in a sheet set

Not applicable
01-15-2008
11:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm new to VBA for AutoCAD, and I'm trying to create a custom property for a sheet in a sheet set. In the example I find the following code:
Dim cBag As IAcSmCustomPropertyBag
Dim cBagVal As New AcSmCustomPropertyValue
Set cBag = sheetdb.GetSheetSet().GetCustomPropertyBag
cBagVal.InitNew cBag
cBagVal.SetFlags CUSTOM_SHEETSET_PROP
cBagVal.SetValue CStr(sheetCount)
cBag.SetProperty "Total Sheets", cBagVal
Set cBagVal = Nothing
But the owner of the custom property created here is the Sheet Set, not the Sheet. I need a custom property for each sheet, how can I do this? Can anybody help? Thanks.
Regards,
HM
Dim cBag As IAcSmCustomPropertyBag
Dim cBagVal As New AcSmCustomPropertyValue
Set cBag = sheetdb.GetSheetSet().GetCustomPropertyBag
cBagVal.InitNew cBag
cBagVal.SetFlags CUSTOM_SHEETSET_PROP
cBagVal.SetValue CStr(sheetCount)
cBag.SetProperty "Total Sheets", cBagVal
Set cBagVal = Nothing
But the owner of the custom property created here is the Sheet Set, not the Sheet. I need a custom property for each sheet, how can I do this? Can anybody help? Thanks.
Regards,
HM