One can easily add or edit pictures by adding attractive picture effects as it can be done with other applications. It also comes with various built in applications that are good for various versions of Windows.ĭue to its various advantages, good painters can create beautiful pictures with special effects. Wide range of colors, fonts and combinations option with color make it a great choice for the users to make and edit pictures. The various editing tools such as cropping, resizing and rotating help in manipulating images. It's simple drawing tool help to draw pictures on the blank space or on existing image. It's features like ease to use and simplicity has made it so popular among the people. It is also used to add text to the images. In the above routine, the currentApp class holds the runtime info on any current selection.MS paint is one of the widest programs of Microsoft used for creating and editing pictures at the computer. Left:=s.Left + offset, Top:=s.Top + offset, _ Offset = 10 End If Set shp = (Type:=msoShapeRectangle, _ VbExclamation, " Office Tools" Else Dim fname As Stringįname = Environ( " Temp") & " \tmpimagename.jpg" ' Debug.Print "exporting image to: " & fname MsgBox " Selected object is not an image or picture", _ If currentApp.SelectedShapes Is Nothing Then Exit Sub If msoPicture Then
Lastly, I clean up the temp image file.Ĭopy Code ' VBA code: Private Sub makeTransp(keepOriginal As Boolean) Depending on the switch keepOriginal I delete the original picture. The user him/herself can then go to the properties of the new shape and tweak the transparency further. Subsequently, I fill the new shape with the image from the file and put the fill's transparency to 50%. As is the custom with pictures, I lock the AspectRatio by default. Depending on the switch to keep the original picture or not, I offset the new shape by 10 units. Once the picture has been exported, I create a new shape on the current slide with AddShape using the dimensions of the original picture. The reason for this is the fact that a newly created (rectangle) shape can only be filled using fillmode ' UserPicture'.
If the routine finds a usable picture, it will export the shape to a temp image file. If this isn't the case, the sub exits silently or with a warning.
In the code snippets following the core routine, I'll show how to set up the trapping of the selection events in PowerPoint.įirst, the routine will check if there are any shapes selected and, secondly, if the first selected shape is of type msoPicture. The code looks for a current selection of shapes in Powerpoint. I run the routine from a button from a custom ribbon.
The core routine is a sub which acts on a selected object in PowerPoint (working for versions 20) called makeTransp(keepOriginal As Boolean ) in a code module. I have the code running from a button in a ribbon to work on a selected picture in a PowerPoint slide:īut the code should work with any shape from the ShapeCollection in any MSOffice app.
In this tip, I'll show how to use simple VBA to achieve this. Unless you are prepared to paste the picture into a rectangle shape and use the fill command 'paste from clipboard', there is no way to do it. I have often wondered why you cannot simply set the transparency of a picture you paste in PowerPoint.