OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 18-11-2004, 11:22
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 New document creation problem

This code is supposed to take info from the form for finished height and width and the sleeve size, and create a document that is (height x2 + sleeve size + .5 inches) in hieght and width is increased by 1 inch

Two problems.
1. The document doesn't get the .5" added to it and
2. The info bar still shows the document as 8.5"x11"
Code:
Option Explicit

Private Sub buttonOK_Click()
    If ValidateParams Then
        CreateVinylStreetBanner.Hide
        CreatePageLayout
    End If
End Sub

Private Function ValidateParams() As Boolean
    ValidateParams = True

    If (IsNumeric(boxWidth.Text) = False) Then GoTo ErrWidth
    If (IsNumeric(boxHeight.Text) = False) Then GoTo ErrHeight
    If (IsNumeric(boxSleeve.Text) = False) Then GoTo ErrSleeve
    Exit Function
    
ErrWidth:
    MsgBox "Spacing not numeric : " & boxWidth.Text
    boxWidth.SetFocus
    ValidateParams = False
    Exit Function
ErrHeight:
    MsgBox "Spacing not numeric : " & boxHeight.Text
    boxHeight.SetFocus
    ValidateParams = False
    Exit Function
ErrSleeve:
    MsgBox "Spacing not numeric : " & boxSleeve.Text
    boxSleeve.SetFocus
    ValidateParams = False
    Exit Function

End Function

Public Sub CreatePageLayout()
    Dim doc As Document
    Dim BrowseOpenFile As String
    Dim OFName As OPENFILENAME
    Dim docH As Long
    Dim docW As Long
    Dim dw As Integer
    Dim dh As Integer
    Dim sl As Integer
    Dim sewn As Integer
    Dim p As Page
    sewn = 0.5
    dw = GetValue(boxWidth.Value)
    dh = GetValue(boxHeight.Value)
    sl = GetValue(boxSleeve.Value)
    docH = dh + dh + sl + sewn
    docW = dw + 1
    Set doc = CreateDocument()
    doc.Unit = cdrInch
    
    'MsgBox "W:" & dw & " H:" & dh & " Sleeve:" & sl
    
    For Each p In ActiveDocument.Pages
        p.Orientation = cdrPortrait
        p.SizeWidth = docW
        p.SizeHeight = docH
        p.PrintExportBackground = False
        p.Bleed = 0#
        p.Background = cdrPageBackgroundNone
    Next p
    
    'MsgBox "path:" & boxFile.Text
    
    If boxFile.Text <> "" Then
        Dim s5 As Shape
        Dim x As Double, y As Double
        Dim nsy As Double
        ActiveLayer.Import boxFile.Text, cdrAutoSense
        Set s5 = ActiveSelection
        s5.Move 0#, 0#
        ActiveDocument.ReferencePoint = cdrCenter
        s5.GetPosition x, y
    End If

End Sub
I'm also adding some guidelines to this document, but that's down the road...
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
  #2  
Old 19-11-2004, 15:34
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

Someone please help. This page size thing is driving me crazy. I finally figured out how to add the extra half an inch to my document.
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
  #3  
Old 20-11-2004, 01:26
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Answered in http://www.oberonplace.com/forum/viewtopic.php?t=775 and locking this topic...
Closed Thread


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
Creating new document problems ddonnahoe Code Critique 2 20-11-2004 18:11
Corel Photo Paint 11 Document Events problem cyrilgupta Corel Photo-Paint VBA 1 07-11-2004 13:51
Document not open... ddonnahoe CorelDRAW/Corel DESIGNER VBA 4 29-10-2004 15:13
Paste and Undo List problem Michael Cervantes Corel Photo-Paint VBA 5 11-09-2004 05:47
Active document issues.. wbochar CorelDRAW/Corel DESIGNER VBA 2 19-03-2003 16:15


All times are GMT -5. The time now is 16:13.


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