OberonPlace.com Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 19-02-2003, 19:58
Aneurysm
Guest
 
Posts: n/a
Default SaveAs function not working in PP11

Hi,

I'm trying to write a function which resizes and saves an image at three different sizes. However, the SaveAs function is not working (seems to be simply ignored). The rest of the script is executed flawlessly. Code follows:

Dim varFileName, varPath, varLargeFile As String
Dim doc As Document
Set doc = ActiveDocument

doc.Layers.All.Merge

doc.DpiX = txtLargeDPIX.Text
doc.DpiY = txtLargeDPIY.Text
doc.Resample 400

varFileName = txtName.Text & ".jpg"
varPath = "C:\temp\"
varLargeFile = varPath & varFileName

doc.SaveAs varLargeFile, cdrJPEG


Is there something that I need to do to the file before I use the SaveAs function? I'm trying to use this on both existing .jpg and .cpt files and neither work. I heard before that when saving files, errors are not displayed, and the opration simply skips the command. Any help with this would be greatly appreciated.

Thank you.

Kai
Reply With Quote
  #2  
Old 19-02-2003, 23:27
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: SaveAs function not working in PP11

Kai,

Document.SaveAs function in PP11 returns a filter object which needs to be used to finish the save operation:

Dim flt As Object
Set flt = doc.SaveAs(varLargeFile, cdrJPEG)
flt.Finish

Or just simply:

doc.SaveAs(varLargeFile, cdrJPEG).Finish

For more information on how to use the filter object returned, please refer to the following article (which was written for Draw 10, but also applies to Draw 11 and Paint 11): http://www.oberonplace.com/vba/exportex.htm

I hope it helps.
Reply With Quote
  #3  
Old 03-03-2003, 17:31
Aneurysm
Guest
 
Posts: n/a
Default SaveAs is working now!!!

Wow!!! Thank you so much. It worked perfectly. I really appreciate your answer, and so does my boss and everyone here at the office that will benefit from this component.
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
Printing Raw Prn Files Mark Code Critique 2 16-09-2004 16:15
Many CorelScript methods not working in PP11 feldgendler Corel Photo-Paint VBA 2 24-04-2004 13:41
Function names Lev Oberon Function Plotter 1 29-08-2003 11:04
takes Draw a long time to start a new document! bbolte CorelDRAW/Corel DESIGNER VBA 5 14-05-2003 09:09
SaveAs Method throwing an in consistent error wbochar CorelDRAW/Corel DESIGNER VBA 1 20-03-2003 14:37


All times are GMT -5. The time now is 19:46.


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