![]() |
#1
|
|||
|
|||
![]()
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 |
#2
|
||||
|
||||
![]()
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. |
#3
|
|||
|
|||
![]()
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.
![]() |
![]() |
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 |
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 |