Message 1 of 2
Reg : Macro (modification)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear all,
Please help me in writing a code to get Decimal Values of all Dimensions whichever is having. Today, I gone through one Program which is in Sample Programs.
I just made slight changes but still it is not working.
I am sending the macro which I came across. Is
Public Sub EditDrawingDimensions()
' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
'Set a reference to the active sheet.
Dim oSheet As Sheet
Set oSheet = oDrawDoc.ActiveSheet
Dim counter As Long
counter = 1
Dim oDrawingDim As DrawingDimension
For Each oDrawingDim In oSheet.DrawingDimensions
Next
' Set a reference to the dimension style of that dimension.
Dim oDimStyle As DimensionStyle
Dim oDimStyleLinearPrecision As LinearPrecisionEnum
' Modify some properties of the dimension style.
' This will modify all dimensions that use this style.
If oDimStyleLinearPrecision = 41730 Then
LenearPrecision = kOneDecimalPlaceLinearPrecision
Else
If oDimStyleLinearPrecision = 41731 Then
LenearPrecision = kTwoDecimalPlacesLinearPrecision
Else
If oDimStyleLinearPrecision = 41732 Then
LenearPrecision = kThreeDecimalPlacesLinearPrecision
Else
If oDimStyleLinearPrecision = 41733 Then
LenearPrecision = kFourDecimalPlacesLinearPrecision
End If
End If
End If
End If
End Sub
Thanks to your time.
Kalyan
Please help me in writing a code to get Decimal Values of all Dimensions whichever is having. Today, I gone through one Program which is in Sample Programs.
I just made slight changes but still it is not working.
I am sending the macro which I came across. Is
Public Sub EditDrawingDimensions()
' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
'Set a reference to the active sheet.
Dim oSheet As Sheet
Set oSheet = oDrawDoc.ActiveSheet
Dim counter As Long
counter = 1
Dim oDrawingDim As DrawingDimension
For Each oDrawingDim In oSheet.DrawingDimensions
Next
' Set a reference to the dimension style of that dimension.
Dim oDimStyle As DimensionStyle
Dim oDimStyleLinearPrecision As LinearPrecisionEnum
' Modify some properties of the dimension style.
' This will modify all dimensions that use this style.
If oDimStyleLinearPrecision = 41730 Then
LenearPrecision = kOneDecimalPlaceLinearPrecision
Else
If oDimStyleLinearPrecision = 41731 Then
LenearPrecision = kTwoDecimalPlacesLinearPrecision
Else
If oDimStyleLinearPrecision = 41732 Then
LenearPrecision = kThreeDecimalPlacesLinearPrecision
Else
If oDimStyleLinearPrecision = 41733 Then
LenearPrecision = kFourDecimalPlacesLinearPrecision
End If
End If
End If
End If
End Sub
Thanks to your time.
Kalyan