Create simple moving code that can move all my page objects up or down in once but now i want to work with a command button and a text box dont know how to linked them i checked out tutorials but cant able to understand them please help to understand them
Sub move() Dim p As Page, s As Shape, sr As ShapeRange ActiveDocument.BeginCommandGroup "undo" Dim i& For i = 1 To ActiveDocument.Pages.Count ActiveDocument.Pages(i).Shapes.All.move 0#, 0.069 Next i ActiveDocument.EndCommandGroup End Sub
See my comments in this thread about the tutorials that John so kindly provided.
Within just a few lessons, he will have you making a VBA form that has a textbox and a command button.
Sorry; wrong link. I meant to refer to my comments in this thread.
paraggoyal said:i think you are talking about John gdg lessons right ?
Yes, I am referring to those.
You don't have to go very far in those lessons before John introduces VBA forms, textboxes, and commandbuttons.
i am learner please help
trying to create this but still not getting that
please help and show me where i am making mistake i want to create a up and down macro that can move my design up, down, left and right in single click on all page.
moveupdown.gms
OK, here is some help.
When you have something such as "dim dmove as ..." you are declaring the type of the variable dmove. In this case, you want the type to be Double. So, change it to:
Dim dmove As Double
to declare dmove as the double precision type.
When you are using .move, you need to give it two distances: the distance in X and the distance in Y. The VBA editor can show you, while you are typing, that Move is expecting two numbers:
Since you want to move things up or down, you could specify a distance of 0 for DeltaX. So, change it to:
ActiveDocument.Pages(i).Shapes.All.move 0, dmove
moveupdown1.gmsCANT ABLE TO MOVE LEFT AND RIGHT. ERRORS COMING UP
paraggoyal said: (Please visit the site to view this file)CANT ABLE TO MOVE LEFT AND RIGHT. ERRORS COMING UP
(Please visit the site to view this file)CANT ABLE TO MOVE LEFT AND RIGHT. ERRORS COMING UP
Move requires two arguments:
Your code has a line that reads
ActiveDocument.Pages(i).Shapes.All.Move 0, 0, dmove1
which does not have the correct number of arguments for Move. That is what causes the error.