Hi
how can I creat a macro to delete all horizontal lines?
Thanks
Sub Delete_H_Lines()Dim sr As ShapeRange, s As Shape, h#ActiveDocument.BeginCommandGroup "Delete_H_Lines"Optimization = TrueActivePage.Shapes.All.AddToSelectionSet sr = ActiveSelectionRangeFor Each s In srIf s.SizeHeight <= 0.001 Thens.DeleteEnd IfNext sActiveDocument.EndCommandGroupOptimization = False ActiveWindow.RefreshEnd Sub
This is assuming all lines are perfectly horizontal. Rotated even the slightest or 1 node not on the same plane as the other would have a height and therefore wouldn't be deleted.
i wanted to stay just with the lines upright, so to erase the others i did a If s.sizeHeight<>0 and s.sizeWidth<>0 but lays the program down