Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-13-2012, 03:26 AM
macropod's Avatar
macropod macropod is offline Can't select shapes via macro Windows 7 64bit Can't select shapes via macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi TishyMouse,

Yes, unless you specify a storyrange (and there are various ways of doing this), Word assumes you're only referring to the main story.

While the selection might not have been the 'problem', your code can be made much more efficient without it:


Code:
Sub ProcessShapes()
Dim DocSource As Document, DocTarget As Document
Dim RngStry As Range, Shp As Shape
Set DocSource = ActiveDocument
Set DocTarget = Documents.Add("Normal")
For Each RngStry In DocSource.StoryRanges
  For Each Shp In RngStry.ShapeRange
    With Shp
      .Copy
      DocTarget.PasteAndFormat (wdPasteDefault)
    End With
  Next
Next
Set DocTarget = Nothing: Set DocSource = Nothing
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
shapes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Select Series Color - Macro judicial85 Excel Programming 0 03-14-2011 02:35 PM
Can't select shapes via macro Where did map shapes go? SueK PowerPoint 1 01-20-2011 04:30 AM
Can't select shapes via macro Find and add new Shapes bonani PowerPoint 1 11-26-2009 06:21 PM
Shapes Will Not Display JoeTx Visio 0 03-13-2008 09:01 AM
My Shapes some appear some don't Jean-Paul Visio 0 03-01-2006 01:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:18 AM.


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