OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > Corel Photo-Paint VBA

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 28-07-2004, 17:12
DWGraphics
Guest
 
Posts: n/a
Default Transfer shapes from Draw to Paint; Using CorelScript in VB6

I am having problems transferring object from Draw11 to Paint11 using VB6. I have tried the following methods...

Method 1.

Copy selected shapes to clipboard from Draw and paste them into Paint as follows:

Code:
g_appDraw.ActiveSelection.Copy
g_appPaint.CorelScript.EditPasteObject ...
This is works correctly the first time, but subsequent uses of the ".EditPasteObject" method continue to use the original clipboard contents rather the contents I know I've placed there. I can confirm this because the macro recorder continues to say it's pasting the same temp file (e.g. 0XXX103e.TMP) located in the temp folder. If I copy new shapes to the clipboard in code and paste them manually, I get the proper results, and the temp file increments accordingly (eg 0XXX103f.TMP). If I copy new objects to the clipboard in code and paste them in code, the temp file does not increment, and the contents off the 0XXX103e.TMP file get dumped in again and again and again. ARRGGG!

Also, I've tried the following methods of clearing the clipboard first, without success

Code:
Clipboard.Clear, g_appPaint.CorelScript.EditClearClipboard)
Method 2.

Save selected shapes to a file and import them into Paint via the clipboard as follows:

Code:
g_appDraw.ActiveDocument.SaveAs sFileSpec, savOpts g_appPaint.CorelScript.EditPasteFromFile ...
I am able to get the file's contents into the Paint file (GIF format), but only at one size. Despite saving the CDR selection at various sizes, and regardless of the parameters I pass to the EditPasteFromFile method, I always get the same resulting image size. ARRGGG!


Method 3.

Save selected shapes to a file and import them into Paint via the clipboard as follows:

Code:
g_appDraw.ActiveDocument.SaveAs sFileSpec, savOpts
g_appPaint.CorelScript.FileImport sFileSpec...
Again, I am able to get the file's contents into the Paint file (GIF format), but only at one size, and regardless of the parameters I pass to the FileImport method. This is even true when my parameters exactly match those displayed in the Recorder docker when I perform the function manually. ARRGGG!

I've searched, newsgroups, the Oberon site, the Internet, and all the VBA html & pdf files that come with v11. Either v11 has some bugs in these areas or I'm missing the boat somewhere.

HELP!



Also, is there a way to reference the CorelScript object in VB6 so intellisense works? I've tried this, but it throws an error at runtime...

Code:
Dim g_appDraw as CorelDRAW.Application
Dim csc as g_appDraw.CorelScript
On the other hand, intellisense doesn't work in the IDE but the code works correctly at runtime if I use the following syntax....

Code:
Dim g_appDraw as CorelDRAW.Application
g_appDraw.CorelScript.Whatever
I get intellisense for the g_appDraw object, but nothing when I hit the period after CorelScript.

Thanks in advance for any replies

Dave
DWGraphics
Reply With Quote
 


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
Generic code to process all shapes in a document glennwilton CorelDRAW/Corel DESIGNER VBA 0 05-09-2003 03:13


All times are GMT -5. The time now is 01:31.


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