Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-07-2012, 11:48 AM
By Sal By Sal is offline animation and line movement Windows 7 32bit animation and line movement Office 2010 32bit
Novice
animation and line movement
 
Join Date: Dec 2012
Posts: 1
By Sal is on a distinguished road
Default animation and line movement

Hello everyone, and the first time I write here, and I ask for a information on a animation.



Let's say I have a rectangular shape that must move from right to left, I go to Animations and choose the horizontal line and the extension to determine the displacement.

my question is, if I want to determine that the line is 15cm long what I can do to determine the length of the line of movement is of Xcm, rather than lengthen or decrease it manually, which never comes to precision inserting 15cm or 16cm could determine with precision displacement.

There is the possibility of such determination. or code to enter.

A greeting and thanks in advance to those who will give me a feedback.

Hello By Sal (8-D)
Reply With Quote
  #2  
Old 12-11-2012, 04:47 AM
JohnWilson JohnWilson is offline animation and line movement Windows 7 64bit animation and line movement Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Unfortunately this is not simple to understand and you really need to understand VML paths.

Here's the code to move left (or right with postive values) in code by a set amount.

The VML Path is
M= Motion
0 0 From current position
L=Line
amount left measures in fractions of slide width
amount up and down in fractions oof slide height
E=End

Try this with various values and make sure the rectangle is selected.

Sub Left_xx()
Dim oshp As Shape
Dim oeff As Effect
Dim osld As Slide
Dim swCm
Dim HowFarLeft As Single

HowFarLeft = 7 'change this

swCm = Points2cm(ActivePresentation.PageSetup.SlideWidth)
If ActiveWindow.Selection.ShapeRange.Count <> 1 Then Exit Sub
Set oshp = ActiveWindow.Selection.ShapeRange(1)
Set osld = oshp.Parent
Set oeff = osld.TimeLine.MainSequence.AddEffect(oshp, msoAnimEffectPathLeft, msoAnimateLevelNone, msoAnimTriggerOnPageClick)
oeff.Behaviors(1).MotionEffect.Path = "M 0 0 L " & CStr(-(HowFarLeft / swCm)) & " 0 E"
End Sub



Function Points2cm(inVal As Single) As Single
Points2cm = inVal / 28.346
End Function
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you extend line down the trend line to the x axis? madoka Excel 0 11-01-2012 09:18 PM
animation and line movement I indent second line and the first line indents, help. DerekUD Word 1 05-06-2011 11:26 PM
animation and line movement Line breaks at each line in Web text ahazelwood Word 5 01-06-2011 02:37 PM
A macro to mirror the movement of the cursor ACA Word VBA 0 08-24-2010 03:21 PM
animation and line movement Movement slide with excel sheets majed PowerPoint 4 01-17-2009 04:24 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:53 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft