Message 1 of 3
Vba Matchcrop rule

Not applicable
04-01-2021
01:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This Vba code works great with line MsgBox ("Matchcrop") but if i remove the line the code doesn't work.
Can anyone help with this??
Sub MatchCrop_MA()
On Error Resume Next
Dim odoc As Document
Set odoc = ThisApplication.ActiveDocument
oSelectedPriority = odoc.SelectionPriority
odoc.SelectionPriority = kEdgeSelectionPriority
odoc.Update2 (True)
MsgBox ("Matchcrop")
ThisApplication.CommandManager.ControlDefinitions.Item("AppRefreshCmd").Execute2 (True)
Set oitem1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Select first line")
If oitem1 Is Nothing Then
odoc.SelectionPriority = oSelectedPriority
Exit Sub
End If
again:
Set oitem2 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Select second line")
If oitem2 Is Nothing Then
odoc.SelectionPriority = oSelectedPriority
Exit Sub
End If
oitem2.Layer = oitem1.Layer
GoTo again
End Sub