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 02-02-2004, 11:39
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default Export each page with a diff. file name

I am writing a script that will cycle through each page of the active document and show a user form for each page to allow the user to enter a different name for each pages exported contents. I am exporting each page to JPG, but for some reason it only does the first page and then stops. I'm scratching my head as we speak. I thought this would be a fairly easy task, I must just be doing some thing wrong.

The first part of the code is a module that is attached to a command button icon...
Code:
Public Sub JPGfromCurrent()
    Dim idx As Long, i As Long
    Dim doc As Document
    Dim p As Page
    Set doc = ActiveDocument
    idx = doc.ActivePage.Index
    For i = idx To doc.Pages.Count
        Set p = doc.Pages(i)
        Load frmJPGfromCurrent
        frmJPGfromCurrent.Show
    Next i
End Sub
The second part is the actual form that is supposed to be displayed for each page.
Code:
Sub cmdGo_Click()
    Me.Hide
    Dim JF As ExportFilter
    Dim d1 As Document
    Set JF = Nothing
    Set d1 = ActiveDocument
    
        Dim sx As Double, sy As Double
        ActivePage.Shapes.All.GetSize sx, sy
        Set JF = d1.ExportBitmap("c:\Documents and Settings\Artist\Desktop\" & txbFile.Text & _
        ".jpg", cdrJPEG, cdrCurrentPage, cdrRGBColorImage, sx * 216 / sy, 216, 72, 72)
    
    With JF
        .Compression = 0
        .Optimized = True
        .Smoothing = 0
        .SubFormat = 1
        .Progressive = False
        .Finish
    End With
    Set JF = Nothing
    
    'Unload Me
End Sub

Sub UserForm_initialize()
    ActiveWindow.ActiveView.ToFitAllObjects
End Sub
Private Sub cmdCancel_Click()
    Unload Me
End Sub
Private Sub testarea()
    
End Sub
I'm hoping someone will look at this and instantly see what I may have missed.
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #2  
Old 02-02-2004, 12:04
Seelenquell
Guest
 
Posts: n/a
Default

Hi,

with this code you are exporting only the actual page i think..
Set JF = d1.ExportBitmap("c:\Documents and Settings\Artist\Desktop\" & txbFile.Text & ".jpg", cdrJPEG, cdrCurrentPage, cdrRGBColorImage, sx * 216 / sy, 216, 72, 72)

am i wrong or should you go for all pages in a 'for' or 'for each' - loop?

know what i mean?

as i interprete the code you are only on the current page, so the code stops just at this page.. (?)

best regards,

Silv R.
Reply With Quote
  #3  
Old 02-02-2004, 12:31
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

That is partially correct, What I want to do is cycle page by page, when I get to the next page i want the form to show again so i can type a new file name for that page and then cycle to the next page and show the user form again and so on to the end of the document.
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #4  
Old 02-02-2004, 15:40
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

You have to activate the page before you export:

Code:
Dim p As Page
For Each p In ActiveDocument.Pages
    p.Activate
    frmJPGfromCurrent.Show vbModal
Next p
I think this should help.
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
Automatic Catalog Page Creator Export to .PDF format logoguy New product ideas 1 24-06-2008 19:51
Importing only 1st page from a multipage CDR mecanomaniaco CorelDRAW/Corel DESIGNER VBA 3 28-02-2005 18:21
File Convertor to do transpararent TIFFs dan CorelDRAW/Corel DESIGNER VBA 8 22-12-2004 14:23
Open - Resize - Savefile in Photo Paint greenee Corel Photo-Paint VBA 2 28-06-2003 04:54
Export text file from corel sript?! ceda CorelDRAW CS 0 06-06-2003 05:19


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


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