![]() |
#1
|
|||
|
|||
![]()
I want to rename objects from page names if the page name contains a space. Can anyone tell me why this isn't working:
Code:
Sub SetObjectNamesFromPageNames() Dim p As Page Dim s As Shape For Each p In ActiveDocument.Pages If InStr(p.name, " ") > 1 Then selectImagesLayer SelectAllImages Set s = ActiveSelection s.Group s.ObjectData("Name") = p.name End If Next p End Sub |
#2
|
|||
|
|||
![]() Code:
Sub SetObjectNamesFromPageNames() Dim p As Page Dim s As Shape For Each p In ActiveDocument.Pages If InStr(p.name, " ") > 1 Then set s = p.Shapes.FindShapes(, cdrBitmapShape).Group ' or s = p.Layers('your image layer').Shapes.FindShapes(, cdrBitmapShape).Group s.Name= p.name End If Next p End Sub |
#3
|
|||
|
|||
![]()
Thanks but with that code I get an "Object variable or with block variable not set" error message for:
Code:
s.name = p.name |
#4
|
|||
|
|||
![]()
Further investigation has revealed that there is a problem using p.name. if I put the page name into a string variable and use that it works. I suspect some bug with the version of X6 I am using (no service packs). Thanks for your help.
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Copy page names to clipboard? | knowbodynow | CorelDRAW/Corel DESIGNER VBA | 0 | 08-04-2014 09:54 |
Get page names from closed document | knowbodynow | CorelDRAW/Corel DESIGNER VBA | 1 | 17-07-2010 00:38 |
Change Page Names | bprice | CorelDRAW/Corel DESIGNER VBA | 1 | 02-07-2008 14:44 |
replacing page names | knowbodynow | CorelDRAW/Corel DESIGNER VBA | 8 | 25-04-2007 18:01 |
ObjectData Fields | shelbym | CorelDRAW/Corel DESIGNER VBA | 1 | 02-04-2004 08:19 |