Excel VBA Align two shapes to the right with smooth transition - vba

When I click on two shapes of different sizes, then click Align Right, Excel 2013 smoothly slides the smaller shape to the right to match the location with the other shape. Is there a way to use/harness that smooth transition with Excel VBA? I've tried the code Selection.ShapeRange.Align mslAlignRights, MSOFalse after selecting the two shapes but it instantly jumps to the right. It works, but it's not animated like I want.

Related

Is there a VBA function to copy a shape picture to the background?

I'm struggling with VBA in PowerPoint. I have many vertical portrait photos in my slides. I want to change the background of the slide to the specific portrait (and make it blur), to get rid of the white borders. Manually it’s quite simple per slide, just copy the photo object, go to Format Background, change the fill to picture or texture fill and click under picture source for “Clipboard”. Then choose under artistic effects for blur.
I want to automate these steps for all slides by using VBA, because there are so many pictures changing every month.
I tried the “.Shapes("Portrait").Copy” function, but there is no paste in the .Background.Fill.UserPicture I think.
I tried the following, but that doesn’t work:
Sub ChangeBackground()
With ActiveWindow.Selection.SlideRange
.Shapes("Portrait").Copy
.FollowMasterBackground = msoFalse
'.Background.Fill.UserPicture ("C:\temp\test.jpg")
.Background.Fill.UserPicture .Shapes("Portrait").Copy
.Background.Fill.PictureEffects.Insert msoEffectBlur
End With
End Sub
Do you have any idea if this is even possible?
I don’t want to select a file from disk, because the portraits are not stored on disk.

Set One Slide Size/Orientation Without Changing Whole Presentation in PowerPoint using VBA [duplicate]

Making a powerpoint that's supposed to show a before and after of a website. Since it's currently a long website I'd rather make a single long slide to put it on (20" instead of 7.5"). But all the other slides in the presentation should be normal-sized.
I found Slide Size (Design ribbon, Customize section) but that resizes ALL slides.
You can't. You can only have one slide size and one orientation per presentation.
Are you projecting the presentation or delivering it on a laptop?
If so, the size is sort of irrelevant.
Regardless of the slide size, the projected/displayed image will never be longer or wider than the projector/display accepts.
Although you cannot use different sized slides in one PowerPoint file, for the actual presentation you can link several different files together to create a presentation that has different slide sizes.
The process to do so is as follows:
Create the two Powerpoints (with your desired slide dimensions)
They need to be properly filled in to have linkable objects and selectable slides
Select an object in the main PowerPoint to act as the hyperlink
Go to "Insert -> Links -> Action"
Select either the "Mouse Click" or the "Mouse Over" tab
Select "Hyperlink to:" and in the drop down menu choose "other PowerPoint Presentation"
Select the slide that you want to link to.
Any slide that isn't empty should appear in the "Hyperlink to Slide" dialog box
Repeat the Process in the second Presentation to link back to your main presentation
Reference to Office Support Page where this solution was first posted.
https://support.office.com/en-us/article/can-i-use-portrait-and-landscape-slide-orientation-in-the-same-presentation-d8c21781-1fb6-4406-bcd6-25cfac37b5d6?ocmsassetID=HA010099556&CorrelationId=1ac4e97f-bfe6-47b1-bab6-5783e78d126d&ui=en-US&rs=en-US&ad=US
True you can't have different sized slides. NOT true the size of you slide doesn't matter. It will size it to your resolution, but you can click on the magnifying icon(at least on PP 2013) and you can then scroll in all directions of your slide in original resolution.
if you want to shrink one slide for instance, add shapes to hide the unwanted background margins. you can set the shape color filling as the background (gray or black).
It's "ugly" but it works
true, this option is not available in any version of MS ppt.Now the solution is that You put your different sized slide in other file and put a hyperlink in first file.

Nature of Excel 2010 VBA Embedded Chart Container

I searched Google and on many different forums but cannot find the Physical Nature (I don't know to say it) of an Embedded Chart's container window, I mean the canvas like rectangular area which serves as, well, the chart container.
I know that it is a ChartObject.
The main clarifications that I needed is:
Is it a Shape as in Autoshape or Freeform shape? (I suspect so)
It does show up as a shape in Selection Pane.
Copy/Pasting Freeform shapes onto it causes pasted shapes to stick onto it while doing the same with any other two shapes won't stick to each other.
Is it a Userform? (I am skeptical)
But Userforms are always in front of the shapes and shapes cannot be pasted onto userforms obviously.
The ChartObject is also a Shape that can be reached via the Shapes collection.
?Sheet1.Shapes("Chart 1").Type = msoShapeType.msoChart
True

Powerpoint VBA Positioning listview

I am trying to get 2 listview objects to work on a powerpoint slide. I can place them anywhere on the slide, but when I start the slideshow, 2 smaller copies appear in the upper-left corner. Text added to the listview appear in the upper-left boxes. I can't select the original listview either.
How can I prevent the 2 copies from showing up so I can work with the listviews I positioned on the slide?
The slide
http://prnt.sc/ectyx6
The Slideshow
http://prnt.sc/ectz8u
I looked into it a bit, and I think it's just a glitch with the Listview control.
From my tests, the actual Listview control was smaller then the original, but the top left position was correct (after the first time in reading/presentation view). I assume the they are smaller because it doesn't have a zoom property, and the slide is stretched to fit the window.
If you really want a Listview...which I hate to call into question, but think is warranted...then you can just Insert a Rectangle without a border over the Listview control to hide the original placeholder. The real Listview will still get drawn on top.
I think this is just the beginning of your troubles with a Listview control in PowerPoint...are you sure that you need it. Maybe linking to an Excel file with the Listview would be better, or some use of animation.

Copying shapes between PowerPoint 2007 presentations along with their animations

I programmatically copy the shapes of an entire slide to a new slide in another presentation by performing origShape.Copy and then newSlide.Shapes.Paste().
(copy/paste the entire slide is unfortunately not an option for me here)
My problem is that Animation effects get really warped. Some are lost, others appear in the wrong order.
I thought that maybe after copying all the shapes I'll go over origSlide.TimeLine and will copy each animation effect to newSlide.TimeLine with the corresponding Shapes.
Is there a way of copying Animation effects between shapes without manually setting each and every parameter? (there are LOTS of these).
When copying shape-by-shape to a new slide, naturally the order of the animations gets ruined.
If we had for example the following animation sequence:
Rectangle flying in
Triangle flying in
Rectangle flying out
And we copy first the Rectangle and then the Triangle to a new slide, we'll get first both animations of the rectangle and then of the triangle.
My mistake was trying to solve this disorder by using Shape.AnimationSettings.
BEWARE OF SHAPE.ANIMATIONSETTINGS!!
This Property is kept only for backward compatibility with old versions of PowerPoint. If you modify any of its fields, all animations of a shape except the first one get AUTOMATICALLY ERASED !
So, the solution is this:
Copy shape by shape to new slide (no animations are lost, just mis-ordered). Then use Slide.TimeLine to go over the animation Effects and order them correctly using Effect.MoveTo, or Sequence.Clone and Effect.Delete.