Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 05-20-2014, 04:54 AM
JohnWilson JohnWilson is offline Copy format, size, location Windows 7 64bit Copy format, size, location Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,913
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Try:

Dim sngL As Single
Dim sngT As Single
Dim sngH As Single
Dim sngW As Single

Sub Pick_Up_Format()
'picks up format of selected shape
Dim oshp As Shape
On Error Resume Next
Err.Clear
Set oshp = ActiveWindow.Selection.ShapeRange(1)
If Err <> 0 Then
MsgBox "Select a shape!"
Else
sngL = oshp.Left
sngT = oshp.Top
sngW = oshp.Width
sngH = oshp.Height
oshp.PickUp
End If
End Sub

Sub Apply_Format()
' Apply to all selected shapes
Dim oshp As Shape
On Error Resume Next
Err.Clear
If sngH = 0 And sngW = 0 Then
MsgBox "Pick up format first."
Exit Sub
End If
For Each oshp In ActiveWindow.Selection.ShapeRange
If Err <> 0 Then
MsgBox "Select a shape!"
Else
oshp.Apply
oshp.Left = sngL
oshp.Top = sngT
oshp.Width = sngW
oshp.Height = sngH
End If
Next oshp
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy table to another location in the same document Sektor Word VBA 2 03-31-2014 09:28 PM
Copy format, size, location VBA to copy bookmark to a new location kent Word VBA 5 06-14-2012 02:18 PM
Copy format, size, location Copy & Paste Shapes & Motion Paths from 1 Slide Size to Another buckaroobanzai PowerPoint 1 06-08-2012 05:32 AM
Format template to allow user typing to jump to a new location dan28029 Word 2 02-13-2012 06:35 AM
Window Location & Size Ringmaster Outlook 0 09-14-2010 02:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:06 PM.


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