Method 1.
Copy selected shapes to clipboard from Draw and paste them into Paint as
follows:
g_appDraw.ActiveSelection.Copy
g_appPaint.CorelScript.EditPasteObject ...
This 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
Clipboard.Clear, g_appPaint.CorelScript.EditClearClipboard)
Method 2.
Save selected shapes to a file and import them into Paint via the clipboard
as follows:
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:
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!
Dave
P.S.
I also have some general questions about the CorelScript object.
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...
Dim g_appDraw as CorelDRAW.Application
Dim csc as g_appDraw.CorelScript
On the other hand, intellisense doesn't work in the IDE but does work
correctly at runtime if I use the following 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.
"Dave" <dwgra...@mailbag.com> wrote in message news:410a4a4f$1_2@cnews...
> I am having problems transferring objects 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:
> g_appDraw.ActiveSelection.Copy
> g_appPaint.CorelScript.EditPasteObject ...
>
What about activating DRAW Document before you copy.
g_appDraw.ActiveDocument.Activate
g_appDraw.ActiveSelection.Copy
g_appPaint.CorelScript.EditPasteObject ...
It may work. I solved this problem in Paint copying from one Paint document
to another.
--
Michael Cervantes
C-Tech Volunteer