Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Publisher / Programming / August 2007

Tip: Looking for answers? Try searching our database.

"Access Denied" when setting .Name property of previously named Sh

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cory - 29 Aug 2007 14:02 GMT
When referencing a shape by it's name or otherwise, is the .Name prperty
locked so that it cannot be set?  I have some code similar to this:

intCurPageNum = ActiveDocument.ActiveView.ActivePage.PageIndex
For Each shpOverlayShape in ActiveDocument.ActiveView.ActivePage
   strShapeName = Left(shpOverlayShape.Name, 6)
   Select Case strShapeName
         Case "Graphi"
                shpOverlayShape.Name = "GraphicNumber" & CStr(intCurPageNum)
... Lines omitted for brevity ...
   End Select
Next shpOverlayShape
Set shpOverlayShape = Nothing
End Sub

The code is supposed to cycle through the shapes and if the first 6
characters of the name = a preset value, it changes the name to the long form
of that value and the page number.  This allows a different sub that accessed
shapes based on thier name to get the correct shape on a page by repairing
the shape numbers if user changes position of a page.

Any help would be appreciated
Cory
Cory - 29 Aug 2007 18:58 GMT
Actually I figured out what was going on.  I was trying to name a Shape one
one page the same as a Shape on another page.  Undoubtedly all of the shapes
(regardless of which page they are on) are all in the same collection, and
thus no two may have the same name.  So, I created another sub that renames
all of the shapes with temporary names and then renames them with the proper
names.

Cory

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.