OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 15-05-2008, 21:05
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default Problems with replace

Hello, either CorelDraw is having a bad day or I am and I can't figure out which. Coreldraw is returning an error on this code and I don't know why:

Code:
Sub replaceTest()

Dim p As Page

For Each p In ActiveDocument.Pages

    p.Name = replace(p.Name, "a", "z")

Next p

End Sub
CorelDraw is giving me a compile error on replace - wrong number or arguments or invalid property assignment. What am I doing wrong?

Thanks,

Chris (Hunt)
Reply With Quote
  #2  
Old 15-05-2008, 21:40
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,788
Blog Entries: 12
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default try adding...

Try adding
Code:
p.Activate
-Shelby
Reply With Quote
  #3  
Old 15-05-2008, 22:35
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default

Thanks for the reply, Shelby. Unfortunately I'm still getting the error. It's as if vba is broken.

Chris
Reply With Quote
  #4  
Old 23-05-2008, 20:19
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Chris,

It's probably because your "Page" object is actually VBA's Page control. You probably should add:

Dim p As CorelDRAW.Page

That should resolve the naming conflict...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace color admold CorelDRAW/Corel DESIGNER VBA 4 18-08-2008 19:04
How to import values from a file, replace text,save file for each value with new name amaart CorelDRAW/Corel DESIGNER VBA 1 28-09-2007 13:41
Weird problems of CDX3 geHucKa General 3 07-06-2007 18:50
Eps Export Problems bloodgroove General 6 10-04-2006 23:07
problems exporting bloodgroove General 2 27-01-2006 08:01


All times are GMT -5. The time now is 12:26.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com