Not having knowledge of coding. Recorded a macro for crop marking. The below macro run and create a crop marking. What i was looking to just refine my macro and add a pop-up which show the marking size (mean time its 1mm), some time i need 5mm etc. Below s1.SetSize 0.03937, 0.03937 to change to make marking change.So if i can add a pop-up and mention the value to the marking. Any suggestion or help. Thanks
Sub crop_marking() Dim OrigSelection As ShapeRange Set OrigSelection = ActiveSelectionRange Dim s1 As Shape Set s1 = ActiveLayer.CreateLineSegment(7.184626, 6.420831, 7.184626, 6.095831) s1.Fill.ApplyNoFill s1.Outline.SetPropertiesEx 0.006945, OutlineStyles(0), CreateCMYKColor(0, 0, 0, 100), ArrowHeads(0), ArrowHeads(0), cdrFalse, cdrFalse, cdrOutlineButtLineCaps, cdrOutlineMiterLineJoin, 0#, 100, MiterLimit:=45#, Justification:=cdrOutlineJustificationMiddle Dim crv As Curve Set crv = ActiveDocument.CreateCurve With crv.CreateSubPath(7.184626, 6.095831) .AppendLineSegment 7.184626, 6.420831 .AppendLineSegment 7.451291, 6.420831 End With s1.Curve.CopyAssign crv ActiveDocument.ReferencePoint = cdrCenter s1.SetSize 0.03937, 0.03937 ActiveDocument.CreateShapeRangeFromArray(OrigSelection, s1).AlignAndDistribute 0, 1, 0, 0, False, 2 ActiveDocument.CreateShapeRangeFromArray(OrigSelection, s1).AlignAndDistribute 2, 0, 0, 0, False, 2 Dim s2 As Shape Set s2 = s1.Duplicate s2.Flip 2 ActiveDocument.CreateShapeRangeFromArray(OrigSelection, s2).AlignAndDistribute 0, 2, 0, 0, False, 2 Dim s3 As Shape Set s3 = ActiveDocument.CreateShapeRangeFromArray(s1, s2).group Dim s4 As Shape Set s4 = s3.Duplicate s4.Flip 2 s4.Flip 1 ActiveDocument.CreateShapeRangeFromArray(OrigSelection, s4).AlignAndDistribute 1, 0, 0, 0, False, 2 Dim s5 As Shape Set s5 = ActiveDocument.CreateShapeRangeFromArray(s3, s4).group s5.Move 0.2875, -0.270835 ActiveDocument.UndoEnd Sub
Might have a look at this one. Download and change the extension to.gms Tested to work with 2022 version
CropMarks.zip
Oops, sorry, it's protected. I got it years ago and don't recall where or from whom.
download error
atekdigital said:So if i can add a pop-up and mention the value to the marking.
If you are looking for a way for the macro to communicate something to the user, you might look at the MsgBox function in VBA.
You might also consider setting the marking size as a constant in your macro - near the beginning - so that it's easy to change it in just one place, even if you are using it in multiple places.
Const dblMarkingSize As Double = 0.03937
If you want to communicate that value to the user:
MsgBox "Marking size is " & CStr(dblMarkingSize) & "."
You can also refer to the value in other parts of your code, e.g.:
s1.SetSize dblMarkingSize, dblMarkingSize