how to set dimension extension overhang and distance from object

Hi.  Can someone check this code and let me know if this is possible?

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
    Dim OrigSelection As ShapeRange
    Set OrigSelection = ActiveSelectionRange
    ActiveDocument.BeginCommandGroup
    OrigSelection(2).Style.StringAssign "{""dimension"":{""overhang"":""0"",""centerText"":""1"",""horizontalText"":""0"",""boxAroundText"":""0"",""textStyle"":""1"",""textPlacement"":""0"",""precision"":""4"",""units"":""0"",""useDefaultAnchorGap"":""1"",""angularUnits"":""1"",""showUnits"":""1"",""showLeadingZero"":""0"",""useDefaultOverhang"":""1"",""dynamicText"":""1"",""reverseTerminators"":""0"",""anchorGap"":""0"",""hideGapOnFreeExtension"":""1"",""radialTextAboveLine"":""0"",""labelGap"":""0"",""suffix"":"""",""useDefaultReverseTerminatedLength"":""1"",""radialInsideOutside"":""0"",""radialSymbol"":""4"",""hideCDWhenReverseTerminated"":""0"",""showInnerExtensionLines"":""1"",""prefix"":"""",""useDefaultLabelGap"":""1"",""showExtLines"":""1"",""dimetricSymbol"":""6"",""reverseTerminatedLength"":""0"",""autoReverseTerminator" & _
                "s"":""1"",""includeCDReverseTerminated"":""0""},""character"":{""latin"":{""script"":""0"",""charset"":""0"",""weight"":""64"",""font"":""Verdana"",""underline"":""0"",""overline"":""0"",""effect"":""0"",""italic"":""0"",""size"":""35277"",""strikeout"":""0""},""v_shift"":""0"",""RTL"":{""script"":""0"",""charset"":""178"",""weight"":""64"",""font"":""Arial"",""underline"":""0"",""overline"":""0"",""effect"":""0"",""italic"":""0"",""size"":""35277"",""strikeout"":""0""},""h_shift"":""0"",""farEast"":{""script"":""0"",""charset"":""129"",""weight"":""64"",""font"":""Malgun Gothic"",""underline"":""0"",""overline"":""0"",""effect"":""0"",""italic"":""0"",""size"":""35277"",""strikeout"":""0""},""fill"":{""primaryColor"":""CMYK100,USER,191,173,167,230,100,00000000-0000-0000-0000-000000000000""" & _
                ",""type"":""1"",""secondaryColor"":""CMYK,USER,0,0,0,0,100,00000000-0000-0000-0000-000000000000""},""angle"":""0"",""outline"":{""color"":""CMYK,USER,80,40,0,20,100,00000000-0000-0000-0000-000000000000"",""width"":""0""}},""paragraph"":{""justify"":""2""},""fill"":{""primaryColor"":""CMYK,USER,0,0,0,100,100,00000000-0000-0000-0000-000000000000"",""secondaryColor"":""CMYK,USER,0,0,0,0,100,00000000-0000-0000-0000-000000000000""},""outline"":{""leftArrow"":""|0"",""rightArrow"":""|0"",""color"":""CMYK255,USER,0,0,0,255,100,cccd19cb-4675-4a5e-8bda-d0bbbaab8af0"",""width"":""762""}}"
    OrigSelection(2).Style.StringAssign "{""dimension"":{""overhang"":""0"",""centerText"":""1"",""horizontalText"":""0"",""boxAroundText"":""0"",""textStyle"":""3"",""textPlacement"":""0"",""precision"":""3"",""units"":""0"",""useDefaultAnchorGap"":""1"",""angularUnits"":""1"",""showUnits"":""1"",""showLeadingZero"":""0"",""useDefaultOverhang"":""1"",""dynamicText"":""1"",""reverseTerminators"":""0"",""anchorGap"":""0"",""hideGapOnFreeExtension"":""1"",""radialTextAboveLine"":""0"",""labelGap"":""1"",""suffix"":"""",""useDefaultReverseTerminatedLength"":""1"",""radialInsideOutside"":""0"",""radialSymbol"":""4"",""hideCDWhenReverseTerminated"":""0"",""showInnerExtensionLines"":""1"",""prefix"":"""",""useDefaultLabelGap"":""1"",""showExtLines"":""1"",""dimetricSymbol"":""6"",""reverseTerminatedLength"":""0"",""autoReverseTerminator" & _
                "s"":""1"",""includeCDReverseTerminated"":""0""},""character"":{""latin"":{""script"":""0"",""charset"":""0"",""weight"":""64"",""font"":""Verdana"",""underline"":""0"",""overline"":""0"",""effect"":""0"",""italic"":""0"",""size"":""35277"",""strikeout"":""0""},""v_shift"":""0"",""RTL"":{""script"":""0"",""charset"":""178"",""weight"":""64"",""font"":""Arial"",""underline"":""0"",""overline"":""0"",""effect"":""0"",""italic"":""0"",""size"":""35277"",""strikeout"":""0""},""h_shift"":""0"",""farEast"":{""script"":""0"",""charset"":""129"",""weight"":""64"",""font"":""Malgun Gothic"",""underline"":""0"",""overline"":""0"",""effect"":""0"",""italic"":""0"",""size"":""35277"",""strikeout"":""0""},""fill"":{""primaryColor"":""CMYK100,USER,191,173,167,230,100,00000000-0000-0000-0000-000000000000""" & _
                ",""type"":""1"",""secondaryColor"":""CMYK,USER,0,0,0,0,100,00000000-0000-0000-0000-000000000000""},""angle"":""0"",""outline"":{""color"":""CMYK,USER,80,40,0,20,100,00000000-0000-0000-0000-000000000000"",""width"":""0""}},""paragraph"":{""justify"":""2""},""fill"":{""primaryColor"":""CMYK,USER,0,0,0,100,100,00000000-0000-0000-0000-000000000000"",""secondaryColor"":""CMYK,USER,0,0,0,0,100,00000000-0000-0000-0000-000000000000""},""outline"":{""leftArrow"":""|0"",""rightArrow"":""|0"",""color"":""CMYK255,USER,0,0,0,255,100,cccd19cb-4675-4a5e-8bda-d0bbbaab8af0"",""width"":""762""}}"
    OrigSelection(2).Style.StringAssign "{""dimension"":{""overhang"":""0"",""centerText"":""1"",""horizontalText"":""0"",""boxAroundText"":""0"",""textStyle"":""3"",""textPlacement"":""0"",""precision"":""3"",""units"":""0"",""useDefaultAnchorGap"":""1"",""angularUnits"":""1"",""showUnits"":""1"",""showLeadingZero"":""0"",""useDefaultOverhang"":""1"",""dynamicText"":""0"",""reverseTerminators"":""0"",""anchorGap"":""0"",""hideGapOnFreeExtension"":""1"",""radialTextAboveLine"":""0"",""labelGap"":""1"",""suffix"":"""",""useDefaultReverseTerminatedLength"":""1"",""radialInsideOutside"":""0"",""radialSymbol"":""4"",""hideCDWhenReverseTerminated"":""0"",""showInnerExtensionLines"":""1"",""prefix"":"""",""useDefaultLabelGap"":""1"",""showExtLines"":""1"",""dimetricSymbol"":""6"",""reverseTerminatedLength"":""0"",""autoReverseTerminator" & _
                "s"":""1"",""includeCDReverseTerminated"":""0""},""character"":{""latin"":{""script"":""0"",""charset"":""0"",""weight"":""64"",""font"":""Verdana"",""underline"":""0"",""overline"":""0"",""effect"":""0"",""italic"":""0"",""size"":""35277"",""strikeout"":""0""},""v_shift"":""0"",""RTL"":{""script"":""0"",""charset"":""178"",""weight"":""64"",""font"":""Arial"",""underline"":""0"",""overline"":""0"",""effect"":""0"",""italic"":""0"",""size"":""35277"",""strikeout"":""0""},""h_shift"":""0"",""farEast"":{""script"":""0"",""charset"":""129"",""weight"":""64"",""font"":""Malgun Gothic"",""underline"":""0"",""overline"":""0"",""effect"":""0"",""italic"":""0"",""size"":""35277"",""strikeout"":""0""},""fill"":{""primaryColor"":""CMYK100,USER,191,173,167,230,100,00000000-0000-0000-0000-000000000000""" & _
                ",""type"":""1"",""secondaryColor"":""CMYK,USER,0,0,0,0,100,00000000-0000-0000-0000-000000000000""},""angle"":""0"",""outline"":{""color"":""CMYK,USER,80,40,0,20,100,00000000-0000-0000-0000-000000000000"",""width"":""0""}},""paragraph"":{""justify"":""2""},""fill"":{""primaryColor"":""CMYK,USER,0,0,0,100,100,00000000-0000-0000-0000-000000000000"",""secondaryColor"":""CMYK,USER,0,0,0,0,100,00000000-0000-0000-0000-000000000000""},""outline"":{""leftArrow"":""|0"",""rightArrow"":""|0"",""color"":""CMYK255,USER,0,0,0,255,100,cccd19cb-4675-4a5e-8bda-d0bbbaab8af0"",""width"":""762""}}"
ActiveDocument.EndCommandGroup
Parents
  • You could try something like this:

    OrigSelection(2).Style.GetProperty("dimension").SetProperty "overhang", "50000"

    The value is big there because it is in "tenth microns" (1/10 micrometer).

    I don't really know what type of value it is expecting; seems to work if I supply a string or a long value.

    For the "distance from object", instead of "overhang", it would be "anchorGap".

Reply Children
No Data