Copyright: (c) 2002 Corel Corporation. All rights reserved.
Citation: ' (c) 2002 Corel Corporation. All rights reserved.


# VBA$ VBA> main


Legend

  Default property

  Read-Only property


Legend

  Default method


Getting Started with VBA

Visual Basic® for Applications (VBA) is an object-oriented programming language that lets you create VBA macros to automate tasks. You can, for example, create a macro in WordPerfect that changes the color of the headings. CorelDRAW 11 includes version six of the VBA programming language.

VBA is an event-driven programming language. Most of the code you create is written to respond to an event. An event is an action that is recognized by VBA; for example, clicking a button or choosing an option from a list box. Unlike traditional procedural programming, in which the program starts at the first line and executes line by line, event-driven programming executes code in response to events.

All events in the application are code placeholders. It is up to you to code the response. All events are called in response to a specific action. When an action occurs, the appropriate event will be called and the code located within the event is executed. You can create simple or complex events. You can code a single line that displays a message box or write an entire procedure that interacts with a database.

What is Visual Basic for Applications?

What is event-driven programming?

What is the difference between VB, VBA, and VBScript?

VBA and Corel SCRIPT

Working in the VBA Editor

Using VBA macros

VBA Programming Guide

Sample macros


What is Visual Basic for Applications?

Visual Basic for Applications (VBA) is a subset of the Microsoft Visual Basic (VB) object-oriented programming environment. VBA uses the Visual Basic Editor interactive development environment and the VB programming language to enhance applications by manipulating the application's objects, exposed by its object model. VBA can access other applications by referencing that application's object model components.

VBA is a standard programming language that allows you to customize the application for your needs and integrate Corel products with other VBA-enabled applications by referencing that application's object model components.

VBA provides you with a set of tools that you can use to customize the graphical user interface of Corel applications. These tools allow you to process information and present data in an efficient and effective forum. Developers using VBA to extend Corel applications will benefit from the familiar Visual Basic language, Rapid Application Development (RAD) integrated development environment, and fast runtime performance in the resulting integrated solutions. Developers will also benefit from an extensible forms package that supports ActiveX controls for creating user interfaces, access to the full Windows API and the underlying file system, connectivity to corporate data, and integration with other COM-based software.

Even though VBA uses the Visual Basic programming language, it is considered "for applications" because it is most often integrated into another application in order to customize the functionality of that application.

 Related topics


What is event-driven programming?

VBA is an event-driven programming language. Most of the code you create is written to respond to an event. Each object within an object model is defined by a property, method, event, or a combination of each. An event is a noun, and acts as something that takes place in an object. You write code for an object to respond to the act. Events are triggered by an action, such as a click, key press, or system timer. Unlike traditional procedural programming, in which the program starts at line 1 and executes line by line, event-driven programming executes code in response to events.

 Related topics


What is the difference between VB, VBA, and VBScript?

The Microsoft Visual Basic (VB) programming system is an advanced set of programming tools that provides advanced functionality and components for the Microsoft Windows operating system and other Windows-based programs. For example, with Visual Basic you can create application extensions (dll's) and stand-alone executable programs (exe's). You cannot create either of these components with VBA or VBScript.

Visual Basic, Applications Edition (VBA) is a subset of the Visual Basic programming language. It uses the programming structure of Visual Basic to manipulate objects of an object model, left exposed by an application. The manipulation of these objects results in small packets of code procedures within the application.

VBScript is also referred to as Microsoft Visual Basic, Scripting Edition. VBScript is also a subset of the Visual Basic programming language. It is a web-based HTML document scripting language.

 Related topics


VBA and Corel SCRIPT

Previously, you could only use the Corel SCRIPT language to automate specific tasks. Both product commands and programming commands are used in conjunction with the Corel SCRIPT language. The Corel SCRIPT language is useful for developing simple macros. VBA offers more flexibility and power. When you use VBA to create macros, you are assisted by the Visual Basic compiler. The compiler helps you by providing context-sensitive help when you are coding a VBA macro. You can combine the power of VBA with the Corel SCRIPT product commands to create powerful macros. You have to use the Visual Basic Editor to create VBA macros. However, you can access the Visual Basic Editor only when you are working in an active document.

 Related topics


Working in the VBA Editor

When you work in the VBA Editor, you can create a new object, such as a dialog box, which is known as a form. You can add controls, such as a check box or a text input box. You can set the object's properties in the Property dialog box. You can also set the object's properties at run time by programming a method.

Each document that you create with VBA has a corresponding project. In order to customize your document with VBA coding procedures, you must open the project file in the Visual Basic Editor. To display the Editor, go to Tools|Visual Basic|Visual Basic Editor on the main menu in CorelDRAW.

For more detailed information on constructing code procedures and setting properties, see the Microsoft Visual Basic Help in the Visual Basic Editor.

 Related topics


Using VBA macros

VBA allows you to edit and play macros that automate a series of tasks within an application.

You can store a VBA macro in the document by putting a macro in the project associated with the document. Once you have saved the document, you can close and reopen the document and access the macro. After you have developed the macro, you can debug it. You can step through each macro line by line. This is a useful exercise to ensure that the macro will have the desired outcome. A project macro is not available if the document is closed. After you have debugged the macro, you can play the macro.

For an overview of sample macros provided with CorelDRAW, see "Sample macros." For more information about writing and distributing solutions in VBA in CorelDRAW 11, see the "VBA Programming Guide for CorelDRAW 11."

For more detailed instruction relating to VBA and its programming environment, please consult the "Microsoft Visual Basic for Applications Help" from the Help menu in the Visual Basic Editor.

 Related topics


VBA Programming Guide

The new VBA Programming Guide for CorelDRAW 11 will help you develop and distribute Visual Basic for Applications (VBA) solutions in CorelDRAW. It introduces the VBA integrated development environment and many of its advanced features. It also describes the most important CorelDRAW functions and how to use them. Finally, this guide describes how to package and deploy VBA solutions developed for CorelDRAW.

This guide should be read in conjunction with this document, the CorelDRAW object model reference.

You can find the PDF for the VBA Programming Guide in the folder C:\Program Files\Corel\Corel Graphics 11\Programs where C corresponds to the drive where you installed CorelDRAW, and where Program Files\Corel\Corel Graphics 11\Program corresponds to the path where you installed CorelDRAW.

 Related topics


Sample macros

CorelDRAW includes new samples of VBA macros. They supply users with additional functionality, demonstrate the capabilities of VBA in CorelDRAW, and may provide sample code to VBA developers.

CorelDRAW file converter

The file converter macro converts a vector or bitmap to a specified vector or bitmap format. You can choose export parameters using dialog boxes associated with particular filters. You can save each page as a separate file, and set various page properties, such as size, orientation, background color, and so on.

The supported file formats are as follows:  CMX, CDR, EPS, AI, WPG, WMF, CGM, PCT, SWF, SVG, DSF, DXF, BMP, JPEG, PPF, CPT, TIF, GIF, and PNG.

CorelDRAW calendar wizard

The calendar wizard generates customized calendars. You can choose the date range, layout, font, color, language, and many other options. You can also add holidays, and moon phases.

For information about running a macro from CorelDRAW, see "To run a VBA macro."

 Related topics


Using the VBA Help

CorelDRAW VBA Help outlines the key components of the VBA programming environment as it relates to the CorelDRAW application and its corresponding object model.

VBA uses the Visual Basic Editor interactive development environment and the VB programming language to enhance applications by manipulating the application's objects, exposed by its object model. VBA can access other applications from within CorelDRAW by referencing that application's object model components.

This help file assumes that you have a basic knowledge of VBA and the VB programming environment. For more detailed instruction relating to these topics, please consult the "Microsoft Visual Basic for Applications Help" from the Help menu in the Visual Basic Editor.

Object model references

CorelDRAW VBA Help divides its object model references into several categories:

•	Classes

•	Properties

•	Methods

•	Events

•	Enumerations

•	Constants

Topics within each category are listed in alphabetical order for easy navigation and contain links to other categories as they relate to the current topic.

Sample Code

CorelDRAW VBA Help provides sample code for all properties, methods, and events in the CorelDRAW object model. Code samples are located in the main topic window for each property, method, and event.

The CorelDRAW application object is not referenced in the sample code. The application object does not need to be included when referencing objects within the application. If you are referencing the CorelDRAW application with VBA from another application, the reference must include the CorelDRAW application object.

What is an object model?

What is the difference between a class and an object?

What is the difference between enumerations and constants?

 Related topics


What is an object model?

The VBA programming language automates tasks within an application, by manipulating the components of the application's object model. An object model represents the hierarchy of objects within an application and their relationship to each other within the structure.

In CorelDRAW, the Application object represents the top of the object hierarchy, the program itself. Starting with the Application object, you can "drill down" and navigate through the object model until you find the desired, and usually more specific, object. To reference an object with Visual Basic code, you separate each level of the object hierarchy with the dot operator (.).

For example, Application.ActiveDocument references the Document object, but separates the Document class from the Application class with the use of the dot operator. It is important to note that you do not need to reference the Application object when accessing objects in the object model of CorelDRAW.

A diagram of the object model of CorelDRAW 11 is provided for your reference. If you have difficulty opening this file, you can find it in the folder C:\Program Files\Corel\Corel Graphics 11\Draw where C corresponds to the drive where you installed CorelDRAW, and Program Files\Corel\Corel Graphics 11\Draw corresponds to the path where you installed CorelDRAW.

 Related topics


What is the difference between a class and an object?

A class is a definition of an object, not a representation of the actual object. A class outlines the properties, methods, and events that apply to a type of object in CorelDRAW. It acts as a template for all objects of that type class. An object is an instance of a class.

For example, "Document" represents the Document class in Corel applications. However, "ActiveDocument" represents an object within that class because it makes specific reference to one object.

 Related topics


What is a class?

A class is a definition of an object. A class outlines the properties, methods, and events that apply to a type of object in CorelDRAW. It acts as a template for all objects of that type class.

For example, "Document" represents the Document class in Corel applications.

 Related topics


What is a collection?

A collection is an object that contains group of objects of the same nature. It is similar to an array of objects. Each object within the collection is uniquely identified by its index number or name. For example, "Documents" represent the Documents collection class in Corel applications. However, "Documents.Item (1)" references the first document object in the collection.

 Related topics


What is a property?

Each object within an object model is defined by a property, method, event, or a combination of each. A property is an adjective, and acts as an object attribute. It represents a characteristic quality of the object. Properties can be returned, set, or read-only. The provide information about the object.

For example, "ActiveDocument.Name" represents the Name property of a Document object.

 Related topics


What is a method?

Each object within an object model is defined by a property, method, event, or a combination of each. A method is a verb, and is seen as the action of an object. It represents an act that can be performed by an object.

For example, "ActiveDocument.Close" represents the Close method of a Document object. It performs the act of closing the document in the application.

 Related topics


What is an event?

Each object within an object model is defined by a property, method, event, or a combination of each. An event is a noun, and acts as something that takes place in an object. You write code for an object to respond to the act. Events are triggered by an action, such as a click, key press, or system timer.

For example, "ActiveDocument.AfterSave" event triggers an action in the Document object after it has been saved.

 Related topics


What is the difference between enumerations and constants?

Enumerations and Constants both represent fixed values in VBA programming structures. Unlike a variable, which temporarily stores a changing data value in a code procedure or function, enumerations and constants both represent fixed values in code procedures and functions - their values do not change.

An enumeration groups similar constants together. For Example, "AddinFilter" is an enumeration, yet it contains several constants, including "AddinFilterNone" and AddinFilterNew". A constant is an instance of an enumeration.

 Related topics


What is an enumeration?

An enumeration represents a fixed value in a VBA code procedures and functions. Unlike a variable, which temporarily stores a changing data value, enumeration values do not change.

An enumeration groups similar constants together. For Example, "AddinFilter" is an enumeration, yet it contains several constants, including "AddinFilterNone" and AddinFilterNew". A constant is an instance of an enumeration.

 Related topics


What is a constant?

Constants represent fixed values in VBA programming structures. Unlike a variable, which temporarily stores a changing data value in a code procedure or function, constant values do not change.

 Related topics


XML Web services

The Microsoft® VBA Web Service References Tool brings the power of Web services to CorelDRAW. The VBA Web Service References Tool, included with the CorelDRAW® Graphics Suite 11, enables developers to reference and use XML Web services from the VBA editor in CorelDRAW.

Developers can use the Universal Discover, Description, and Integration (UDDI) Registry [image] a Microsoft .NET Web service [image] to access Web services, and integrate them into CorelDRAW from within the VBA editor.

The tool also provides documentation about discovering and integrating XML Web services [image] including technical white papers on using XML Web services within your custom solutions, as well as samples that illustrate XML Web services integration and provide examples on how XML Web services can be integrated into custom solutions.

For further information and code samples, visit the Developer Resources section of the Corel Solution Developers Web site.

To install the VBA Web Service References tool

To access the VBA Web Service References tool


To install the VBA Web Service References tool

1	Close all applications.

2	Insert Disc 2 ("Extras") in the CD drive.

If the installation wizard does not start automatically, click Start on the Windows taskbar, and click Run. Type D:\Setup, where D is the letter that corresponds to the CD drive.

3	Click Microsoft VBA Web Service References tool.

4-Follow the instructions in the installation wizard.

 Note

•	VBA must already be installed. For information about installing VBA, see "To install an application."

 Related topics


To access the VBA Web Service References Tool

•	From the VBA editor, click Tools [image] Web service References.

 Related topics


Creating GMS files

A Global Macro Storage (GMS) file, also known as a project file, can store all of the modules for a project. One GMS file may contain dozens of modules. The default coreldraw11.gms file is stored in the folder \Corel\Corel Graphics 11\Draw\. GMS files that you create can be placed in the \Corel\Corel Graphics 11\Drdaw\GMS\ folder which is usually in the folder C:\Program Files\.

Each project that you create can have many modules within it. There are three types of modules:

•	Modules [image] contains general code and macros

•	Forms [image] contains custom dialog boxes and user interfaces, including the code to control them

•	Class Modules  [image] contains object-oriented Visual Basic classes

There is also an item "CorelDRAW 11 Objects," which contains a single item, ThisDocument. This is mostly used for event handling.

 Notes

•	Different localized versions of Windows use different names for the Program Files folder.

•	You can also store VBA projects as part of a CorelDRAW document. This has only limited use, perhaps for tracking how much time has been spent editing the document.

To create a new project file

To change the internal name (Global Macros) of the project

To create a new module or form


To create a new project file

1	In Windows Explorer, navigate to the GMS folder.

GMS files are stored in the \Corel\Corel Graphics 11\Draw\GMS\ folder which is typically in the folder C:\Program Files\.

2	Click File [image] New [image] Text Document to create a new, empty text document in this folder.

3	Rename the file to your-name.gms where "your-name" can be any valid Windows filename.

4	Restart CorelDRAW.

 Note

•	When you launch the VBA editor, the new GMS file will be listed in the Project Explorer window as Global Macros (your-name.gms).

 Related topics


To change the internal name (Global Macros) of a project
To change the internal name [image] Global Macros [image] of the project

1	Click on the project you want to rename in the Project Explorer window.

2	In the Properties window, edit the "(Name)" value to what you want.

Names must follow normal naming conventions for variables:  no spaces, must start with a letter, cannot contain punctuation (except underscore), and so on.

3	Press Enter to confirm.

 Related topics


To create a new module or form

1	In the Project Explorer window, right-click anywhere on the project to which you want to add a module.

2	Click Insert and click one of the following:

•	Module [image] inserts a normal code module

•	UserForm [image] inserts a new form (dialog)

•	Class Module [image] inserts a new class code module

The new module will be placed in the project's folder for that type of module.

 Related topics


ActiveView properties

ActiveView     Legend

    Application
      OriginX
      OriginY
    Parent
      Type
      Zoom


ActiveView methods

ActiveView     Legend

   SetActualSize
   SetViewPoint
   ToFitAllObjects
   ToFitArea
   ToFitPage
   ToFitPageHeight
   ToFitPageWidth
   ToFitSelection
   ToFitShape
   ToFitShapeRange


ActiveView

Class ActiveView

Properties     Methods     Referenced By

The ActiveView class represents the view properties (zoom, view quality, coordinates of the center of the window) of a window.

 Related Topics


ActiveView.Application

Property Application As Application

ActiveView

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


ActiveView.OriginX

Property OriginX As Double

ActiveView

Description

The OriginX property returns or sets the horizontal coordinate of the drawing window's center in a CorelDRAW document. If you change the x or y coordinate of the active view, you are changing the area of the current document which is presented on the screen.

Example

The following example sets the coordinates of the drawing window's center to (0,0) in the document's active view. This places the center of the drawing window in the lower left-hand corner of the page.

Sub OriginXOriginY()

With ActiveWindow.ActiveView

.OriginX = 0

.OriginY = 0

End With

End Sub

 Related Topics


ActiveView.OriginY

Property OriginY As Double

ActiveView

Description

The OriginY property returns or sets the vertical coordinate of the drawing window's center in a CorelDRAW document. If you change the x or y coordinate of the active view, you are changing the area of the current document which is presented on the screen.

Example

The following example sets the coordinates of the drawing window's center to (0,0) in the document's active view. This places the center of the drawing window in the lower left-hand corner of the page.

Sub OriginXOriginY()

With ActiveWindow.ActiveView

.OriginX = 0

.OriginY = 0

End With

End Sub

 Related Topics


ActiveView.Parent

Property Parent As Window

ActiveView

Description

The Parent property returns the object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


ActiveView.Type

Property Type As cdrViewType

ActiveView

Description

The Type property returns or sets the active view quality in CorelDRAW. A view quality lets you choose how CorelDRAW displays a drawing on the screen. If you have a fast computer or want to see the closest approximation to what a drawing will look like when it is printed, use the Normal or Enhanced view. If you have a slower computer or just want to speed up redrawing of a complex drawing, you may find the Simple Wireframe or Wireframe view the most effective.

Example

The following example sets the view type of the current window equal to a value that represents the Enhanced view.

Sub DocumentType()

ActiveView.Type = cdrEnhancedView

End Sub

 Related Topics


ActiveView.Zoom

Property Zoom As Double

ActiveView

Description

The Zoom property returns or sets a magnification level in the active view of CorelDRAW.

Example

The following example sets the zoom level of the active document to 200%, if the current zoom level is less than 200%.

Sub Zoom()

With ActiveWindow.ActiveView

If .Zoom < 200 Then .Zoom = 200

End With

End Sub

 Related Topics


ActiveView.SetActualSize

Sub SetActualSize()

ActiveView

Description

The SetActualSize method adjusts the current view so that all objects in the view are visible in their actual size. For example, if an ellipse in the active view has a width of two inches, the SetActualSize method will adjust the current view so the ellipse has a width of two inches on the screen.

Example

The following example sets the current view to reflect the actual size of the object in the view.

Sub ViewActual()

ActiveWindow.ActiveView.SetActualSize

End Sub

 Related Topics


ActiveView.SetViewPoint

Sub SetViewPoint(ByVal X As Double, ByVal Y As Double, [ByVal Zoom As Double = 0])

ActiveView

Description

The SetViewPoint method sets the viewpoint, which is the center window position, and optionally, a zoom level.

Parameters	Description

X	The X parameter identifies the horizontal coordinate of the viewpoint. This value is measured in document units. [in]

Y	The Y parameter identifies the vertical coordinate of the viewpoint. This value is measured in document units. [in]

Zoom	The Zoom parameter returns a preset, or sets a user-defined magnification level. This value is a percentage. [in]
Optional
Default value = 0

Example

The following example sets the viewpoint of the active view at the point (2, 2) and sets the zoom at 200%.

Sub Test()

ActiveWindow.ActiveView.SetViewPoint 2, 2, 200

End Sub

 Related Topics


ActiveView.ToFitAllObjects

Sub ToFitAllObjects()

ActiveView

Description

The ToFitAllObjects method changes the active view to fit all the objects on the current page into the application window. This method adjusts the zoom level so that the area surrounding all objects on the current page fills up the active view.

Example

The following example uses the ToFitAllObjects method to adjust the zoom level so that all objects on the page fill up the active view of CorelDRAW.

Sub ToFitAllObjects()

ActiveWindow.ActiveView.ToFitAllObjects

End Sub

 Related Topics


ActiveView.ToFitArea

Sub ToFitArea(ByVal Left As Double, ByVal Top As Double, ByVal Right As Double, ByVal Bottom As Double)

ActiveView

Description

The ToFitArea method changes the active view to fit a specified rectangular area, identified by its coordinates, in the current document into the application window. The ToFitArea method defines an area, and adjusts the zoom level of the page so that the defined region fills the current view in the application window.

Parameters	Description

Left	A coordinate that specifies the left side of the rectangle of the active view relative to the center of the coordinates set for the document. The left coordinate is measured in document units. [in]

Top	A coordinate that specifies the top side of the rectangle of the active view relative to the center of the coordinates set for the document. The top coordinate is measured in document units. [in]

Right	A coordinate that specifies the right side of the rectangle of the active view relative to the center of the coordinates set for the document. The right coordinate is measured in document units. [in]

Bottom	A coordinate that specifies the bottom side of the rectangle of the active view relative to the center of the coordinates set for the document. The bottom coordinate is measured in document units. [in]

Example

The following example creates a rectangular area in the active document. This defined area, using the coordinates 0, 0, 5, and 5, uses the ToFitArea method to adjust the zoom level to display the newly defined rectangular page area as the active view.

Sub ToFitArea()

ActiveWindow.ActiveView.ToFitArea 0, 0, 5, 5

End Sub

 Related Topics


ActiveView.ToFitPage

Sub ToFitPage()

ActiveView

Description

The ToFitPage method changes the active view to fit the entire page of the current document. It ensures that the entire page in a document is visible in CorelDRAW

The ToFitPage method is equivalent to the Shift+F4 command in CorelDRAW.

Example

The following example sets the active view of the current document with the ToFitPage method, ensuring that the entire page in the document is visible in the application window.

Sub ToFitPage()

ActiveWindow.ActiveView.ToFitPage

End Sub

 Related Topics


ActiveView.ToFitPageHeight

Sub ToFitPageHeight()

ActiveView

Description

The ToFitPageHeight method changes the active view to fit the entire page height of the current document into the application window. This method places the top and bottom borders of the active page to the top and bottom borders of the application window, adjusting the zoom level so that these page boundaries fit the entire window space.

Example

The following example adjusts the zoom level so that the active view fits the height of the page in the active document. This changes the appearance of the active view in that the entire view space is now occupied by the height of the active page.

Sub ToFitPageHeight()

ActiveWindow.ActiveView.ToFitPageHeight

End Sub

 Related Topics


ActiveView.ToFitPageWidth

Sub ToFitPageWidth()

ActiveView

Description

The ToFitPageWidth method changes the active view to fit the entire page width of the current document into the application window. This method places the left and right borders of the active page to the left and right borders of the application window, adjusting the zoom level so that these page boundaries fit the entire window space.

Example

The following example adjusts the zoom level in CorelDRAW so that the active view fits the width of the page in the active document. This changes the appearance of the active view in that the entire view space is now occupied by the width of the active page.

Sub ToFitPageWidth()

ActiveWindow.ActiveView.ToFitPageWidth

End Sub

 Related Topics


ActiveView.ToFitSelection

Sub ToFitSelection()

ActiveView

Description

The ToFitSelection method changes the active view to fit a selection of objects in the current document into the application window. This method adjusts the zoom level of the page so that the entire current selection of objects fills the current view in the application window.

ToFitSelection method is equivalent to the Shift+F2 command in CorelDRAW.

Example

The following example adjusts the zoom level in CorelDRAW so that all selected objects on the page appear in the active view of the current document.

Sub ToFitSelection()

ActiveWindow.ActiveView.ToFitSelection

End Sub

 Related Topics


ActiveView.ToFitShape

Sub ToFitShape(ByVal Shape As Shape)

ActiveView

Description

The ToFitShape method changes the active view to fit an entire shape in the current document into the application window. This method adjusts the zoom level of the page so that the specified shape fills the current view in the application window.

Parameters	Description

Shape	Specifies the shape object that you want to zoom out [in]

Example

The following example creates a circle in CorelDRAW and adjusts the active view to zoom in on the circle in the active document.

Sub ToFitShape()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(5, 5, 2)

ActiveWindow.ActiveView.ToFitShape s

End Sub

 Related Topics


ActiveView.ToFitShapeRange

Sub ToFitShapeRange(ByVal ShapeRange As ShapeRange)

ActiveView

Description

The ToFitShapeRange method changes the active view to fit an entire collection of shape objects on the current page into the application window. The ToFitShapeRange method adjusts the zoom level of the page so that the specified shapes fill the current view in the application window.

Parameters	Description

ShapeRange	Specifies the area to include in the defined active view [in]

Example

The following example creates a rectangle and circle on the current page, adds the rectangle and the circle to a shape range, and uses the ToFitShapeRange method to adjust the active view and zoom in so that the shapes in the shape range make up the entire view in CorelDRAW.

Sub ToFitShapeRange()

Dim s As Shape

Dim sr As New ShapeRange

Set s = ActiveLayer.CreateEllipse2(5, 5, 2)

sr.Add s	'Creates an ellipse and includes it in the defined range

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

sr.Add s	'Creates a rectangle and includes it in the defined range

ActiveWindow.ActiveView.ToFitShapeRange sr

End Sub

 Related Topics


AddinHook properties

AddinHook     Legend

    Application
      Filter
      Index
    Parent


AddinHook events

AddinHook

Execute
New
ShapeCreated
WhileDrawing


AddinHook

Class AddinHook

Properties     Events     Referenced By

 Related Topics


AddinHook.Application

Property Application As Application

AddinHook

Read-Only

 Related Topics


AddinHook.Filter

Property Filter As cdrAddinFilter

AddinHook

 Related Topics


AddinHook.Index

Property Index As Long

AddinHook

 Related Topics


AddinHook.Parent

Property Parent As Application

AddinHook

Read-Only

 Related Topics


AddinHook.Execute

Event Execute()

AddinHook

 Related Topics


AddinHook.New

Event New(ByVal NewDocument As Document)

AddinHook

Parameters	Description

NewDocument	[in]

 Related Topics


AddinHook.ShapeCreated

Event ShapeCreated(ByVal NewShape As Shape)

AddinHook

Parameters	Description

NewShape	[in]

 Related Topics


AddinHook.WhileDrawing

Event WhileDrawing(ByVal TheShape As Shape, ByRef X As Long, ByRef Y As Long)

AddinHook

Parameters	Description

TheShape	[in]

X	[in,out]

Y	[in,out]

 Related Topics


AddIns properties

AddIns     Legend

    Application
    Collection
    Parent


AddIns methods

AddIns     Legend

   Attach


AddIns

Class AddIns

Properties     Methods     Referenced By

 Related Topics


AddIns.Application

Property Application As Application

AddIns

Read-Only

 Related Topics


AddIns.Collection

Property Collection As Object

AddIns

Read-Only

 Related Topics


AddIns.Parent

Property Parent As Application

AddIns

Read-Only

 Related Topics


AddIns.Attach

Function Attach(ByVal Filter As cdrAddinFilter, [ByVal ExecuteCommandPrompt As String]) As AddinHook

AddIns

Parameters	Description

Filter	[in]

ExecuteCommandPrompt	[in]
Optional

Return value

Returns AddinHook

 Related Topics


Application properties

Application     Legend

    ActiveDocument
    ActiveLayer
    ActivePage
    ActivePalette
    ActiveSelection
    ActiveSelectionRange
    ActiveShape
      ActiveTool
    ActiveWindow
    ActiveWorkspace
    AddIns
    Application
    AppWindow
    ArrowHeads
    Clipboard
    CommandBars
    ConfigPath
    Documents
      EventsEnabled
    FontList
    GMSManager
    MainMenu
      Optimization
    OutlineStyles
    Palettes
      PanoseMatching
    Parent
    Path
    PatternCanvases
    Printers
    PrintJob
    RecentFiles
    SetupPath
    StatusBar
    UserDataPath
    VBE
    Version
    VersionBuild
    VersionMajor
    VersionMinor
      Visible
    Windows
    Workspaces


Application methods

Application     Legend

   cdrMixedDouble
   cdrMixedLong
   cdrMixedSingle
   CorelScript
   CorelScriptTools
   CreateBWColor
   CreateCMYColor
   CreateCMYKColor
   CreateColor
   CreateColorEx
   CreateCurve
   CreateDocument
   CreateDocumentFromTemplate
   CreateFixedColor
   CreateGrayColor
   CreateHLSColor
   CreateHSBColor
   CreateLabColor
   CreateNodeRange
   CreatePatternCanvas
   CreateRegistrationColor
   CreateRGBColor
   CreateSegmentRange
   CreateShapeRange
   CreateSnapPoint
   CreateStructExportOptions
   CreateStructImportOptions
   CreateStructPaletteOptions
   CreateStructSaveAsOptions
   CreateYIQColor
   ImportWorkspace
   InitializeVBA
   OpenCorelScriptFile
   OpenDocument
   Quit
   Refresh


Application

Class Application

Properties     Methods     Referenced By

The Application object defines properties of the main CorelDRAW application. The Application object is the top level object in the CorelDRAW hierarchy of objects. You can access all other functionality of the application through its functions, methods, and properties.

The Application object is always available in VBA and its properties and methods are global, making it unnecessary to explicitly specify the Application object. For example, CorelScript and Application.CorelScript can be used interchangeably because they represent the same method of the Application object.

 Related Topics


Application.ActiveDocument

Property ActiveDocument As Document

Application

Description

The ActiveDocument property returns a reference to the active document.

It is important to note that you do not need to activate a document before working with it in CorelDRAW. The document stays inactive but you still can work with it. For example, examine the following two lines of code:

Documents(1).Activate

ActiveDocument.AddPages 1

These two lines of code produce the same result as

Documents(1).AddPages 1

Both of these examples add a new page to the first open document, which is the first document.

Read-Only

Example

The following example creates a new document and draws an ellipse in it. Then another document is created, and a rectangle is added to it. The first document is then activated and a new page is added to it.

Sub DocumentActive()

CreateDocument

ActiveLayer.CreateEllipse2 3, 2, 1

CreateDocument

ActiveLayer.CreateRectangle 2, 3, 4, 5

Documents(1).Activate

ActiveDocument.AddPages 1

End Sub

 Related Topics


Application.ActiveLayer

Property ActiveLayer As Layer

Application

Description

The ActiveLayer property returns the active layer on the active page in the active document.

Read-Only

Example

The following example creates an ellipse on the active layer in the current document.

Sub LayerActive()

ActiveLayer.CreateEllipse 3, 3, 2, 1

ActiveDocument.Selection.Shapes(1).Fill.UniformColor.CMYKAssign 100, 0, 100, 0

'Fills the ellipse green

End Sub

 Related Topics


Application.ActivePage

Property ActivePage As Page

Application

Description

The ActivePage property returns the active page in the active document.

Read-Only

Example

The following example changes the background color of the current page in the active document to red.

Sub PageActive()

ActivePage.Color.RGBAssign 255, 0, 0

End Sub

 Related Topics


Application.ActivePalette

Property ActivePalette As Palette

Application

Description

The ActivePalette property returns a reference to the active palette.

Read-Only

Example

The following example displays the name of the default palette, and the number of colors in that palette, in a message box.

Sub PaletteActive()

MsgBox "The default color palette is: " & _

ActivePalette.Name & _

"It contains " & ActivePalette.ColorCount & " colors."

End Sub

 Related Topics


Application.ActiveSelection

Property ActiveSelection As Shape

Application

Description

The ActiveSelection property returns the active selection in the active document.

Read-Only

Example

The following example colors the selected shapes green, if the shape selected is an ellipse.

Sub SelectionActive()

Dim s As Shape

For Each s In ActiveSelection.Shapes

If s.Type = cdrEllipseShape Then

s.Fill.UniformColor.CMYKAssign 100, 0, 100, 0

End If

Next s

End Sub

 Related Topics


Application.ActiveSelectionRange

Property ActiveSelectionRange As ShapeRange

Application

Description

The ActiveSelectionRange property returns the active ShapeRange object in the active document.

Read-Only

Example

The following example displays messages about selected objects in the active document, depending on the number of objects selected.

Sub SelectionRangeActive()

If ActiveSelectionRange.Count = 1 Then

MsgBox "There is only one shape selected in the shape range."

ElseIf ActiveSelectionRange.Count = 0 Then

MsgBox "There are no shapes selected in the shape range."

Else

MsgBox "There are " & ActiveSelectionRange.Count & " shapes in the selected shape range."

End If

End Sub

 Related Topics


Application.ActiveShape

Property ActiveShape As Shape

Application

Description

The ActiveShape property returns the first selected shape in the active document.

Read-Only

Example

The following example applies the Brighten lens to the currently selected shape.

Sub Test()

ActiveShape.CreateLens cdrLensBrighten, 50

End Sub

 Related Topics


Application.ActiveTool

Property ActiveTool As cdrTools

Application

Description

The ActiveTool property returns or sets the active tool in CorelDRAW.

Example

The following example changes the active tool from the Pick tool to the Eye Dropper tool.

Sub ToolActive()

If ActiveTool = cdrToolPick Then

ActiveTool = cdrToolEyeDropper

End If

End Sub

 Related Topics


Application.ActiveWindow

Property ActiveWindow As Window

Application

Description

The ActiveWindow property returns the active window of the active document.

Read-Only

Example

The following example redraws the active document window.

Sub WindowActive()

ActiveWindow.Refresh

End Sub

 Related Topics


Application.ActiveWorkspace

Property ActiveWorkspace As Workspace

Application

Description

The ActiveWorkspace property returns a reference to the active workspace.

Read-Only

Example

The following example displays the name of the active workspace in a message box.

Sub WorkspaceActive()

MsgBox ActiveWorkspace.Name

End Sub

 Related Topics


Application.AddIns

Property AddIns As AddIns

Application

Description

Member of Application

Read-Only

 Related Topics


Application.Application

Property Application As Application

Application

Description

The Application property returns the CorelDRAW application.

Read-Only

 Related Topics


Application.AppWindow

Property AppWindow As AppWindow

Application

Description

The AppWindow property returns the main application window.

Read-Only

Example

The following example displays the caption of the main application window in a message box.

Sub CaptionAppWindow()

MsgBox AppWindow.Caption

End Sub

 Related Topics


Application.ArrowHeads

Property ArrowHeads As ArrowHeads

Application

Description

The Arrowheads property returns the Arrowhead collection.

Read-Only

Example

The following example applies an arrowhead with an index of 5 to the beginning of the outlines of each selected object.

Sub ItemArrowHead()

Dim s As Shape

For Each s In ActiveDocument.Selection.Shapes

If s.Outline.Type = cdrOutline Then

s.Outline.StartArrow = ArrowHeads.Item(5)

'can also be referenced as s.Outline.StartArrow = ArrowHeads (5)

End If

Next s

End Sub

 Related Topics


Application.Clipboard

Property Clipboard As Clipboard

Application

Description

The Clipboard property returns the system clipboard.

Read-Only

Example

The following example checks to see if the clipboard is empty. If data is present, it is pasted into the current document. If no data is present, a message displays in a message box.

Sub ClipboardData()

If Not Clipboard.Empty Then

ActiveLayer.Paste

Else

MsgBox "There is no data in the clipboard."

End If

End Sub

 Related Topics


Application.CommandBars

Property CommandBars As CommandBars

Application

Description

This property is reserved for future development.

Read-Only

 Related Topics


Application.ConfigPath

Property ConfigPath As String

Application

Description

The ConfigPath property returns the path to the configuration folder.

Read-Only

Example

The following example displays the path of the CorelDRAW configuration directory in a message box.

Sub PathConfig()

MsgBox ConfigPath

End Sub

 Related Topics


Application.Documents

Property Documents As Documents

Application

Description

The Documents property returns the collection of all open documents in the application.

Read-Only

Example

The following example checks for open documents. If a document is open, text is added and if there is no open document, a message displays in a message box.

Sub ApplicationDocument()

If Documents.Count > 0 Then

ActiveLayer.CreateArtisticText 0, 0, "Text"

Else

MsgBox " There is no document open."

End If

End Sub

 Related Topics


Application.EventsEnabled

Property EventsEnabled As Boolean

Application

Description

The EventsEnabled property returns or sets a value indicating the enabled status of an event in CorelDRAW. An event is enabled if it is ready and able to execute in the application. If an event is enabled, its EventsEnabled status is true. If the event is disabled, the status is set to false. Events can be disabled to temporarily improve performance when performing routine operations

Example

The following example disables events before creating a second ellipse.

Sub EnabledEvents()

Dim state As Boolean

ActiveLayer.CreateEllipse2 0, 0, 5

'GlobalDocument_ShapeCreated event will be generated here.

state = EventsEnabled  'Remember the flag state.

EventsEnabled = False  'Disable events.

ActiveLayer.CreateEllipse2 3, 3, 5

' This event wil not be generated.

EventsEnabled = state  'Restore event state.

End Sub

 Related Topics


Application.FontList

Property FontList As FontList

Application

Description

The FontList property returns the list of all fonts installed on the system.

Read-Only

Example

The following example displays the name of the fourth installed font.

Sub ListFontName()

MsgBox FontList(4)

End Sub

 Related Topics


Application.GMSManager

Property GMSManager As GMSManager

Application

Description

The GMSManager property returns a Global Macro Storage (GMS) Manager object. A GMS manager lets you run VBA macros from other programs, as we ass manage GMS modules.

Read-Only

Example

The following example runs a macro, Cropmarks, in the "Main" module of GMS "CropMarks"

Sub Test()

GMSManager.RunMacro "CropMarks", "Main.Cropmarks"

End Sub

 Related Topics


Application.MainMenu

Property MainMenu As CommandBar

Application

Description

This property is reserved for future development.

Read-Only

 Related Topics


Application.Optimization

Property Optimization As Boolean

Application

Description

The Optimization property returns or sets the optimization, the ability to suppress screen redraws when working with documents and shapes.

Setting the Optimization property to True disables some internal updating. It is important to disable optimization when exiting a macro, or CorelDRAW may not update its screens. You may also want to refresh the document window after disabling optimization so the display is updated and reflects all changes.

Example

The following example creates 100 random circles in the active document, with optimization enabled for increased performance.

Sub Optimize()

Dim i As Long

Dim x As Double, y As Double, r As Double

Dim n As Long

Dim num As Long

Dim MaxX As Double, MaxY As Double, MaxR As Double

MaxX = ActivePage.SizeWidth

MaxY = ActivePage.SizeHeight

MaxR = 1

num = ActivePalette.ColorCount

Optimization = True

For i = 1 To 100

x = Rnd() * MaxX

y = Rnd() * MaxY

r = Rnd() * MaxR

n = CLng(Fix(Rnd() * num)) + 1

Set s = ActiveLayer.CreateEllipse2(x, y, r)

s.Fill.ApplyUniformFill ActivePalette.Color(n)

Next i

Optimization = False

ActiveWindow.Refresh

End Sub

 Related Topics


Application.OutlineStyles

Property OutlineStyles As OutlineStyles

Application

Description

The OutlineStyles property returns the collection of available OutlineStyle presets.

Read-Only

Example

The following example applies predefined outline styles to selected objects. The style that is applied depends on the type of shape selected; for example, if the shape is a rectangle, the first preset outline style is applied to the outline of the rectangle. Only shapes that have an outline are included the selection.

Sub StylesOutline()

Dim s As Shape

For Each s In ActiveSelection.Shapes

If s.Outline.Type = cdrOutline Then

Select Case s.Type

Case cdrRectangleShape

s.Outline.Style = OutlineStyles(1)

Case cdrEllipseShape

s.Outline.Style = OutlineStyles(2)

Case cdrPolygonShape

s.Outline.Style = OutlineStyles(3)

End Select

End If

Next s

End Sub

 Related Topics


Application.Palettes

Property Palettes As Palettes

Application

Description

The Palettes property returns the collection of open color palettes.

Read-Only

Example

The following example displays the name of all palettes in use, and the number of colors in each palette, in a message box.

Sub PalettesList()

Dim pal As Palette

Dim s As String

s = "Active palettes. "

For Each pal In Palettes

s = s & pal.Name & " (" & pal.ColorCount & " colors)"

Next pal

MsgBox s

End Sub

 Related Topics


Application.PanoseMatching

Property PanoseMatching As cdrPanoseMatchingType

Application

Description

The PanoseMatching property returns or sets the default behavior when the document being opened contains fonts that are not installed on the system.

Example

The following example specifies that non-existing fonts are replaced permanently and automatically with the closest font matches available on the system.

Sub MatchingPanose()

PanoseMatching = cdrPanosePermanent

OpenDocument "C:\My Documents\Graphic1.cdr"

End Sub

 Related Topics


Application.Parent

Property Parent As Application

Application

Description

The Parent property returns the application to which the object belongs in the hierarchy of objects for CorelDRAW.

Read-Only

 Related Topics


Application.Path

Property Path As String

Application

Description

The Path property returns a string value associated with the full path identity of the CorelDRAW directory.

Read-Only

Example

The following example displays the path of the CorelDRAW directory in a message box.

Sub PathApplication()

MsgBox Path

End Sub

 Related Topics


Application.PatternCanvases

Property PatternCanvases As PatternCanvases

Application

Description

The PatternCanvases property returns the collection of available PatternCanvas (two-color pattern fills).

Read-Only

Example

The following example applies a predefined pattern fill, overlaid with a checkerboard pattern, to an ellipse.

Sub CanvasPattern()

Dim s As Shape

Dim pf As PatternFill

Dim cnv As New PatternCanvas

cnv.PutCopy PatternCanvases(2)

Set s = ActiveLayer.CreateEllipse(8, 7, 3, 4)

s.Fill.ApplyNoFill

Set pf = s.Fill.ApplyPatternFill(cdrTwoColorPattern, , , CreateColorEx(5005, 255, 0, 0), _

CreateColorEx(5005, 255, 255, 0))

pf.Canvas = cnv

End Sub

 Related Topics


Application.Printers

Property Printers As SystemPrinters

Application

Description

The Printers property returns the SystemPrinters collection object that contains a list of installed printers on the user's system.

Read-Only

Example

The following example displays the name of the default printer and the port to which it is connected.

Sub Test()

If Printers.Count = 0 Then

MsgBox "There's no printer installed on the system."

Exit Sub

End If

MsgBox "Default printer is: " & Printers.Default.Name & _

" on port: " & Printers.Default.Port

End Sub

 Related Topics


Application.PrintJob

Property PrintJob As PrintJob

Application

Description

The PrintJob property returns a value associated with a print job in CorelDRAW.

Read-Only

 Related Topics


Application.RecentFiles

Property RecentFiles As RecentFiles

Application

Description

The RecentFiles property returns the collection of all files in the recent file list of CorelDRAW.

Read-Only

Example

The following example displays a list of all recent files, with full file names, in a message box.

Sub RecentFilesList()

Dim s As String

Dim rf As RecentFile

s = "Recent Files" & vbCrLf

For Each rf In RecentFiles

s = s & vbCrLf & rf.Name & " (" & rf.FullName & ")"

Next rf

MsgBox s

End Sub

 Related Topics


Application.SetupPath

Property SetupPath As String

Application

Description

The SetupPath property returns the root path of the installation of the CorelDRAW suite.

Read-Only

Example

The following example displays the path of the CorelDRAW setup directory in a message box.

Sub PathSetup()

MsgBox SetupPath

End Sub

 Related Topics


Application.StatusBar

Property StatusBar As CommandBar

Application

Description

This property is reserved for future development.

Read-Only

 Related Topics


Application.UserDataPath

Property UserDataPath As String

Application

Description

The UserDataPath property returns the path to the folder where the user's personal data resides.

Read-Only

Example

The following example displays all installed GMS files in the GMS folder.

Sub Test()

Dim s As String

Dim s1 As String

s = Dir(UserDataPath & "GMS\*.gms")

Do

If s = "" Then Exit Do

s = s & s1 & vbCrLf

s1 = Dir

Loop Until s1 = ""

s = s & Dir(SetupPath & "Draw\GMS\*.gms")

Do

If s = "" Then Exit Do

s = s & s1 & vbCrLf

s1 = Dir

Loop Until s1 = ""

MsgBox s, , "The following GMS files are installed:"

End Sub

 Related Topics


Application.VBE

Property VBE As Object

Application

Description

The VBE property returns a reference to the VBA Editor.

Read-Only

Example

The following example displays the editor type name in the Debug window of the VBA Editor in CorelDRAW.

Sub AppVBE()

Dim obj as Object

Set obj = Application.VBE

Debug.Print TypeName (obj)

End Sub

 Related Topics


Application.Version

Property Version As String

Application

Description

The Version property returns version information about CorelDRAW. The Version property contains the version major number (before the decimal) and version build number (after the decimal). For example if the current version is 11.388, the Version value would be Version 11.388.

Read-Only

Example

The following example displays the current version of CorelDRAW in a message box.

Sub AppVersion()

MsgBox "You are using: " & Version

End Sub

 Related Topics


Application.VersionBuild

Property VersionBuild As Long

Application

Description

The VersionBuild property returns version information about CorelDRAW. The VersionBuild property returns only the build number of the current version. The VersionBuild property returns the second part of the Version number (to the right of the decimal point). For example, if the current version is 11.396, the VersionBuild value is 396.

Read-Only

Examples

The following example displays the build number of the current CorelDRAW application in a message box.

Sub BuildVersion()

MsgBox "You are using CorelDRAW build " & VersionBuild

End Sub

The following example detects earlier versions of CorelDRAW. Version properties were introduced in CorelDRAW 9 Office Edition.

Sub Main()

Dim v&, b&

GetDrawVersion v, b

MsgBox v & "." & b

End Sub

Sub GetDrawVersion(v As Long, b As Long)

On Error Resume Next

Err.Clear

v = CorelDRAW.Application.VersionMajor

If Err.Number <> 0 Then

v = 9

b = 439

Else

b = CorelDRAW.Application.VersionBuild

End If

On Error GoTo 0

MsgBox "You are using CorelDRAW " & v & "." & b

End Sub

 Related Topics


Application.VersionMajor

Property VersionMajor As Long

Application

Description

The VersionMajor property returns version information about CorelDRAW. The VersionMajor property returns only the first part of the version number (to the left of the decimal place). For example, if the current version is 11.396, the major version value would be 11.

Read-Only

Example

The following example checks the current version of CorelDRAW to ensure that the version number is at least 11.200.

Sub MajorVersion()

If VersionMajor = 11 And VersionBuild < 200 Then

MsgBox "This script required that CorelDRAW version 11.200 or later be installed."

End If

End Sub

 Related Topics


Application.VersionMinor

Property VersionMinor As Long

Application

Description

The VersionMinor property returns version information about CorelDRAW. The VersionMinor property is set to 0 (zero) for a mainstream application.

Read-Only

Example

The following example checks the current version of CorelDRAW to ensure that the version number is at least 11.200.

Sub MajorVersion()

If VersionMajor = 11 And VersionBuild < 200 Then

MsgBox "This script required that CorelDRAW version 11.200 or later be installed."

End If

End Sub

 Related Topics


Application.Visible

Property Visible As Boolean

Application

Description

The Visible property returns or sets a value indicating the visibility of the application window. This property allows you to show or hide the CorelDRAW application window. If the Visible property is True, the application is running and visible on the monitor display.

Example

The following example hides CorelDRAW by setting the Visible property to False, and then shows CorelDRAW by setting the Visible property to True. Message boxes display messages indicating the visibility of the application.

Sub ApplicationVisible()

Visible = False

MsgBox "CorelDRAW is hidden."

Visible = True

MsgBox "CorelDRAW is now visible."

End Sub

 Related Topics


Application.Windows

Property Windows As Windows

Application

Description

The Windows property returns the collection of document windows open in the application.

Read-Only

Example

The following example sets the zoom level of all document windows to 200%.

Sub WindowsZoom()

Dim w As Window

For Each w In Windows

w.ActiveView.Zoom = 200

Next w

End Sub

Sub WindowsTile()

Windows.Arrange cdrTileHorizontally

End Sub

 Related Topics


Application.Workspaces

Property Workspaces As Workspaces

Application

Description

The Workspaces property returns the collection of all workspaces available in the application.

Read-Only

Example

The following example displays the available workspaces in a message box and adds an asterisk next to the name of the active workspace.

Sub WorkspaceCollection()

Dim s As String

Dim wks As Workspace

s = "Available Workspaces: "

For Each wks In Workspaces

s = s & wks.Name

If wks.Active Then s = s & " *"

Next wks

MsgBox s

End Sub

 Related Topics


Application.cdrMixedDouble

Function cdrMixedDouble() As Double

Application

Description

The cdrMixedDouble function returns a double value corresponding to a mixed (uneven) double. An undefined value is returned by some functions when ambiguity (different values) exists. For example, text that contains font characters of different sizes has mixed settings.

Return value

Returns Double

Example

The following example checks to see if the specified selection is a text object. If this text object contains characters with varying font sizes, it sets a uniform font size for the entire text object.

Sub MixedDouble()

Dim s As Shape

Set s = ActiveDocument.Selection.Shapes(1)

If s.Type = cdrTextShape Then

If s.Text.FontProperties.Size = cdrMixedDouble Then

s.Text.FontProperties.Size = 12

End If

End If

End Sub

 Related Topics


Application.cdrMixedLong

Function cdrMixedLong() As Long

Application

Description

The cdrMixedLong property returns a long value corresponding to a mixed (uneven) long. An undefined value is returned by some functions when ambiguity (different values) exists. For example, text that contains font characters of different sizes has mixed settings.

Return value

Returns Long

Example

The following example checks to see if the specified selection is a text object. If this text object contains characters with varying font sizes, it sets a uniform font size for the entire text object.

Sub MixedLong()

Dim s As Shape

Set s = ActiveDocument.Selection.Shapes(1)

If s.Type = cdrTextShape Then

If s.Text.FontProperties.Size = cdrMixedLong Then

s.Text.FontProperties.Size = 12

End If

End If

End Sub

 Related Topics


Application.cdrMixedSingle

Function cdrMixedSingle() As Single

Application

Description

The cdrMixedSingle property returns a value corresponding to a mixed (uneven) single. An undefined value is returned by some functions when ambiguity (different values) exists. For example, text that contains font characters of different sizes has mixed settings.

Return value

Returns Single

Example

The following example checks to see if the specified selection is a text object. If this text object contains characters with varying font sizes, it sets a uniform font size for the entire text object.

Sub MixedSingle()

Dim s As Shape

Set s = ActiveDocument.Selection.Shapes(1)

If s.Type = cdrTextShape Then

If s.Text.FontProperties.Size = cdrMixedSingle Then

s.Text.FontProperties.Size = 12

End If

End If

End Sub

 Related Topics


Application.CorelScript

Function CorelScript() As Object

Application

Description

The CorelScript method creates a Corel SCRIPT object to which you can pass Corel SCRIPT commands.

Return value

Returns Object

Example

The following example creates a new document and adds a rectangle to it using the Corel SCRIPT object model.

Sub ApplicationCorelScript()

Dim cs As Object

Set cs = CorelScript

cs.FileNew

cs.CreateRectangle 100000, -100000, -100000, 100000, 0, 0, 0, 0

End Sub

 Related Topics


Application.CorelScriptTools

Function CorelScriptTools() As Object

Application

Description

The CorelScriptTools method returns a CorelScriptTools object as a generic object type.

Return value

Returns Object

Example

The following example displays the standard File Open dialog box and asks the user to choose a file. Then the FileAttr function determines if the file actually exists in the specified location.

Sub ScriptTools()

Dim cst As Object

Dim FilePath As String

Set cst = CorelScriptTools

FilePath = cst.GetFileBox()

If FilePath <> "" Then

If cst.FileAttr(FilePath) = 0 Then

MsgBox "The file you selected doesn't exist."

End If

End If

End Sub

 Related Topics


Application.CreateBWColor

Function CreateBWColor(ByVal White As Boolean) As Color

Application

Description

The CreateBWColor method creates a new color object based on the Black and White color model.

Parameters	Description

White	Sets the appearance of white in the Black and White color model [in]

Return value

Returns Color

Example

CreateBWColor (True)

 Related Topics


Application.CreateCMYColor

Function CreateCMYColor(ByVal Cyan As Long, ByVal Magenta As Long, ByVal Yellow As Long) As Color

Application

Description

The CreateCMYColor method creates a new color object based on the CMY color model.

Parameters	Description

Cyan	Sets the level of cyan in the CMY color model. Values range from 0 to 255. [in]

Magenta	Sets the level of magenta in the CMY color model. Values range from 0 to 255. [in]

Yellow	Sets the level of magenta in the CMY color model. Values range from 0 to 255. [in]

Return value

Returns Color

Example

CreateCMYColor (255, 100, 100)

 Related Topics


Application.CreateCMYKColor

Function CreateCMYKColor(ByVal Cyan As Long, ByVal Magenta As Long, ByVal Yellow As Long, ByVal Black As Long) As Color

Application

Description

The CreateCMYKColor method creates a new color object based on the CMYK color model.

Parameters	Description

Cyan	Sets the level of cyan in the CMYK color model. Values range from 0 to 100. [in]

Magenta	Sets the level of magenta in the CMYK color model. Values range from 0 to 100. [in]

Yellow	Sets the level of magenta in the CMYK color model. Values range from 0 to 100. [in]

Black	Sets the level of black in the CMYK color model. Values are percentages and range from 0 to 100. [in]

Return value

Returns Color

Example

CreateCMYKColor (100, 0, 100, 0)

 Related Topics


Application.CreateColor

Function CreateColor() As Color

Application

Description

The CreateColor method creates a color object with default color properties.

This function is now obsolete because the Color object can be used with the New keyword.

Return value

Returns Color

Example

The following examples show several ways to apply a cyan fill to the first selected object in the active document.

Sub CreateColor1()

Dim c As Color

Set c = CreateColor

c.CMYKAssign 100, 0, 0, 0

ActiveDocument.Selection.Shapes(1).Fill.ApplyUniformFill c

End Sub

Sub CreateColor2()

Dim c As New Color

c.CMYKAssign 100, 0, 0, 0

ActiveSelection.Shapes(1).Fill.ApplyUniformFill c

End Sub

Sub CreateColor3()

ActiveShape.Fill.UniformColor.CMYKAssign 100, 0, 0 ,0

End Sub

 Related Topics


Application.CreateColorEx

Function CreateColorEx([ByVal ColorModel As Long = 0], [ByVal V1 As Long = 0], [ByVal V2 As Long = 0], [ByVal V3 As Long = 0], [ByVal V4 As Long = 0], [ByVal V5 As Long = 0], [ByVal V6 As Long = 0], [ByVal V7 As Long = 0]) As Color

Application

Description

The CreateColorEx method creates a color object and initializes it, with specified color information using a Corel SCRIPT color specification.

Parameters	Description

ColorModel	Specifies the color model used to create the new color. This parameter specifies the numeric variable that is assigned to the color model. [in]
Optional
Default value = 0

V1	Specifies the numeric variable that is assigned to the first color component of the selected color model. For example, cyan is the first color component of the CMYK color model. The value is a percentage and can range from 1 to 100. A color that is selected at 100 is applied with full saturation. [in]
Optional
Default value = 0

V2	Specifies the numeric variable that is assigned to the second color component of the selected color model. For example, magenta is the second color component of the CMYK color model. The value is a percentage and can range from 1 to 100. A color that is selected at 100 is applied with full saturation. [in]
Optional
Default value = 0

V3	Specifies the numeric variable that is assigned to the third color component of the selected color model. For example, yellow is the third color component of the CMYK color model. The value is a percentage and can range from 1 to 100. A color that is selected at 100 is applied with full saturation. [in]
Optional
Default value = 0

V4	Specifies the numeric variable that is assigned to the fourth color component of the selected color model. For example, black is the fourth color component of the CMYK color model. The value is a percentage and can range from 1 to 100. A color that is selected at 100 is applied with full saturation. [in]
Optional
Default value = 0

V5	Specifies the numeric variable that is assigned to the fifth color component of the selected color model. Even though the most popular color models use only four levels of color saturations, CorelDRAW has the ability to create colors using seven color channels. [in]
Optional
Default value = 0

V6	Specifies the numeric variable that is assigned to the sixth color component of the selected color model. Even though the most popular color models use only four levels of color saturations, CorelDRAW has the ability to create colors using seven color channels. [in]
Optional
Default value = 0

V7	Specifies the numeric variable that is assigned to the seventh color component of the selected color model. Even though the most popular color models use only four levels of color saturations, CorelDRAW has the ability to create colors using seven color channels. [in]
Optional
Default value = 0

Return value

Returns Color

Example

The following example adds a new color to the active color palette.

Sub CreatePaletteColor()

ActivePalette.AddColor CreateColorEx(5002, 90, 90, 0, 0)

End Sub

 Related Topics


Application.CreateCurve

Function CreateCurve([ByVal Document As Document = Nothing]) As Curve

Application

Description

The CreateCurve method creates a curve in memory and optionally binds it to a document.

Any changes made to the curve in memory do not affect the document, and are, therefore, performed very fast.

When you work with coordinates (for example, setting the position of a node, getting the length of a curve, and so on), it is important to know which document to reference. You can attach a curve in memory to a document to use that document's system of measurement. This can be done by specifying the optional Document parameter in the CreateCurve method, or by using the BindToDocument method.

Parameters	Description

Document	Specifies the settings to apply [in]
Optional
Default value = Nothing

Return value

Returns Curve

Example

The following example creates a curve on the active layer using the settings of the active document.

Sub Test()

Dim crv As Curve

Dim s As Shape

Dim sp As SubPath

Set crv = Application.CreateCurve(ActiveDocument)

Set sp = crv.CreateSubPath(1, 5)

sp.AppendLineSegment 2, 0

sp.AppendCurveSegment2 5, 7, 6, 6, 3, 5

sp.AppendCurveSegment2 7, 2, 3, 6, 7, 1

sp.AppendLineSegment 9, 6

sp.Nodes(3).Type = cdrSmoothNode

Set s = ActiveLayer.CreateCurve(crv)

End Sub

You can also use the New keyword to create a curve in memory.

Dim crv As Curve

Set crv = New Curve

 Related Topics


Application.CreateDocument

Function CreateDocument() As Document

Application

Description

The CreateDocument method creates a new CorelDRAW document.

Return value

Returns Document

Example

The following example creates a new CorelDRAW document, adds a colored ellipse to the active layer of the document, and saves the new document with a new name.

Sub DocumentCreate()

Dim doc As Document

Set doc = CreateDocument()

doc.ActiveLayer.CreateEllipse (0, 3, 5, 1).Fill.UniformColor.CMYKAssign 0, 100, 100, 0

doc.saveas "My New Document"

End Sub

 Related Topics


Application.CreateDocumentFromTemplate

Function CreateDocumentFromTemplate(ByVal Template As String, [ByVal IncludeGraphics As Boolean = True]) As Document

Application

Description

The CreateDocumentFromTemplate method creates a new document based on a template in CorelDRAW.

Parameters	Description

Template	Specifies the filename of a template. [in]

IncludeGraphics	Specifies whether to include graphics from the template in the new document [in]
Optional
Default value = True

Return value

Returns Document

Example

The following example creates a new document based on the template, webtemplate_001.cdt, and adds text content to each text block.

Sub Test()

Dim d As Document

Dim s As Shape

Set d = CreateDocumentFromTemplate(Path & "Template\Web\webtemplate_001.cdt", True)

For Each s In d.ActivePage.Shapes

If s.Type = cdrTextShape Then

s.Text.Contents = s.Name

End If

Next s

End Sub

 Related Topics


Application.CreateFixedColor

Function CreateFixedColor(ByVal PaletteID As cdrPaletteID, ByVal PaletteIndex As Long, [ByVal Tint As Long = 100]) As Color

Application

Description

The CreateFixedColor method creates a color from a fixed color palette in CorelDRAW.

Parameters	Description

PaletteID	Sets the Palette ID that uniquely identifies which color palette to use in CorelDRAW. [in]

PaletteIndex	Sets the color to use by referencing the index number of a color within a palette.) [in]

Tint	Sets the tint of the palette color. Tints are lighter shades of a spot color that are created by changing the percentage tint value. [in]
Optional
Default value = 100

Return value

Returns Color

Example

CreateFixedColor ( cdrPANTONECoated, 1, 50)

 Related Topics


Application.CreateGrayColor

Function CreateGrayColor(ByVal GrayValue As Long) As Color

Application

Description

The CreateGrayColor method creates a color object based on the Grayscale color model.

Parameters	Description

GrayValue	Sets the level of gray in the Grayscale color model. Each color is defined as a value between 0 and 255, where 0 is darkest (black) and 255 is lightest (white). [in]

Return value

Returns Color

Example

CreateGrayColor (255)

 Related Topics


Application.CreateHLSColor

Function CreateHLSColor(ByVal Hue As Long, ByVal Lightness As Long, ByVal Saturation As Long) As Color

Application

Description

The CreateHLSColor method creates a new color from the HLS color model.

Parameters	Description

Hue	Sets the Hue for the HLS color model. Hue is the property of a color that allows us to classify it by its name. For example, blue, green, and red are all hues. Values range from 0 to 360. [in]

Lightness	Sets the Lightness for the HLS color model. Lightness determines the intensity of the color. Values range from 0 to 255. [in]

Saturation	Sets the Saturation for the HLS color model. Saturation is the purity, vividness, or color depth (from dull to intense) of a color, expressed as the absence of white. A color that has 100% saturation contains no white. A color with 0% saturation is a shade of gray. Values range from 0 (0%) to 255 (100%). [in]

Return value

Returns Color

Example

CreateHLSColor (200, 100, 100)

 Related Topics


Application.CreateHSBColor

Function CreateHSBColor(ByVal Hue As Long, ByVal Saturation As Long, ByVal Brightness As Long) As Color

Application

Description

The CreateHSBColor method creates a color object from the HSB color model.

Parameters	Description

Hue	Sets the Hue for the HSB color model. Hue is the property of a color that allows us to classify it by its name. For example, blue, green, and red are all hues. Values range from 0 to 360. [in]

Saturation	Sets the Saturation for the HSB color model. Saturation is the purity, vividness, or color depth (from dull to intense) of a color, expressed as the absence of white. A color that has 100% saturation contains no white. A color with 0% saturation is a shade of gray. Values range from 0 to 255. [in]

Brightness	Sets the Brightness for the HSB color model. Brightness is the intensity (lighter or darker color) or the amount of light that is transmitted or reflected from a given pixel. In the HSB color model, brightness is a measure of how much white a color contains. In this case, a brightness value of 0 produces black and a brightness value of 255 produces white. Values range from 0 to 255. [in]

Return value

Returns Color

Example

CreateHSBColor (200, 100, 100)

 Related Topics


Application.CreateLabColor

Function CreateLabColor(ByVal L As Long, ByVal A As Long, ByVal B As Long) As Color

Application

Description

The CreateLabColor method creates a color object based on the Lab color model.

Parameters	Description

L	Sets the Luminance, or brightness, value in the LAB color model. Values range from 0 to 255. [in]

A	Sets one of two chromatic components in the LAB color model. "A" refers to a range of colors between green and red. Values range from -128 to 127. [in]

B	Sets one of two chromatic components in the LAB color model. "B" refers to a range of colors between blue and yellow. Values range from -128 to 127. [in]

Return value

Returns Color

Example

CreateLabColor (128, 0, 0)

 Related Topics


Application.CreateNodeRange

Function CreateNodeRange() As NodeRange

Application

Description

The CreateNodeRange method creates an empty NodeRange object.

Return value

Returns NodeRange

Example

The following example creates an ellipse and converts it to curves. Every second node is added to the NodeRange, and the nodes are moved along the y-axis.

Sub Test()

Dim s As Shape

Dim crv As Curve

Dim nr As NodeRange

Dim n As Node

Dim i As Integer

Set s = ActiveLayer.CreateEllipse(0, 0, 5, 5)

s.ConvertToCurves

Set nr = CreateNodeRange

For i = 1 To s.Curve.Nodes.Count Step 2

Set n = s.Curve.Nodes(i)

nr.Add n

Next i

nr.Move 0, 2

End Sub

 Related Topics


Application.CreatePatternCanvas

Function CreatePatternCanvas() As PatternCanvas

Application

Description

The CreatePatternCanvas method creates an empty PatternCanvas object.

Return value

Returns PatternCanvas

Example

The following example creates an empty pattern canvas and copies another pattern to this canvas. A rectangle is filled with this pattern, and then the data of the pattern is changed.

Sub Test()

Dim c As PatternCanvas

Set c = CreatePatternCanvas

c.PutCopy PatternCanvases(29)

With ActiveLayer.CreateRectangle(0, 0, 2, 2)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

c.Data = "%%['$aH,&A5&0C"

End With

End Sub

 Related Topics


Application.CreateRegistrationColor

Function CreateRegistrationColor() As Color

Application

Description

The CreateRegistrationColor method creates a registration color object. Registration color is printed on all separation plates.

Return value

Returns Color

Example

The following example creates cropmarks around selected object(s) and assigns Registration Color to each of them.

Sub Test()

Const Offset As Double = 1 ' Cropmark offset

Const Length As Double = 5 ' Cropmark length

Dim x As Double, y As Double, w As Double, h As Double

Dim c As Color

ActiveDocument.Unit = cdrMillimeter

Set c = CreateRegistrationColor()

ActiveSelection.GetBoundingBox x, y, w, h, True

ActiveLayer.CreateLineSegment(x - Length - Offset, y, x - Offset, y).Outline.Color = c

ActiveLayer.CreateLineSegment(x, y - Length - Offset, x, y - Offset).Outline.Color = c

ActiveLayer.CreateLineSegment(x + w + Offset, y, x + w + Length + Offset, y).Outline.Color = c

ActiveLayer.CreateLineSegment(x + w, y - Length - Offset, x + w, y - Offset).Outline.Color = c

ActiveLayer.CreateLineSegment(x - Length - Offset, y + h, x - Offset, y + h).Outline.Color = c

ActiveLayer.CreateLineSegment(x, y + h + Length + Offset, x, y + h + Offset).Outline.Color = c

ActiveLayer.CreateLineSegment(x + w + Offset, y + h, x + w + Length + Offset, y + h).Outline.Color = c

ActiveLayer.CreateLineSegment(x + w, y + h + Length + Offset, x + w, y + h + Offset).Outline.Color = c

End Sub

 Related Topics


Application.CreateRGBColor

Function CreateRGBColor(ByVal Red As Long, ByVal Green As Long, ByVal Blue As Long) As Color

Application

Description

The CreateRGBColor method creates a color object based on the RGB color model.

Parameters	Description

Red	Sets the level of red in the RGB color model. Values range from 0 to 255. [in]

Green	Sets the level of green in the RGB color model. Values range from 0 to 255. [in]

Blue	Sets the level of blue in the RGB color model. Values range from 0 to 255. [in]

Return value

Returns Color

Example

The following example creates a rectangle that covers the current page, and applies a red-to-black fountain fill to the rectangle.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, ActivePage.SizeWidth, ActivePage.SizeHeight)

s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(0, 0, 0)

End Sub

 Related Topics


Application.CreateSegmentRange

Function CreateSegmentRange() As SegmentRange

Application

Description

The CreateSegmentRange method creates an empty SegmentRange object.

Return value

Returns SegmentRange

Example

The following example creates a curve, adds its segments to a SegmentRange, and changes the segments in the range to line segments.

Sub Test()

Dim s As Shape, sp As SubPath, crv As Curve

Dim sr As SegmentRange

Dim i As Integer

Set crv = Application.CreateCurve(ActiveDocument)

Set sp = crv.CreateSubPath(1.351, 8.545)

sp.AppendCurveSegment 1.351, 8.926, 0.127, 89.901, 0.127, -64.56

sp.AppendCurveSegment 1.156, 8.952, 0.066, 115.44, 0.066, -48.906

sp.AppendCurveSegment 1.156, 9.15, 0.065, 131.09, 0.065, -133.149

sp.AppendCurveSegment 1.351, 9.163, 0.065, 46.846, 0.065, -116.315

sp.AppendCurveSegment 1.351, 9.545, 0.127, 63.683, 0.127, -89.902

sp.AppendCurveSegment 0.976, 9.545, 0.125, 179.951, 0.125, 25.612

sp.AppendCurveSegment 0.96, 9.342, 0.063, -154.391, 0.063, 40.943

sp.AppendCurveSegment 0.767, 9.339, 0.067, -139.06, 0.067, -41.987

sp.AppendCurveSegment 0.752, 9.547, 0.063, 138.014, 0.065, -33.906

sp.AppendCurveSegment 0.351, 9.545, 0.134, 146.087, 0.134, 0.045

sp.AppendCurveSegment 0.351, 9.163, 0.127, -90#, 0.127, 63.681

sp.AppendCurveSegment 0.156, 9.15, 0.065, -116.317, 0.065, 46.846

sp.AppendCurveSegment 0.156, 8.952, 0.065, -133.152, 0.065, 131.093

sp.AppendCurveSegment 0.351, 8.926, 0.066, -48.906, 0.066, 115.439

sp.AppendCurveSegment 0.351, 8.545, 0.127, -64.561, 0.127, 90#

sp.AppendCurveSegment 0.752, 8.547, 0.134, 0.002, 0.134, 146.087

sp.AppendCurveSegment 0.767, 8.339, 0.065, -33.908, 0.063, 138.012

sp.AppendCurveSegment 0.96, 8.342, 0.067, -41.987, 0.067, -139.058

sp.AppendCurveSegment 0.976, 8.545, 0.063, 40.943, 0.063, -154.388

sp.AppendCurveSegment 1.351, 8.545, 0.125, 25.613, 0.125, 179.998

sp.Closed = True

Set s = ActiveLayer.CreateCurve(crv)

Set sr = CreateSegmentRange

For i = 1 To s.Curve.Segments.Count

sr.Add s.Curve.Segments(i)

Next i

sr.SetType cdrLineSegment

End Sub

 Related Topics


Application.CreateShapeRange

Function CreateShapeRange() As ShapeRange

Application

Description

The CreateShapeRange creates an empty ShapeRange object.

Return value

Returns ShapeRange

Example

The following example creates six red ellipses and then rotates them.

Sub Test()

Dim n As Long

Dim sr As ShapeRange

Dim s As Shape

Set sr = CreateShapeRange

Set s = ActiveLayer.CreateEllipse2(0, 0, 0.5)

s.RotationCenterX = 1

s.RotationCenterY = 1

For n = 1 To 5

sr.Add s.Duplicate

s.Rotate 60

Next n

sr.Add s

sr.ApplyUniformFill CreateRGBColor(255, 0, 0)

End Sub

 Related Topics


Application.CreateSnapPoint

Function CreateSnapPoint(ByVal PositionX As Double, ByVal PositionY As Double) As SnapPoint

Application

Description

The CreateSnapPoint method creates a free snap point that can be used to create a free connector line (a line not attached to any object).

Parameters	Description

PositionX	Specifies the horizontal position of a snap point [in]

PositionY	Specifies the vertical position of a snap point [in]

Return value

Returns SnapPoint

Example

The following example creates a rectangle and attaches a connector line to its center. The second end of the connector line is loose and placed in the center of the page.

Sub Test()

Dim rect As Shape

Set rect = ActiveLayer.CreateRectangle(0, 0, 3, 3)

ActiveLayer.CreateConnector rect.SnapPoints(9), _

CreateSnapPoint(ActivePage.SizeWidth / 2, ActivePage.SizeHeight / 2)

End Sub

 Related Topics


Application.CreateStructExportOptions

Function CreateStructExportOptions() As StructExportOptions

Application

Description

The CreateStructExportOptions creates a StructExportOptions object.

Return value

Returns StructExportOptions

Example

The following example creates a few shapes and exports the document to the JPEG format.

Sub Test()

Dim exp As ExportFilter

Dim se As StructExportOptions

ActiveLayer.CreateRectangle 1, 2, 3, 4

ActiveLayer.CreateRectangle2 4, 4, 5, 5

ActiveLayer.CreatePolygon 1, 3, 4, 5, 6

Set se = CreateStructExportOptions

With se

.AntiAliasingType = cdrNormalAntiAliasing

.ImageType = cdrRGBColorImage

.ResolutionX = 97

.ResolutionY = 97

End With

Set exp = ActiveDocument.ExportEx("c:\primitives.jpg", cdrJPEG, cdrCurrentPage, se)

exp.Finish

End Sub

 Related Topics


Application.CreateStructImportOptions

Function CreateStructImportOptions() As StructImportOptions

Application

Description

The CreateStructImportOptions method creates a StructImportOptions object.

Return value

Returns StructImportOptions

Example

The following example imports a JPEG file and links it externally.

Sub TestImport()

Dim im As ImportFilter

Dim si As StructImportOptions

Set si = CreateStructImportOptions

si.LinkBitmapExternally = True

Set im = ActiveLayer.ImportEx("c:\primitives.jpg", , si)

im.Finish

End Sub

 Related Topics


Application.CreateStructPaletteOptions

Function CreateStructPaletteOptions() As StructPaletteOptions

Application

Description

The CreateStructPaletteOptions method creates a StructPaletteOptions object.

Return value

Returns StructPaletteOptions

Example

The following example exports a document to GIF format and sets white to transparent.

Sub Test()

Dim exp As ExportFilter

Dim pal As StructPaletteOptions

Dim se As StructExportOptions

Dim n As Long

Dim i As Integer

Set pal = CreateStructPaletteOptions

Set se = CreateStructExportOptions

With pal

.DitherType = cdrDitherNone

.Smoothing = 5

.PaletteType = cdrPaletteOptimized

End With

With se

.AntiAliasingType = cdrNormalAntiAliasing

.Dithered = False

.ResolutionX = 96

.ResolutionY = 96

End With

Set exp = ActiveDocument.ExportEx("c:\transparent.gif", cdrGIF, , se, pal)

With exp

n = .NumColors

For i = 1 To n

If .PaletteColor(i) = RGB(255, 255, 255) Then

.ColorIndex = i

.Transparency = 1

Exit For

End If

Next i

.Finish

End With

End Sub

 Related Topics


Application.CreateStructSaveAsOptions

Function CreateStructSaveAsOptions() As StructSaveAsOptions

Application

Description

The CreateStructSaveAsOptions creates a StructSaveAsOptions object.

Return value

Returns StructSaveAsOptions

Example

The following example saves each open document to the drive labelled as "C."

Sub TestSaveAs()

Dim sa As StructSaveAsOptions

Dim d As Document

Set sa = CreateStructSaveAsOptions

With sa

.EmbedICCProfile = True

.EmbedVBAProject = True

.Filter = cdrCDR

.IncludeCMXData = True

.Overwrite = True

.ThumbnailSize = cdr10KColorThumbnail

.Version = cdrCurrentVersion

End With

For Each d In Documents

d.SaveAs "c:\" & CStr(d.Index) & ".cdr", sa

Next d

End Sub

 Related Topics


Application.CreateYIQColor

Function CreateYIQColor(ByVal Y As Long, ByVal I As Long, ByVal Q As Long) As Color

Application

Description

The CreateYIQColor method creates a color object based on the YIQ color model.

Parameters	Description

Y	Sets the luminance, or brightness, value in the YIQ color model. Values range from 0 to 255. [in]

I	Sets one of two chromaticity values in the YIQ color model. Values range from 0 to 255. [in]

Q	Sets one of two chromaticity values in the YIQ color model. Values range from 0 to 255. [in]

Return value

Returns Color

Example

CreateYIQColor (100, 255, 255)

 Related Topics


Application.ImportWorkspace

Sub ImportWorkspace(ByVal FileName As String)

Application

Description

The ImportWorkspace method imports workspace elements into the current workspace.

Parameters	Description

FileName	The FileName parameter identifies the full path name of the workspace file that is imported to CorelDRAW. [in]

Example

The following example imports the specified workspace and merges it with the current workspace.

Sub Test()

ImportWorkspace "C:\Temp\MyToolbar.cwf"

End Sub

 Related Topics


Application.InitializeVBA

Function InitializeVBA() As Boolean

Application

Description

The InitializeVBA method loads and initializes the VBA Editor.

This method is called from an automation controller such as Visual Basic (VB) or C++.

Return value

Returns Boolean

Example

The following example runs the VBA macro, "CreatePuzzlePiece," from a VB project.

The first subroutine should be placed in a code module named "TestModule." The second subroutine should be placed in the code of a form module of a standard EXE project in VB. There must be a command button on the form.

Public Sub CreatePuzzlePiece()

Dim s As Shape, sp As SubPath, crv As Curve

Dim i As Integer

Optimization = True

Set crv = Application.CreateCurve(ActiveDocument)

Set sp = crv.CreateSubPath(1.351, 8.545)

sp.AppendCurveSegment 1.351, 8.926, 0.127, 89.901, 0.127, -64.56

sp.AppendCurveSegment 1.156, 8.952, 0.066, 115.44, 0.066, -48.906

sp.AppendCurveSegment 1.156, 9.15, 0.065, 131.09, 0.065, -133.149

sp.AppendCurveSegment 1.351, 9.163, 0.065, 46.846, 0.065, -116.315

sp.AppendCurveSegment 1.351, 9.545, 0.127, 63.683, 0.127, -89.902

sp.AppendCurveSegment 0.976, 9.545, 0.125, 179.951, 0.125, 25.612

sp.AppendCurveSegment 0.96, 9.342, 0.063, -154.391, 0.063, 40.943

sp.AppendCurveSegment 0.767, 9.339, 0.067, -139.06, 0.067, -41.987

sp.AppendCurveSegment 0.752, 9.547, 0.063, 138.014, 0.065, -33.906

sp.AppendCurveSegment 0.351, 9.545, 0.134, 146.087, 0.134, 0.045

sp.AppendCurveSegment 0.351, 9.163, 0.127, -90#, 0.127, 63.681

sp.AppendCurveSegment 0.156, 9.15, 0.065, -116.317, 0.065, 46.846

sp.AppendCurveSegment 0.156, 8.952, 0.065, -133.152, 0.065, 131.093

sp.AppendCurveSegment 0.351, 8.926, 0.066, -48.906, 0.066, 115.439

sp.AppendCurveSegment 0.351, 8.545, 0.127, -64.561, 0.127, 90#

sp.AppendCurveSegment 0.752, 8.547, 0.134, 0.002, 0.134, 146.087

sp.AppendCurveSegment 0.767, 8.339, 0.065, -33.908, 0.063, 138.012

sp.AppendCurveSegment 0.96, 8.342, 0.067, -41.987, 0.067, -139.058

sp.AppendCurveSegment 0.976, 8.545, 0.063, 40.943, 0.063, -154.388

sp.AppendCurveSegment 1.351, 8.545, 0.125, 25.613, 0.125, 179.998

sp.Closed = True

Set s = ActiveLayer.CreateCurve(crv)

Optimization = False

ActiveWindow.Refresh

Application.Refresh

End Sub

Private Sub Command1_Click()

Dim cDraw As Object

Dim gms As CorelDRAW.GMSManager

Set cDraw = CreateObject("CorelDRAW.Application")

cDraw.CreateDocument

cDraw.InitializeVBA

cDraw.Visible = True

Set gms = cDraw.GMSManager

gms.RunMacro "GlobalMacros", "TestModule.CreatePuzzlePiece"

End Sub

 Related Topics


Application.OpenCorelScriptFile

Function OpenCorelScriptFile(ByVal FileName As String) As CorelScriptFile

Application

Description

The OpenCorelScriptFile method opens a Corel SCRIPT file and returns a reference to the CorelScriptFile object which allows you to load and execute a Corel SCRIPT program.

Parameters	Description

FileName	The FileName parameter identifies the full path name of the Corel SCRIPT file that is opened up in CorelDRAW and executed. [in]

Return value

Returns CorelScriptFile

Example

The following example opens an existing Corel SCRIPT file. An ellipse is created on the active layer of the current document and the script runs to create a fill effect, Alien Sky, on the ellipse.

Sub Test()

Dim csf As CorelScriptFile

Set csf = OpenCorelScriptFile("C:\Corel\Graphics10\Draw\Fill_Out\Fills\Fountain\aliensky.csc")

ActiveDocument.ActiveLayer.CreateEllipse2 3, 3, 2

csf.Play

End Sub

 Related Topics


Application.OpenDocument

Function OpenDocument(ByVal FileName As String) As Document

Application

Description

The OpenDocument method opens an existing document in CorelDRAW.

Parameters	Description

FileName	Specifies the full path name of the existing document that is opened [in]

Return value

Returns Document

Example

The following example opens an existing CorelDRAW (CDR) document, adds a page to the document, creates a colored ellipse on the new page, and saves the entire document.

Sub DocumentOpen()

Dim doc As Document

Set doc = OpenDocument("C:\Flower.cdr")

With doc

.AddPages (1)

.ActiveLayer.CreateEllipse(0, 3, 5, 1).Fill.UniformColor.CMYKAssign 0, 100, 100, 0

.Save

End With

End Sub

 Related Topics


Application.Quit

Sub Quit()

Application

Description

The Quit method closes the current session of CorelDRAW.

Example

The following example terminates the current session of CorelDRAW.

Sub QuitApp()

Quit

End Sub

 Related Topics


Application.Refresh

Sub Refresh()

Application

Description

The Refresh method updates all open Docker windows.

Example

The following example updates the Properties Docker window with the new width for the outline. The Outline tab of the Properites Docker window must be open.

Sub Test()

Dim rect As Shape

Optimization = True

Set rect = ActiveLayer.CreateRectangle(0, 0, 3, 3)

rect.Outline.Width = 0.4

Optimization = False

ActiveWindow.Refresh

Refresh

End Sub

 Related Topics


AppWindow properties

AppWindow     Legend

    Active
    Application
      Caption
    ClientHeight
    ClientWidth
    Handle
      Height
      Left
    Parent
      Top
      Width
      WindowState


AppWindow methods

AppWindow     Legend

   Activate


AppWindow

Class AppWindow

Properties     Methods     Referenced By

The AppWindow class represents the application window object. The application window represents the main CorelDRAW window.

 Related Topics


AppWindow.Active

Property Active As Boolean

AppWindow

Description

The Active property returns a value indicating the status of the CorelDRAW main application window. If the window is active, a value of true is returned, indicating that it is currently in use. If the window is inactive, the return value is false, indicating that the main application window is currently open but not in use.

Use the Activate method to change the inactive status of the main application window.

Read-Only

Example

The following example displays the status of the CorelDRAW main application window in a message box.

Sub AppWindowActive()

If AppWindow.Active Then

MsgBox "CorelDRAW is currently active."

Else

MsgBox "CorelDRAW is not active at this time."

End If

End Sub

 Related Topics


AppWindow.Application

Property Application As Object

AppWindow

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


AppWindow.Caption

Property Caption As String

AppWindow

Description

The Caption property returns or sets the display text of the main application window. The caption appears as text in the title bar of the application window.

If the document window is maximized when using the Caption property, the document title will also display after the caption in the title bar of the main application window.

Example

The following example sets the caption of the CorelDRAW main application window.

Sub AppWindowCaption()

AppWindow.Caption = "My Draw Application"

End Sub

The following example resets the caption.

Sub ResetCaption()

Dim NewCaption As String

NewCaption = "My New Caption"

If AppWindow.Caption <> NewCaption Then

AppWindow.Caption = NewCaption

End If

End Sub

 Related Topics


AppWindow.ClientHeight

Property ClientHeight As Long

AppWindow

Description

The ClientHeight property returns a numerical value that measures the height of a client area, the gray area where document windows display within the main application window of CorelDRAW. The area excludes dockers, docked toolbars, menus, the status bar, and palettes.

The ClientWidth property is measured in screen pixels.

Read-Only

Example

The following example displays the client height, in screen pixels, in a message box.

Sub AppWindowClient()

With AppWindow

MsgBox .ClientHeight

End With

End Sub

 Related Topics


AppWindow.ClientWidth

Property ClientWidth As Long

AppWindow

Description

The ClientWidth property returns a numerical value that measures the width of a client area, the gray area where document windows display within the main application window of CorelDRAW. The area excludes dockers, docked toolbars, menus, the status bar, and palettes.

The ClientWidth property is measured in screen pixels.

Read-Only

Example

The following example displays the client width, in screen pixels, in a message box.

Sub AppWindowClient()

With AppWindow

MsgBox .ClientWidth

End With

End Sub

 Related Topics


AppWindow.Handle

Property Handle As Long

AppWindow

Description

The Handle property returns the window handle value of the main application window. The value can be used with calls to Windows API functions that require handles.

Read-Only

Example

The following example shows a message using the Windows API function, MessageBox, and specifying the CorelDRAW window as the parent to the message box.

Private Declare Function MessageBox Lib "user32" Alias "MessageBoxA" _

(ByVal hwnd As Long, ByVal lpText As String, _

ByVal lpCaption As String, ByVal wType As Long) As Long

Sub Test()

MessageBox AppWindow.Handle, "Some Message", "Some Caption", 64

End Sub

 Related Topics


AppWindow.Height

Property Height As Long

AppWindow

Description

The Height property sets the height of the CorelDRAW main application window on the desktop.

This property only applies when the main application window is in a normal window state, that is, the window is not minimized or maximized.

The height of the application window is a numerical value measured in screen pixels.

Example

The following example sets the current window state to normal, defines the new dimensions of the window, and resizes the CorelDRAW main application window according to the new dimensions.

Sub AppWindowHeight()

With AppWindow

.WindowState = cdrWindowNormal

.Top = 10

.Left = 10

.Height = 500

.Width = 600

End With

End Sub

 Related Topics


AppWindow.Left

Property Left As Long

AppWindow

Description

The Left property sets the distance, in screen pixels, from the CorelDRAW main application window's left border to the left side of the monitor's display area.

This property only applies when the main application window is in a normal window state; that is, the window is not minimized or maximized.

Example

The following example sets the current window state to normal, defines the new dimensions of the window, and resizes the CorelDRAW main application window according to the new dimensions.

Sub AppWindowLeft()

With AppWindow

.WindowState = cdrWindowNormal

.Top = 10

.Left = 10

.Height = 500

.Width = 600

End With

End Sub

 Related Topics


AppWindow.Parent

Property Parent As Object

AppWindow

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


AppWindow.Top

Property Top As Long

AppWindow

Description

The Top property sets the distance, in screen pixels, from the CorelDRAW window's top border to the top of the monitor's display area.

This property only applies when the main application window is in a normal window state; that is, the window is not minimized or maximized.

Example

The following example sets the current window state to normal, defines the new dimensions of the window, and resizes the CorelDRAW main application window according to the new dimensions.

Sub AppWindowTop()

With AppWindow

.WindowState = cdrWindowNormal

.Top = 10

.Left = 10

.Height = 500

.Width = 600

End With

End Sub

 Related Topics


AppWindow.Width

Property Width As Long

AppWindow

Description

The Width property sets the height of the CorelDRAW main application window on the desktop.

This property only applies when the main application window is in a normal window state; that is, the window is not minimized or maximized.

The width of the application window is a numerical value measured in screen pixels.

Example

The following example sets the current window state to normal, defines the new dimensions of the window, and resizes the CorelDRAW main application window according to the new dimensions.

Sub AppWindowWidth()

With AppWindow

.WindowState = cdrWindowNormal

.Top = 10

.Left = 10

.Height = 500

.Width = 600

End With

End Sub

 Related Topics


AppWindow.WindowState

Property WindowState As cdrWindowState

AppWindow

Description

The WindowState property returns or sets the current window state of the CorelDRAW main application window. This window can be minimized, maximized or in a normal state.

Example

The following example begins with the application window maximized, sets the current window state to minimized, and displays a message that the window has been minimized. The main application window is then restored to a maximized state.

Sub AppWindowWindowState()

Dim state As cdrWindowState

state = cdrWindowMaximized

AppWindow.WindowState = cdrWindowMinimized

MsgBox "CorelDRAW is now minimized."

AppWindow.WindowState = state

End Sub

 Related Topics


AppWindow.Activate

Sub Activate()

AppWindow

Description

The Activate method makes the main application window active and gives it keyboard focus.

In many cases, newer operating systems like Windows 98 and Windows 2000 don't allow the application to activate itself, to prevent intervention with you're current activity. If the application is not granted active status in certain situations, the application window will start flashing in the taskbar, but it will not appear in the foreground.

Example

The following example activates the CorelDRAW main application window if it is currently inactive. A window is inactive if it is open but not the currently used Windows application.

Sub Activate()

If Not AppWindow.Active Then AppWindow.Activate

End Sub

 Related Topics


ArrowHead properties

ArrowHead     Legend

    Index


ArrowHead

Class ArrowHead

Properties     Referenced By

The ArrowHead class represents an arrowhead on a curve or outline.

 Related Topics


ArrowHead.Index

Property Index As Long

ArrowHead

Description

The Index property returns a value associated with an arrowhead object. Each type of arrowhead in CorelDRAW is identified by an index number. For example, ArrowHeads(5) refers to the fifth arrowhead in the arrowheads collection of CorelDRAW.

Read-Only

Example

The following example takes all the shapes in the current selection, and determines which shapes have outlines. If the shape has an outline, an arrowhead with an index of five replaces all the arrowheads that have an index of 1. This is done for both the start arrows and end arrows of the shape objects.

Sub Index()

Dim s As Shape

For Each s In ActiveDocument.Selection.Shapes

If s.Outline.Type = cdrOutline Then

With s.Outline

If .StartArrow.Index = 1 Then

.StartArrow = ArrowHeads(5)

End If

If s.Outline.EndArrow.Index = 1 Then

s.Outline.EndArrow = ArrowHeads(5)

End If

End With

End If

Next s

End Sub

 Related Topics


ArrowHeads properties

ArrowHeads     Legend

    Application
    Count
  Item
    Parent


ArrowHeads methods

ArrowHeads     Legend

   Remove


ArrowHeads

Class ArrowHeads

Properties     Methods     Referenced By

The ArrowHeads class represents the collection of available preset ArrowHeads in CorelDRAW.

 Related Topics


ArrowHeads.Application

Property Application As Application

ArrowHeads

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


ArrowHeads.Count

Property Count As Long

ArrowHeads

Description

The Count property returns the number of arrowheads in the ArrowHeads collection of CorelDRAW.

Read-Only

Example

The following example identifies all arrowheads of selected objects that have an index of one and replaces them with arrowheads that have an index equal to the total number of arrowhead objects. This will replace the selected arrowheads with the last arrowhead in the ArrowHeads collection.

Sub Count()

Dim s As Shape

Dim Arrow As ArrowHead

Set Arrow = ArrowHeads(ArrowHeads.Count)

For Each s In ActiveDocument.Selection.Shapes

If s.Outline.Type = cdrOutline Then

With s.Outline

If .StartArrow.Index = 1 Then

.StartArrow = Arrow

End If

If .EndArrow.Index = 1 Then

.StartArrow = Arrow

End If

End With

End If

Next s

End Sub

 Related Topics


ArrowHeads.Item

Property Item(ByVal Index As Long) As ArrowHead

ArrowHeads

Description

The Item property returns a value associated with the index number of an arrowhead object in the ArrowHeads collection of CorelDRAW. Each type of arrowhead in CorelDRAW is identified by an index number represented in base 1. For example, ArrowHeads(5) refers to the fifth arrowhead in the ArrowHeads collection of CorelDRAW.

The Item property of the ArrowHeads collection is the default property and may be omitted when referencing items in the collection. For example, ArrowHeads.Item(5) is the same as ArrowHeads(5) - they both reference the fifth arrowhead in the collection.

Read-Only

Parameters	Description

Index	Index is a preset placeholder for each object in an ArrowHeads collection; it uniquely identifies each member of the collection. [in]

Example

The following example takes all the shapes in the current selection, and determines which shapes have outlines. If the shape has an outline, an arrowhead with an index of five is applied to the start arrow position of each shape.

Sub Item()

Dim s As Shape

For Each s In ActiveDocument.Selection.Shapes

If s.Outline.Type = cdrOutline Then

s.Outline.StartArrow = ArrowHeads.Item(5)

End If

Next s

End Sub

 Related Topics


ArrowHeads.Parent

Property Parent As Application

ArrowHeads

Description

The Parent property returns the object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property, pointing to the object's parent object in the object model.

Read-Only

 Related Topics


ArrowHeads.Remove

Sub Remove(ByVal Index As Long)

ArrowHeads

Description

The Remove method deletes an arrowhead object from the ArrowHeads collection in CorelDRAW.

Parameters	Description

Index	Index is a preset placeholder for each object in an ArrowHeads collection; it uniquely identifies each member of the collection. [in]

Example

The following example removes the last arrowhead object from the ArrowHeads collection.

Sub ArrowHeadDelete()

ArrowHeads.Remove (ArrowHeads.Count)

End Sub

 Related Topics


Bitmap properties

Bitmap     Legend

    CropEnvelopeModified
    Cropped
    Embedded
    ExternalLinkTime
    ExternallyLinked
    IsEPS
    LinkFileName
    Mode
    OPILinked
    ResolutionX
    ResolutionY
    SizeHeight
    SizeWidth
    Transparent
    Watermarked


Bitmap methods

Bitmap     Legend

   ApplyBitmapEffect
   ConvertTo
   ConvertToBW
   ConvertToPaletted
   ConvertToPaletted2
   Crop
   Inflate
   Resample
   ResetCropEnvelope
   ResolveLink
   SaveAs
   UpdateLink


Bitmap

Class Bitmap

Properties     Methods     Referenced By

The Bitmap class represents the bitmap-specific properties of the Shape object.

 Related Topics


Bitmap.CropEnvelopeModified

Property CropEnvelopeModified As Boolean

Bitmap

Description

The CropEnvelopeModified property returns True if the cropping path of the bitmap has been modified.

Read-Only

Example

The following example displays the number of bitmaps that have a modified cropping path.

Sub Test()

Dim s As Shape, n As Long

n = 0

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.CropEnvelopeModified Then n = n + 1

End If

Next s

MsgBox "The crop envelope has been modified on " & n & " bitmaps."

End Sub

 Related Topics


Bitmap.Cropped

Property Cropped As Boolean

Bitmap

Description

The Cropped property returns True if the bitmap can be cropped.

Read-Only

Example

The following example displays the number of bitmaps that can be cropped on the active page.

Sub Test()

Dim s As Shape, n As Long

n = 0

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.Cropped Then n = n + 1

End If

Next s

MsgBox "There are " & n & " bitmaps which can be cropped."

End Sub

 Related Topics


Bitmap.Embedded

Property Embedded As Boolean

Bitmap

Description

The Embedded property returns True if the bitmap is embedded.

Read-Only

Example

The following example displays the number of bitmaps that are embedded in the active page.

Sub Test()

Dim s As Shape, n As Long

n = 0

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.Embedded Then n = n + 1

End If

Next s

MsgBox "There are " & n & " embedded bitmaps"

End Sub

 Related Topics


Bitmap.ExternalLinkTime

Property ExternalLinkTime As Date

Bitmap

Description

The ExternalLinkTime returns the time at which the bitmap was externally linked.

Read-Only

Example

The following example updates the externally linked bitmap if the original bitmap had been modified since it was linked.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

With s.Bitmap

If Not .Embedded Then

If DateDiff("s", FileDateTime(s.Bitmap.LinkFileName), _

.ExternalLinkTime) <> 0 Then

.UpdateLink

End If

End If

End With

End If

Next s

End Sub

 Related Topics


Bitmap.ExternallyLinked

Property ExternallyLinked As Boolean

Bitmap

Description

The ExternallyLinked property returns True if the bitmap is linked to an external file.

Read-Only

Example

The following example displays the link status of a bitmap.

Sub Link()

MsgBox ActiveShape.Bitmap.ExternallyLinked

End Sub

 Related Topics


Bitmap.IsEPS

Property IsEPS As Boolean

Bitmap

Description

The IsEPS property returns True if the bitmap is a placeholder in the EPS format.

Read-Only

Example

The following example searches for a header in the EPS format. If one is found, it is selected.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

s.Selected = False

If s.Type = cdrBitmapShape Then

If s.Bitmap.IsEPS Then s.Selected = True

End If

Next s

End Sub

 Related Topics


Bitmap.LinkFileName

Property LinkFileName As String

Bitmap

Description

The LinkFileName property returns the filename of an externally linked bitmap.

Read-Only

Example

The following example displays the filenames of all externally linked bitmaps.

Sub Test()

Dim s As Shape

Dim str As String

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.ExternallyLinked Then str = str & s.Bitmap.LinkFileName & vbCrLf

End If

Next s

MsgBox "The external file names are:" & vbCrLf & str

End Sub

 Related Topics


Bitmap.Mode

Property Mode As cdrImageType

Bitmap

Description

The Mode property returns the color mode of the bitmap.

Read-Only

Example

The following example displays the number of bitmaps in the RGB color mode.

Sub Test()

Dim s As Shape, n As Long

n = 0

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.Mode = cdrRGBColorImage Then n = n + 1

End If

Next s

MsgBox "There are " & n & " RGB bitmaps."

End Sub

 Related Topics


Bitmap.OPILinked

Property OPILinked As Boolean

Bitmap

Description

The OPILinked property returns True if a bitmap in the TIF format has an OPI link to another image.

Read-Only

Example

The following example displays the number of bitmaps with OPI links.

Sub Test()

Dim s As Shape, n As Long

n = 0

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.OPILinked Then n = n + 1

End If

Next s

MsgBox "There are " & n & " OPI images."

End Sub

 Related Topics


Bitmap.ResolutionX

Property ResolutionX As Long

Bitmap

Description

The ResolutionX property returns the horizontal resolution of a bitmap in DPI

Read-Only

Example

The following example displays the horizontal and vertical resolution of a bitmap object.

Sub Size()

With ActiveShape.Bitmap

MsgBox .ResolutionX

MsgBox .ResolutionY

End With

End Sub

 Related Topics


Bitmap.ResolutionY

Property ResolutionY As Long

Bitmap

Description

The ResolutionY property returns the vertical resolution of a bitmap in DPI.

Read-Only

Example

The following example displays the horizontal and vertical resolution of a bitmap object.

Sub Size()

With ActiveShape.Bitmap

MsgBox .ResolutionX

MsgBox .ResolutionY

End With

End Sub

 Related Topics


Bitmap.SizeHeight

Property SizeHeight As Long

Bitmap

Description

The SizeHeight property returns the vertical size (height) of a bitmap in pixels.

Read-Only

Example

The following example displays the width and height of a bitmap object.

Sub Size()

With ActiveShape.Bitmap

MsgBox .SizeWidth

MsgBox .SizeHeight

End With

End Sub

 Related Topics


Bitmap.SizeWidth

Property SizeWidth As Long

Bitmap

Description

The SizeWidth property returns the horizontal size (width) of a bitmap in pixels.

Read-Only

Example

The following example displays the width and height of a bitmap object in CorelDRAW.

Sub Size()

With ActiveShape.Bitmap

MsgBox .SizeWidth

MsgBox .SizeHeight

End With

End Sub

 Related Topics


Bitmap.Transparent

Property Transparent As Boolean

Bitmap

Description

The Transparent property returns True if the bitmap is transparent.

Read-Only

Example

The following example displays the number of transparent bitmaps that are on the active page.

Sub Test()

Dim s As Shape, n As Long

n = 0

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.Transparent Then n = n + 1

End If

Next s

MsgBox "There are " & n & " transparent bitmaps"

End Sub

 Related Topics


Bitmap.Watermarked

Property Watermarked As Boolean

Bitmap

Description

The Watermarked property returns True if the bitmap has a watermark.

Read-Only

Example

The following example displays the number of bitmaps that have a watermark.

Sub Test()

Dim s As Shape, n As Long

n = 0

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.Watermarked Then n = n + 1

End If

Next s

MsgBox "There are " & n & " watermarked bitmaps"

End Sub

 Related Topics


Bitmap.ApplyBitmapEffect

Sub ApplyBitmapEffect(ByVal UndoString As String, ByVal Command As String)

Bitmap

Description

The ApplyBitmapEffect method applies the specified bitmap effect.

Parameters	Description

UndoString	Specifies the name in the Undo list [in]

Command	Specifies the effect to apply [in]

Example

The following example applies the Whirlpool effect to all bitmaps on the active page.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.Mode <> cdrRGBColorImage Then

s.Bitmap.ConvertTo cdrRGBColorImage

End If

s.Bitmap.ApplyBitmapEffect "Whirlpool", "WhirlpoolEffect.V11 WhirpoolSpacing=20,WhirlpoolSmear=9,WhirlpoolTwist=70,WhirlpoolStreak=60,WhirpoolWarp=1,WhirlpoolRandomSeed=0"

End If

Next s

End Sub

 Related Topics


Bitmap.ConvertTo

Sub ConvertTo(ByVal Mode As cdrImageType)

Bitmap

Description

The ConvertTo method changes the color mode of a bitmap.

Parameters	Description

Mode	Specifies the color mode to apply [in]

Example

The following example converts all bitmaps on the active page to the RGB color mode.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.Mode <> cdrRGBColorImage Then

s.Bitmap.ConvertTo cdrRGBColorImage

End If

End If

Next s

End Sub

 Related Topics


Bitmap.ConvertToBW

Sub ConvertToBW(ByVal RenderType As cdrRenderType, [ByVal Intensity As Long = 100], [ByVal Threshold As Long = 128], [ByVal Halftone As cdrHalftoneType = cdrHalftoneSquare (0)], [ByVal HalftoneAngle As Long = 45], [ByVal HalftoneSize As Long = 0])

Bitmap

Description

The ConvertToBW method converts the bitmap to the black and white color mode.

Parameters	Description

RenderType	Specifies the type of conversion [in]

Intensity	Specifies the intensity of the applied color [in]
Optional
Default value = 100

Threshold	Specifies the tolerance level for tonal variation for a line art conversion [in]
Optional
Default value = 128

Halftone	Specifies a halftone screen [in]
Optional
Default value = cdrHalftoneSquare (0)

HalftoneAngle	Specifies the halftone angle [in]
Optional
Default value = 45

HalftoneSize	Specifies the lines per unit for a halftone conversion [in]
Optional
Default value = 0

Example

The following example converts all bitmaps on the active page to the black and white color mode.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.Mode = cdrRGBColorImage Then

s.Bitmap.ConvertToBW cdrRenderLineArt, , 97

End If

End If

Next s

End Sub

 Related Topics


Bitmap.ConvertToPaletted

Sub ConvertToPaletted(ByVal PaletteType As cdrImagePaletteType, [ByVal DitherType As cdrDitherType = cdrDitherNone (0)], [ByVal DitherIntensity As Long = 100], [ByVal Smoothing As Long = 0], [ByVal NumColors As Long = 256], [ByVal ColorSensitive As Boolean = False], [ByVal TargetColor As Long = 16777215], [ByVal Importance As Long = 500], [ByVal Lightness As Long = 300], [ByVal ToleranceA As Long = 300], [ByVal ToleranceB As Long = 100], [ByRef Palette As Variant])

Bitmap

Description

The ConvertToPaletted method converts the bitmap to a specific palette using the specified parameters.

Parameters	Description

PaletteType	Specifies the palette to apply [in]

DitherType	Specifies the type of dithering to apply [in]
Optional
Default value = cdrDitherNone (0)

DitherIntensity	Specifies the intensity of the dithering [in]
Optional
Default value = 100

Smoothing	Specifies the type of smoothing to apply [in]
Optional
Default value = 0

NumColors	Specifies the maximum number of colors in the optimized image. The PaletteType must be optimized for this option to be applied [in]
Optional
Default value = 256

ColorSensitive	Specifies whether color sensitivity is applied [in]
Optional
Default value = False

TargetColor	Specifies the color to which the color sensitivity is applied [in]
Optional
Default value = 16777215

Importance	Specifies the emphasis of the sensitivity of the target color. The TargetColor must be specified for this option to be applied. [in]
Optional
Default value = 500

Lightness	Specifies the lightness of the range sensitivity [in]
Optional
Default value = 300

ToleranceA	Specifies the tolerance of the range sensitivity on the green-red axis[in]
Optional
Default value = 300

ToleranceB	Specifies the tolerance of the range sensitivity on the blue-yellow axis [in]
Optional
Default value = 100

Palette	Specifies a custom palette [in]
Optional

Example

The following example converts all bitmaps on the active page to the Optimized palette.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.Mode <> cdrPalettedImage Then

s.Bitmap.ConvertToPaletted cdrPaletteOptimized, cdrDitherNone, , 5

End If

End If

Next s

End Sub

 Related Topics


Bitmap.ConvertToPaletted2

Sub ConvertToPaletted2([ByVal Options As StructPaletteOptions = Nothing])

Bitmap

Description

The ConvertToPaletted2 method converts the bitmap to a specific palette using the specified parameters.

Parameters	Description

Options	Specifies a set of options to apply [in]
Optional
Default value = Nothing

Example

The following example converts all bitmaps on the active page to a paletted bitmap.

Sub Test()

Dim s As Shape

Dim Pal As StructPaletteOptions

Set Pal = CreateStructPaletteOptions

With Pal

.DitherType = cdrDitherNone

.NumColors = 256

.Smoothing = 5

.PaletteType = cdrPaletteOptimized

End With

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.Mode <> cdrPalettedImage Then

s.Bitmap.ConvertToPaletted2 Pal

End If

End If

Next s

End Sub

 Related Topics


Bitmap.Crop

Sub Crop()

Bitmap

Description

The Crop method crops the bitmap to its clipping path.

Example

The following example crops all bitmaps which can be cropped.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.Cropped Then s.Bitmap.Crop

End If

Next s

End Sub

 Related Topics


Bitmap.Inflate

Sub Inflate(ByVal Width As Long, ByVal Height As Long)

Bitmap

Description

The Inflate method increases the size of a bitmap by adding the specified number of pixels at each side of the bitmap.

Parameters	Description

Width	Specifies the number of pixels to add to each side [in]

Height	Specifies the number of pixels to add to the top and bottom[in]

Example

The following example increases the size of the active bitmap to at least 400 x 400 pixels.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

With s.Bitmap

If .SizeWidth < 400 And .SizeHeight < 400 Then

.Inflate (400 - .SizeWidth)/2, (400 - .SizeHeight)/2

End If

End With

End If

Next s

End Sub

 Related Topics


Bitmap.Resample

Sub Resample([ByVal Width As Long = 0], [ByVal Height As Long = 0], [ByVal AntiAlias As Boolean = True])

Bitmap

Description

The Resample method resizes a bitmap.

Parameters	Description

Width	Specifies the width [in]
Optional
Default value = 0

Height	Specifies the height [in]
Optional
Default value = 0

AntiAlias	Specifies whether to apply anit-aliasing [in]
Optional
Default value = True

Example

The following example resizes all bitmaps on the active page. All bitmaps will fit in a 150 x 150 pixel frame and maintain their original aspect ratio.

Sub Test()

Dim s As Shape

Dim Width As Double

Dim Height As Double

Dim AspectRatio As Double

Width = 150

Height = 150

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

'so if thewidth is greater than theheight

If s.Bitmap.SizeWidth > s.Bitmap.SizeHeight Then

'the aspect ratio is Height divided by Width

AspectRatio = s.Bitmap.SizeHeight / s.Bitmap.SizeWidth

Height = AspectRatio * Width

'height is greater than width, so

ElseIf s.Bitmap.SizeHeight > s.Bitmap.SizeWidth Then

'the aspect ratio is Width divided by Height

AspectRatio = s.Bitmap.SizeWidth / s.Bitmap.SizeHeight

Width = AspectRatio * Height

End If

s.Bitmap.Resample CLng(Width), CLng(Height)

End If

Next s

End Sub

 Related Topics


Bitmap.ResetCropEnvelope

Sub ResetCropEnvelope()

Bitmap

Description

The ResertCropEnvelope method removes a cropping path from a bitmap.

Example

The following example removes the cropping path from all bitmaps on the active page.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

If s.Bitmap.Cropped Then s.Bitmap.ResetCropEnvelope

End If

Next s

End Sub

 Related Topics


Bitmap.ResolveLink

Sub ResolveLink()

Bitmap

Description

The ResolveLink method embeds an externally linked bitmap.

Example

The following example embeds the active bitmap if it is not already embedded.

Sub Embed()

With ActiveShape.Bitmap

If .ExternallyLinked = True Then

.ResolveLink

End If

End With

End Sub

 Related Topics


Bitmap.SaveAs

Function SaveAs(ByVal FileName As String, ByVal Filter As cdrFilter, [ByVal Compression As cdrCompressionType = cdrCompressionNone (0)]) As ExportFilter

Bitmap

Description

The SaveAs method saves the bitmap to the specified file and returns the filter object.

Parameters	Description

FileName	Specifies the filename [in]

Filter	Specifies the filter to apply [in]

Compression	Specifies the compression to apply [in]
Optional
Default value = cdrCompressionNone (0)

Return value

Returns ExportFilter

Example

The following example saves each bitmap on the active page in the BMP format.

Sub Test()

Dim s As Shape

Dim ex As ExportFilter

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then

Set ex = s.Bitmap.SaveAs("c:\" & s.StaticID & ".bmp", cdrBMP, _

 cdrCompressionRLE_LW)

ex.Finish

End If

Next s

End Sub

 Related Topics


Bitmap.UpdateLink

Sub UpdateLink()

Bitmap

Description

The UpdateLink method updates an externally linked bitmap by re-importing the linked file.

Example

The following example updates the active bitmap if it is externally linked.

Sub Embed()

With ActiveShape.Bitmap

If .ExternallyLinked = True Then

.UpdateLink

End If

End With

End Sub

 Related Topics


CDrawDoc

Class CDrawDoc

Referenced By

 Related Topics


CDrawDocCMX

Class CDrawDocCMX

Referenced By

 Related Topics


Clipboard properties

Clipboard     Legend

    Application
    Empty
    Parent
    Valid


Clipboard methods

Clipboard     Legend

   Clear
   DataPresent


Clipboard

Class Clipboard

Properties     Methods     Referenced By

The Clipboard class represents the system clipboard.

 Related Topics


Clipboard.Application

Property Application As Object

Clipboard

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Clipboard.Empty

Property Empty As Boolean

Clipboard

Description

The Empty property looks for the presence of any data on the system clipboard.

Read-Only

Example

The following example checks to see if there is any data in the clipboard. If there is data present, it is pasted in the active layer. If there is no data in the system clipboard, a message displays in a message box.

Sub ClipboardEmpty()

If Not Clipboard.Empty Then

ActiveLayer.Paste

Else

MsgBox "There is no data in the clipboard."

End If

End Sub

 Related Topics


Clipboard.Parent

Property Parent As Object

Clipboard

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Clipboard.Valid

Property Valid As Boolean

Clipboard

Description

The Valid property returns a value associated with presence of data that can be pasted into CorelDRAW.

Read-Only

Example

The following example checks to see there is valid data in the clipboard. If there is valid data present, it is pasted into the active layer. If there is no valid data in the clipboard, a message displays in a message box.

Sub ClipboardValid()

If Clipboard.Valid Then

ActiveLayer.Paste

Else

MsgBox "There is no valid data currently in the clipboard."

End If

End Sub

 Related Topics


Clipboard.Clear

Sub Clear()

Clipboard

Description

The Clear method removes any data from the system clipboard.

Example

The following example pastes the current contents of the system clipboard in the active document and removes any data from the clipboard.

Sub ClipboardClear()

ActiveLayer.Paste

Clipboard.Clear

End Sub

 Related Topics


Clipboard.DataPresent

Function DataPresent(ByVal FormatName As String) As Boolean

Clipboard

Description

The DataPresent method verifies the presence of data of a specific format on the clipboard. The format name is specified as a string parameter in the call to this function. The format names can be determined by using the Windows Clipboard Viewer utility that is available from Windows Accessories. The clipboard may contain more than one data format at a time.

The following table lists names of common Windows formats.

Parameters	Description

FormatName	FormatName is a string parameter that is passed to the DataFormat function to determine presence of a particular data format in the clipboard. It must be contained in quotes when passed to the function. "Text" is an example of a string parameter that may be passed as a FormatName parameter. [in]

Return value

Returns Boolean

Example

The following example verifies the presence of text data in the clipboard. It text data is present, the clipboard is cleared of any data. If there is no text data in the clipboard, a message displays in a message box.

Sub PresentData()

If clipboard.DataPresent("Text") Then

clipboard.Clear

Else

MsgBox "There is no text data in the clipboard."

End If

End Sub

 Related Topics


CloneLink properties

CloneLink     Legend

    Application
      BitmapColorMaskLinked
    CloneParent
      FillLinked
      OutlineLinked
    Parent
      ShapeLinked
      TransformLinked


CloneLink methods

CloneLink     Legend

   RestoreAllLinks


CloneLink

Class CloneLink

Properties     Methods     Referenced By

The CloneLink class represents the properties of the actual link between clone and parent objects.

 Related Topics


CloneLink.Application

Property Application As Application

CloneLink

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


CloneLink.BitmapColorMaskLinked

Property BitmapColorMaskLinked As Boolean

CloneLink

Description

The BitmapColorMaskLinked property returns a value indicating if the color attributes of a clone object is linked to its parent object. If the BitmapColorMaskLinked property is True, the color attributes of the cloned object is linked to the parent object. If linked, the clone has the same bitmap mask effect as its parent object.

You can also break or restore a link by assigning a value to the property.

Example

The following example determines if the BitmapColorMaskLinked property of the cloned bitmap object is broken (i.e. False). A dialog box prompts the user to restore the bitmap color mask link. If "Yes" is selected, the link is restored and a message displays in a message box.

Sub BitmapLink()

Dim s As Shape

Dim ret As VbMsgBoxResult

Set s = ActiveSelection.Shapes(1)

If Not s.CloneLink.BitmapColorMaskLinked Then

ret = MsgBox("The Bitmap color mask link is broken. Do you want to restore it?", vbYesNo)

If ret = vbYes Then

s.CloneLink.BitmapColorMaskLinked = True

MsgBox "The link is now active."

End If

SEnd If

End Sub

 Related Topics


CloneLink.CloneParent

Property CloneParent As Shape

CloneLink

Description

The CloneParent object returns the parent (control) object for the cloned object. In order for this property to be effective, the cloned object must be the selected object.

Read-Only

Example

The following example removes the fill from the clone's parent object . If the fill link is not broken, this also will cause the cloned object to have no fill. This example assumes that the cloned object is currently selected

Sub Test()

ActiveShape.CloneLink.CloneParent.Fill.ApplyNoFill

End Sub

 Related Topics


CloneLink.FillLinked

Property FillLinked As Boolean

CloneLink

Description

The FillLinked property returns a value indicating if the fill attributes of a clone object are linked to its parent object. If the FillLinked property is True, the fill attributes of the cloned object are linked to the parent object. If linked, the clone has the same fill attributes as its parent object.

You can also break or restore a link by assigning a value to the property.

Example

The following example looks at the shapes in the current selection that are cloned objects, and restores several links (Fill, Outline, Shape and Color) between the cloned objects and their parent objects.

Sub FillLink()

Dim s As Shape

For Each s In ActiveSelection.Shapes(1).Clones

s.CloneLink.FillLinked = True

s.CloneLink.BitmapColorMaskLinked = True

s.CloneLink.OutlineLinked = True

s.CloneLink.ShapeLinked = True

s.CloneLink.TransformLinked = True

Next s

End Sub

 Related Topics


CloneLink.OutlineLinked

Property OutlineLinked As Boolean

CloneLink

Description

The OutlineLinked property returns a value indicating if the outline attributes of a clone object are linked to its parent object. If the OutlineLinked property is True, the outline attributes of the cloned object are linked to the parent object. If linked, the clone has the same outline attributes as its parent object.

You can also break or restore a link by assigning a value to the property.

Example

The following example looks at the shapes in the current selection that are cloned objects, and restores several links (Fill, Outline, Shape and Color) between the cloned objects and their parent objects.

Sub FillLink()

Dim s As Shape

For Each s In ActiveSelection.Shapes(1).Clones

s.CloneLink.FillLinked = True

s.CloneLink.BitmapColorMaskLinked = True

s.CloneLink.OutlineLinked = True

s.CloneLink.ShapeLinked = True

s.CloneLink.TransformLinked = True

Next s

End Sub

 Related Topics


CloneLink.Parent

Property Parent As Shape

CloneLink

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


CloneLink.ShapeLinked

Property ShapeLinked As Boolean

CloneLink

Description

The ShapeLinked property returns a value indicating if the shape attributes of a clone object are linked to its parent object. If the ShapeLinked property is True, the shape attributes of the cloned object are linked to the parent object. If linked, the clone has the same shape attributes as its parent object.

You can also break or restore a link by assigning a value to the property.

Example

The following example looks at the shapes in the current selection that are cloned objects, and restores several links (Fill, Outline, Shape and Color) between the cloned objects and their parent objects.

Sub FillLink()

Dim s As Shape

For Each s In ActiveSelection.Shapes(1).Clones

s.CloneLink.FillLinked = True

s.CloneLink.BitmapColorMaskLinked = True

s.CloneLink.OutlineLinked = True

s.CloneLink.ShapeLinked = True

s.CloneLink.TransformLinked = True

Next s

End Sub

 Related Topics


CloneLink.TransformLinked

Property TransformLinked As Boolean

CloneLink

Description

The TransformLinked property returns a value indicating if the size and shape attributes of a clone object are linked to its parent object. If the TransformLinked property is True, the size and shape attributes of the cloned object are linked to the parent object. If linked, the clone has the same size and shape attributes as its parent object.

You can also break or restore a link by assigning a value to the property.

Example

The following example looks at the shapes in the current selection that are cloned objects, and restores several links (Fill, Outline, Shape and Color) between the cloned objects and their parent objects.

Sub FillLink()

Dim s As Shape

For Each s In ActiveSelection.Shapes(1).Clones

s.CloneLink.FillLinked = True

s.CloneLink.BitmapColorMaskLinked = True

s.CloneLink.OutlineLinked = True

s.CloneLink.ShapeLinked = True

s.CloneLink.TransformLinked = True

Next s

End Sub

 Related Topics


CloneLink.RestoreAllLinks

Sub RestoreAllLinks()

CloneLink

Description

The RestoreAllLinks method restores all clone links and reapplies the properties of the master object to the clones.

Example

The following example creates a clone of a rectangle. Changes are applied to the clone, and then the changes are removed by reverting back to the master object.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateRectangle2(0, 5, 2.6, 1.8)

Set s2 = s1.Clone(4, -2)

s2.Fill.ApplyUniformFill CreateCMYKColor(22, 33, 45, 88)

s2.Outline.Width = 4

s2.Rectangle.SetRoundness 22

s2.SizeHeight = 4

s2.CloneLink.RestoreAllLinks

End Sub

 Related Topics


Color properties

Color     Legend

    Application
      BW
      CMYCyan
      CMYKBlack
      CMYKCyan
      CMYKMagenta
      CMYKYellow
      CMYMagenta
      CMYYellow
      Gray
      HLSHue
      HLSLightness
      HLSSaturation
      HSBBrightness
      HSBHue
      HSBSaturation
      LabComponentA
      LabComponentB
      LabLuminance
    Name
    PaletteID
      PaletteIndex
    Parent
      RGBBlue
      RGBGreen
      RGBRed
      Tint
    Type
      YIQChromaI
      YIQChromaQ
      YIQLuminanceY


Color methods

Color     Legend

   BlendWith
   BWAssign
   CMYAssign
   CMYKAssign
   ConvertToBW
   ConvertToCMY
   ConvertToCMYK
   ConvertToFixed
   ConvertToGray
   ConvertToHLS
   ConvertToHSB
   ConvertToLab
   ConvertToRGB
   ConvertToYIQ
   CopyAssign
   CorelScriptAssign
   CorelScriptGetComponent
   FixedAssign
   GrayAssign
   HLSAssign
   HSBAssign
   IsSame
   LabAssign
   RegistrationAssign
   RGBAssign
   SetName
   UserAssign
   UserAssignEx
   YIQAssign


Color

Class Color

Properties     Methods     Referenced By

The Color class represents a color.

 Related Topics


Color.Application

Property Application As Object

Color

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Color.BW

Property BW As Boolean

Color

Description

The BW property returns or sets the black and white state for the Black and White color model. It is accessible only if the color model is black or white.

Example

The following example sets the fill of all uniformly filled objects on the current page to white or the Black and White color model.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

If s.Fill.UniformColor.Type = cdrColorBlackAndWhite Then

s.Fill.UniformColor.BW = True

Else

s.Fill.UniformColor.BWAssign True

End If

End If

Next s

End Sub

 Related Topics


Color.CMYCyan

Property CMYCyan As Long

Color

Description

The CMYCyan property returns or sets the cyan color value for the CMY color model.

Example

The following example deletes the object if the CMY color model's cyan component value is greater than 50.

Sub Test()

Dim s As Shape

Set s = ActiveSelection.Shapes(1)

If s.Fill.UniformColor.CMYCyan > 50 Then

s.Delete

End If

End Sub

 Related Topics


Color.CMYKBlack

Property CMYKBlack As Long

Color

Description

The CMYKBlack property returns or sets the black color value for the CMYK color model.

Example

The following example deletes the object if the CMYK color model's black component value is greater than 50.

Sub Test()

Dim s As Shape

Set s = ActiveSelection.Shapes(1)

If s.Fill.UniformColor.CMYKBlack > 50 Then

s.Delete

End If

End Sub

 Related Topics


Color.CMYKCyan

Property CMYKCyan As Long

Color

Description

The CMYKCyan property returns or sets the cyan color value for the CMYK color model.

Example

The following example deletes the object if the CMYK color model's cyan component value is greater than 50.

Sub Test()

Dim s As Shape

Set s = ActiveSelection.Shapes(1)

If s.Fill.UniformColor.CMYKCyan > 50 Then

s.Delete

End If

End Sub

 Related Topics


Color.CMYKMagenta

Property CMYKMagenta As Long

Color

Description

The CMYKYellow property returns or sets the magenta color value for the CMYK color model.

Example

The following example deletes the object if the CMYK color model's magenta component value is greater than 50.

Sub Test()

Dim s As Shape

Set s = ActiveSelection.Shapes(1)

If s.Fill.UniformColor.CMYKMagenta > 50 Then

s.Delete

End If

End Sub

 Related Topics


Color.CMYKYellow

Property CMYKYellow As Long

Color

Description

The CMYKYellow property returns or sets the yellow color value for the CMYK color model.

Example

The following example deletes the object if the CMYK color model's yellow component value is greater than 50.

Sub Test()

Dim s As Shape

Set s = ActiveSelection.Shapes(1)

If s.Fill.UniformColor.CMYKYellow > 50 Then

s.Delete

End If

End Sub

 Related Topics


Color.CMYMagenta

Property CMYMagenta As Long

Color

Description

The CMYMagenta property returns or sets the magenta color value for the CMYK color model.

Example

The following example deletes the object if the CMY color model's magenta component value is greater than 50.

Sub Test()

Dim s As Shape

Set s = ActiveSelection.Shapes(1)

If s.Fill.UniformColor.CMYMagenta > 50 Then

s.Delete

End If

End Sub

 Related Topics


Color.CMYYellow

Property CMYYellow As Long

Color

Description

The CMYYellow property returns or sets the yellow color value for the CMYK color model.

Example

The following example deletes the object if the CMY color model's yellow component value is greater than 50.

Sub Test()

Dim s As Shape

Set s = ActiveSelection.Shapes(1)

If s.Fill.UniformColor.CMYYellow > 50 Then

s.Delete

End If

End Sub

 Related Topics


Color.Gray

Property Gray As Long

Color

Description

The Gray property returns or sets the Gray color value for the Grayscale color model.

The Grayscale color model is a color mode that displays images using 256 shades of gray. Each color is defined as a value between 0 and 255, where 0 is darkest (black) and 255 is lightest (white).

Example

The following example decreases the lightness of the grayscale fill of the object. If the uniform fill color is not grayscale, the code assigns grayscale white to the object fill, prior to changing the lightness.

Sub Test()

Dim s As Shape

Set s = ActiveSelection.Shapes(1)

If s.Fill.Type = cdrUniformFill Then

If s.Fill.UniformColor.Type <> cdrColorGray Then

s.Fill.UniformColor.GrayAssign 255

s.Fill.UniformColor.Gray = s.Fill.UniformColor.Gray / 2

End If

End If

End Sub

 Related Topics


Color.HLSHue

Property HLSHue As Long

Color

Description

The HLSHue property returns or sets the hue color value for the HLS color model. Hue is the property of a color that allows us to classify it by its name. For example, blue, green, and red are all hues. Values range from 0 to 360.

Example

The following example creates an ellipse on the active layer in the current document.

Sub LayerActive()

ActiveLayer.CreateEllipse 3, 3, 2, 1

With ActiveDocument.Selection.Shapes(1).Fill.UniformColor

.HLSAssign 200, 100, 100

MsgBox .HLSHue

End With

End Sub

 Related Topics


Color.HLSLightness

Property HLSLightness As Long

Color

Description

The HLSLightness property returns or sets the lightness color value for the HLS color model. Lightness determines the intensity of the color. Values range from 0 to 100.

Example

The following example creates an ellipse on the active layer in the current document.

Sub LayerActive()

ActiveLayer.CreateEllipse 3, 3, 2, 1

With ActiveDocument.Selection.Shapes(1).Fill.UniformColor

.HLSAssign 200, 100, 100

MsgBox .HLSLightness

End With

End Sub

 Related Topics


Color.HLSSaturation

Property HLSSaturation As Long

Color

Description

The HLSSaturation property returns or sets the saturation color value for the HLS color model. Saturation is the purity or vividness of a color, expressed as the absence of white. A color that has 100% saturation contains no white. A color with 0% saturation is a shade of gray.

Example

The following example creates an ellipse on the active layer in the current document.

Sub LayerActive()

ActiveLayer.CreateEllipse 3, 3, 2, 1

With ActiveDocument.Selection.Shapes(1).Fill.UniformColor

.HLSAssign 200, 100, 100

MsgBox .HLSSaturation

End With

End Sub

 Related Topics


Color.HSBBrightness

Property HSBBrightness As Long

Color

Description

The HSBBrightness property returns or sets the saturation value of the HSB color model. Brightness is the amount of light that is transmitted or reflected from a given pixel. In the HSB color model, brightness is a measure of how much white a color contains. In this case, a brightness value of 0 produces black and a brightness value of 255 produces white.

Example

The following example decreases the brightness of all the active shape objects on page by half.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

If s.Fill.UniformColor.Type <> cdrColorHSB Then

s.Fill.UniformColor.ConvertToHSB

s.Fill.UniformColor.HSBBrightness = s.Fill.UniformColor.HSBBrightness / 2

End If

End If

Next s

End Sub

 Related Topics


Color.HSBHue

Property HSBHue As Long

Color

Description

The HSBHue property returns or sets the hue color value for the HSB color model. Hue is the property of a color that allows us to classify it by its name. For example, blue, green, and red are all hues. Values range from 0 to 360.

Example

The following example decreases the hue of all the active shape objects on page by half.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

If s.Fill.UniformColor.Type <> cdrColorHSB Then

s.Fill.UniformColor.ConvertToHSB

s.Fill.UniformColor.HSBHue = s.Fill.UniformColor.HSBHue / 2

End If

End If

Next s

End Sub

 Related Topics


Color.HSBSaturation

Property HSBSaturation As Long

Color

Description

The HSBSaturation property returns or sets the saturation value of the HSB color model. Saturation is the purity or vividness of a color, expressed as the absence of white. A color that has 100% saturation contains no white. A color with 0% saturation is a shade of gray.

Example

The following example decreases the saturation of all the active shape objects on page by half.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

If s.Fill.UniformColor.Type <> cdrColorHSB Then

s.Fill.UniformColor.ConvertToHSB

s.Fill.UniformColor.HSBSaturation = s.Fill.UniformColor.HSBSaturation / 2

End If

End If

Next s

End Sub

 Related Topics


Color.LabComponentA

Property LabComponentA As Long

Color

Description

The LabComponentA property returns or sets the A component for the Lab color model. This property sets one of two chromatic components in the Lab color model. "A" refers to a range of colors between green and red. Values range from (-128) to 127.

Example

The following example fills all shape objects with the Lab gray color and displays the lab component A value in a message box.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

s.Fill.UniformColor.LabAssign 128, 0, 0

End If

Next s

MsgBox s.Fill.UniformColor.LabComponentA

End Sub

 Related Topics


Color.LabComponentB

Property LabComponentB As Long

Color

Description

The LabComponentB property returns or sets the B component for the Lab color model. This property sets one of two chromatic components in the LAB color model. "B" refers to a range of colors between blue and yellow. Values range from (-128) to 127.

Example

The following example fills all shape objects with the Lab gray color and displays the lab component B value in a message box.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

s.Fill.UniformColor.LabAssign 128, 0, 0

End If

Next s

MsgBox s.Fill.UniformColor.LabComponentB

End Sub

 Related Topics


Color.LabLuminance

Property LabLuminance As Long

Color

Description

The LabLuminance property returns or sets the luminance, or brightness, level for the Lab color model. Values range from 0 to 255.

Example

The following example fills all shape objects with the Lab gray color and displays the luminance value in a message box.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

s.Fill.UniformColor.LabAssign 128, 0, 0

End If

Next s

MsgBox s.Fill.UniformColor.LabLuminance

End Sub

 Related Topics


Color.Name

Property Name([ByVal Components As Boolean = False]) As String

Color

Description

The Name property returns a string value that identifies a color.

Read-Only

Parameters	Description

Components	Specifies whether to return the color's components when using the Name property [in]
Optional
Default value = False

Example

The following example displays the name of the color and its color component values.

Sub Test()

With ActiveSelection.Shapes(1).Fill.UniformColor

MsgBox "Fill Color Name: " & .Name & vbCr & _

"Components: " & .Name (True)

End With

End Sub

 Related Topics


Color.PaletteID

Property PaletteID As cdrPaletteID

Color

Description

The PaletteID property returns a value that shows the type of palette to which the color belongs.

For spot color palettes, this property returns the palette ID. If the color belongs to palettes such as Pantone Process, Netscape Navigator, Microsoft Internet Explorer, Uniform Colors, and similar, this is the only way to identify the palette the color belongs to. Pantone Process colors are actually CMYK colors; Navigator and Internet Explorer colors are RGB.

Read-Only

Example

The following example displays the palette ID number of the end color used in the fountain fill effect in the active shape of CorelDRAW.

Sub FillFountain()

With ActiveShape.Fill.Fountain

MsgBox .EndColor.PaletteID

End With

End Sub

 Related Topics


Color.PaletteIndex

Property PaletteIndex As Long

Color

Description

The PaletteIndex property returns or sets the index value of a color in a fixed or predefined palette.

Example

The following example fills the object with a 50% PANTONE Process Yellow CVC color and displays the palette index in a message box.

Sub Test()

With ActiveSelection.Shapes(1).Fill.UniformColor

.FixedAssign cdrPANTONECoated, 1, 50

MsgBox .PaletteIndex

End With

End Sub

 Related Topics


Color.Parent

Property Parent As Object

Color

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Color.RGBBlue

Property RGBBlue As Long

Color

Description

The RGBRed property returns or sets the red color value for the RGB color model.

Example

The following example deletes all the shape objects with a RGB red fill.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

With s.Fill.UniformColor

If .Type = cdrColorRGB Then

If .RGBRed = 255 And .RGBGreen = 0 And .RGBBlue = 0 Then s.Delete

End If

End With

End If

Next s

End Sub

 Related Topics


Color.RGBGreen

Property RGBGreen As Long

Color

Description

The RGBGreen property returns or sets the green color value for the RGB color model.

Example

The following example deletes all the shape objects with a RGB red fill.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

With s.Fill.UniformColor

If .Type = cdrColorRGB Then

If .RGBRed = 255 And .RGBGreen = 0 And .RGBBlue = 0 Then s.Delete

End If

End With

End If

Next s

End Sub

 Related Topics


Color.RGBRed

Property RGBRed As Long

Color

Description

The RGBRed property returns or sets the red color value for the RGB color model.

Example

The following example deletes all the shape objects with a RGB red fill.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

With s.Fill.UniformColor

If .Type = cdrColorRGB Then

If .RGBRed = 255 And .RGBGreen = 0 And .RGBBlue = 0 Then s.Delete

End If

End With

End If

Next s

End Sub

 Related Topics


Color.Tint

Property Tint As Long

Color

Description

The Tint property returns or sets the tint level for a spot color in a fixed or predefined palette.

Example

The following example fills the object with a 50% PANTONE Process Yellow CVC color and displays the tint value in a message box.

Sub Test()

With ActiveSelection.Shapes(1).Fill.UniformColor

.FixedAssign cdrPANTONECoated, 1, 50

MsgBox .Tint

End With

End Sub

 Related Topics


Color.Type

Property Type As cdrColorType

Color

Description

The Type property returns color model of the color.

Read-Only

Example

The following example converts all spot color fills of all objects on the current page to the CMYK color model.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

If s.Fill.UniformColor.Type = cdrColorSpot Or s.Fill.UniformColor.Type = cdrColorPantone Then

s.Fill.UniformColor.ConvertToCMYK

End If

End If

Next s

End Sub

 Related Topics


Color.YIQChromaI

Property YIQChromaI As Long

Color

Description

The YIQChromalI returns or sets the I color value in the YIQ color model. The I value sets one of two chromaticity (hue adjustment) values in the YIQ color model. Values range from 0 to 255.

Example

The following example sets the fill of the object to YIQ purple and displays the YIQChromalI value in a message box.

Sub Test()

With ActiveSelection.Shapes(1).Fill.UniformColor

.YIQAssign 100, 255, 255

MsgBox .YIQChromalI

End With

End Sub

 Related Topics


Color.YIQChromaQ

Property YIQChromaQ As Long

Color

Description

The YIQChromalQ returns or sets the Q color value in the YIQ color model. The Q value sets one of two chromaticity (hue adjustment) values in the YIQ color model. Values range from 0 to 255.

Example

The following example sets the fill of the object to YIQ purple and displays the YIQChromalQ value in a message box.

Sub Test()

With ActiveSelection.Shapes(1).Fill.UniformColor

.YIQAssign 100, 255, 255

MsgBox .YIQChromalQ

End With

End Sub

 Related Topics


Color.YIQLuminanceY

Property YIQLuminanceY As Long

Color

Description

The YIQLuminanceY returns or sets the Y color value in the YIQ color model. The Y value sets the luminance, or brightness, in the YIQ color model. Values range from 0 to 255.

Example

The following example sets the fill of the object to YIQ purple and displays the YIQLuminanceY value in a message box.

Sub Test()

With ActiveSelection.Shapes(1).Fill.UniformColor

.YIQAssign 100, 255, 255

MsgBox .YIQLuminanceY

End With

End Sub

 Related Topics


Color.BlendWith

Sub BlendWith(ByVal Color As Color, ByVal MixRatio As Long)

Color

Description

The BlendWith method mixes a color with the given color using the specified ratio.

Parameters	Description

Color	Specifies the color to be blended [in]

MixRatio	Specifies the ratio in which to blend the colors [in]

Example

The following example creates two colors, blends them together, and fills the active shape with the blended color.

Sub Test()

Dim c1 As Color

Dim c2 As Color

'Blend a Red and Green Color at 50%

Set c1 = CreateRGBColor(255, 0, 0)

Set c2 = CreateRGBColor(0, 255, 0)

c1.BlendWith c2, 50

ActiveShape.Fill.ApplyUniformFill c1

End Sub

 Related Topics


Color.BWAssign

Sub BWAssign(ByVal White As Boolean)

Color

Description

The BWAssign method sets the Black and White color model, and sets the specified color value. With this method, True means white, and False refers to black.

It is not necessary to check if the object is black or white and then set its Black and White property.

Parameters	Description

White	Specifies the color [in]

Example

The following example sets the fill of all uniformly filled objects on the current page to Black and White.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

If s.Fill.UniformColor.Type = cdrColorBlackAndWhite Then

s.Fill.UniformColor.BW = True

Else

s.Fill.UniformColor.BWAssign True

End If

End If

Next s

End Sub

 Related Topics


Color.CMYAssign

Sub CMYAssign(ByVal Cyan As Long, ByVal Magenta As Long, ByVal Yellow As Long)

Color

Description

The CMYAssign method assigns assigns all three color components in one step, and sets the color model to CMY if it is not already set.

Parameters	Description

Cyan	Sets the level of cyan in the CMY color model. Values range from 0 to 255. [in]

Magenta	Sets the level of magenta in the CMY color model. Values range from 0 to 255. [in]

Yellow	Sets the level of yellow in the CMY color model. Values range from 0 to 255. [in]

Example

The following example creates an ellipse on the active layer in the current document.

Sub LayerActive()

ActiveLayer.CreateEllipse 3, 3, 2, 1

ActiveDocument.Selection.Shapes(1).Fill.UniformColor.CMYAssign 255, 100, 100

End Sub

 Related Topics


Color.CMYKAssign

Sub CMYKAssign(ByVal Cyan As Long, ByVal Magenta As Long, ByVal Yellow As Long, ByVal Black As Long)

Color

Description

The CMYKAssign property assigns all four color components in one step, and sets the color model to CMYK if it is not already set.

Parameters	Description

Cyan	Sets the level of cyan in the CMYK color model. Values are percentages and range from 0 to 100. [in]

Magenta	Sets the level of magenta in the CMYK color model. Values are percentages and range from 0 to 100. [in]

Yellow	Sets the level of yellow in the CMYK color model. Values are percentages and range from 0 to 100. [in]

Black	Sets the level of black in the CMYK color model. Values are percentages and range from 0 to 100. [in]

Example

The following example creates a green ellipse on the active layer in the current document.

Sub LayerActive()

ActiveLayer.CreateEllipse 3, 3, 2, 1

ActiveDocument.Selection.Shapes(1).Fill.UniformColor.CMYKAssign 100, 0, 100, 0

End Sub

 Related Topics


Color.ConvertToBW

Sub ConvertToBW()

Color

Description

The ConvertToBW method converts the color to the Black and White color model.

Example

The following example converts all uniform fill colors in the selected shapes to the Black and White color model.

Sub Test()

Dim c As New color

Dim s As Shape

For Each s In ActiveSelection.Shapes

If s.Fill.Type = cdrUniformFill Then

s.Fill.UniformColor.ConvertToBW

End If

Next s

End Sub

 Related Topics


Color.ConvertToCMY

Sub ConvertToCMY()

Color

Description

The ConvertToCMY method converts the color to the CMYK color model.

Example

The following example converts all uniform fill colors in the selected shapes to the CMY color model.

Sub Test()

Dim c As New color

Dim s As Shape

For Each s In ActiveSelection.Shapes

If s.Fill.Type = cdrUniformFill Then

s.Fill.UniformColor.ConvertToCMY

End If

Next s

End Sub

 Related Topics


Color.ConvertToCMYK

Sub ConvertToCMYK()

Color

Description

The ConvertToCMYK method converts the color to the CMYK color model.

Example

The following example converts all uniform fill colors in the selected shapes to the CMYK color model.

Sub Test()

Dim s As Shape

For Each s In ActiveSelection.Shapes

If s.Fill.Type = cdrUniformFill Then

s.Fill.UniformColor.ConvertToCMYK

End If

Next s

End Sub

 Related Topics


Color.ConvertToFixed

Sub ConvertToFixed(ByVal PaletteID As cdrPaletteID)

Color

Description

The ConvertToFixed method converts the color to a specified fixed color palette.

Parameters	Description

PaletteID	Specifies the color palette [in]

Example

The following example converts all uniform fill colors in the selected shapes to the Netscape Web-safe palette.

Sub Test()

Dim c As New color

Dim s As Shape

For Each s In ActiveSelection.Shapes

If s.Fill.Type = cdrUniformFill Then

s.Fill.UniformColor.ConvertToFixed cdrNetscapeNavigator

End If

Next s

End Sub

 Related Topics


Color.ConvertToGray

Sub ConvertToGray()

Color

Description

The ConvertToGray method converts the color to the Grayscale color model.

The Grayscale color model is a color mode that displays images using 256 shades of gray. Each color is defined as a value between 0 and 255, where 0 is darkest (black) and 255 is lightest (white).

Example

The following example converts all uniform fill colors in the selected shapes to the Grayscale color model.

Sub Test()

Dim c As New color

Dim s As Shape

For Each s In ActiveSelection.Shapes

If s.Fill.Type = cdrUniformFill Then

s.Fill.UniformColor.ConvertToGray

End If

Next s

End Sub

 Related Topics


Color.ConvertToHLS

Sub ConvertToHLS()

Color

Description

The ConvertToHLS method converts the color to the HLS color model.

Example

The following example converts all uniform fill colors in the selected shapes to the HLS color model.

Sub Test()

Dim c As New color

Dim s As Shape

For Each s In ActiveSelection.Shapes

If s.Fill.Type = cdrUniformFill Then

s.Fill.UniformColor.ConvertToHLS

End If

Next s

End Sub

 Related Topics


Color.ConvertToHSB

Sub ConvertToHSB()

Color

Description

The ConvertToHSB method converts the color to the HSB color model.

Example

The following example decreases the saturation of all the active shape objects on page by half.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

If s.Fill.UniformColor.Type <> cdrColorHSB Then

s.Fill.UniformColor.ConvertToHSB

s.Fill.UniformColor.HSBSaturation = s.Fill.UniformColor.HSBSaturation / 2

End If

End If

Next s

End Sub

 Related Topics


Color.ConvertToLab

Sub ConvertToLab()

Color

Description

The ConvertToLab method converts the color to the Lab color model.

Example

The following example converts all uniform fill colors in the selected shapes to the Lab color model.

Sub Test()

Dim c As New color

Dim s As Shape

For Each s In ActiveSelection.Shapes

If s.Fill.Type = cdrUniformFill Then

s.Fill.UniformColor.ConvertToLab

End If

Next s

End Sub

 Related Topics


Color.ConvertToRGB

Sub ConvertToRGB()

Color

Description

The ConvertToRGB method converts the color to the RGB color model.

Example

The following example uses a separate Color object to take an object's fill color and convert it to RGB, then checks if the color is Red (i.e. its Red component value is greater than 150 and both Blue and Green values are less than 100). If this is the case, the object is filled with black. Otherwise, the object's fill remains unchanged.

Sub Test()

Dim c As New Color

Dim s As Shape

For Each s In ActiveSelection.Shapes

If s.Fill.Type = cdrUniformFill Then

c.CopyAssign s.Fill.UniformColor

c.ConvertToRGB

If c.RGBRed > 150 And c.RGBGreen < 100 And c.RGBBlue < 100 Then

s.Fill.UniformColor.RGBAssign 0, 0, 0

End If

End If

Next s

End Sub

 Related Topics


Color.ConvertToYIQ

Sub ConvertToYIQ()

Color

Description

The ConvertToYIQ method converts the color to the YIQ color model.

Example

The following example converts all uniform fill colors in the selected shapes to the YIQ color model.

Sub Test()

Dim c As New color

Dim s As Shape

For Each s In ActiveSelection.Shapes

If s.Fill.Type = cdrUniformFill Then

s.Fill.UniformColor.ConvertToYIQ

End If

Next s

End Sub

 Related Topics


Color.CopyAssign

Sub CopyAssign(ByVal Color As Color)

Color

Description

The CopyAssign method copies the color information from a color object and applies them to another color object.

Parameters	Description

Color	Specifies the color whose color model properties are copied [in]

Example

The following example uses a separate Color object to take an object's fill color and convert it to RGB, then checks if the color is Red (that is, its Red component value is greater than 150, and both Blue and Green values are less than 100). If this is the case, the object is filled with black. Otherwise, the object's fill remains unchanged.

Sub Test()

Dim c As New Color

Dim s As Shape

For Each s In ActiveSelection.Shapes

If s.Fill.Type = cdrUniformFill Then

c.CopyAssign s.Fill.UniformColor

c.ConvertToRGB

If c.RGBRed > 150 And c.RGBGreen < 100 And c.RGBBlue < 100 Then

s.Fill.UniformColor.RGBAssign 0, 0, 0

End If

End If

Next s

End Sub

 Related Topics


Color.CorelScriptAssign

Sub CorelScriptAssign(ByVal ColorModel As Long, ByVal V1 As Long, [ByVal V2 As Long = 0], [ByVal V3 As Long = 0], [ByVal V4 As Long = 0], [ByVal V5 As Long = 0], [ByVal V6 As Long = 0], [ByVal V7 As Long = 0])

Color

Description

The CorelScriptAssign method sets the color model and color components based on Corel SCRIPT color specification values in CorelDRAW.

Parameters	Description

ColorModel	Specifies the color model used to create the new color. This parameter specifies the numeric variable that is assigned to the color model. [in]

V1	Specifies the numeric variable that is assigned to the first color component of the selected color model. For example, cyan is the first color component of the CMYK color model. The value is a percentage and can range from 1 to 100. A color that is selected at 100 is applied with full saturation. [in]

V2	Specifies the numeric variable that is assigned to the second color component of the selected color model [in]
Optional
Default value = 0

V3	Specifies the numeric variable that is assigned to the third color component of the selected color model [in]
Optional
Default value = 0

V4	Specifies the numeric variable that is assigned to the fourth color component of the selected color model [in]
Optional
Default value = 0

V5	Specifies the numeric variable that is assigned to the fifth color component of the selected color model [in]
Optional
Default value = 0

V6	Specifies the numeric variable that is assigned to the sixth color component of the selected color model [in]
Optional
Default value = 0

V7	Specifies the numeric variable that is assigned to the seventh color component of the selected color model [in]
Optional
Default value = 0

Example

The following example sets the background color of the current page to RGB red.

Sub Test()

ActiveDocument.ActivePage.Color.CorelScriptAssign 5005, 255, 0, 0

End Sub

 Related Topics


Color.CorelScriptGetComponent

Sub CorelScriptGetComponent(ByRef ColorModel As Long, ByRef V1 As Long, [ByRef V2 As Long = 0], [ByRef V3 As Long = 0], [ByRef V4 As Long = 0], [ByRef V5 As Long = 0], [ByRef V6 As Long = 0], [ByRef V7 As Long = 0])

Color

Description

The CorelScriptGetComponent method retrieves the color model and color components based on Corel SCRIPT color specification values in CorelDRAW.

Parameters	Description

ColorModel	Returns the color model used to create the new color. This parameter specifies the numeric variable that is assigned to the color model. [out]

V1	Returns the numeric variable that is assigned to the first color component of the selected color model. For example, cyan is the first color component of the CMYK color model. The value is a percentage and can range from 1 to 100. A color that is selected at 100 is applied with full saturation. [out]

V2	Returns the numeric variable that is assigned to the second color component of the selected color model [out]
Optional
Default value = 0

V3	Returns the numeric variable that is assigned to the third color component of the selected color model [out]
Optional
Default value = 0

V4	Returns the numeric variable that is assigned to the fourth color component of the selected color model [out]
Optional
Default value = 0

V5	Returns the numeric variable that is assigned to the fifth color component of the selected color model [out]
Optional
Default value = 0

V6	Returns the numeric variable that is assigned to the sixth color component of the selected color model [out]
Optional
Default value = 0

V7	Returns the numeric variable that is assigned to the seventh color component of the selected color model [out]
Optional
Default value = 0

 Related Topics


Color.FixedAssign

Sub FixedAssign(ByVal PaletteID As cdrPaletteID, ByVal PaletteIndex As Long, [ByVal Tint As Long = 100])

Color

Description

The FixedAssign method provides access to colors from fixed palettes, such as spot colors (PANTONE ,TOYO, DIC), as well as predefined palettes such as Netscape, Internet Explorer, and others.

The Tint property is only available for spot colors.

Parameters	Description

PaletteID	Sets the Palette ID that uniquely identifies which color palette to use in CorelDRAW. [in]

PaletteIndex	Sets the color to use by referencing the index number of a color within a palette. [in]

Tint	Sets the tint of the palette color. Tints are lighter shades of a spot color that are created by changing the percentage tint value. [in]
Optional
Default value = 100

Example

The following example fills the object with a 50% PANTONE Process Yellow CVC color.

Sub Test()

ActiveSelection.Shapes(1).Fill.UniformColor.FixedAssign cdrPANTONECoated, 1, 50

End Sub

 Related Topics


Color.GrayAssign

Sub GrayAssign(ByVal GrayValue As Long)

Color

Description

The GrayAssign method assigns the grayscale color component, and sets the color model to Grayscale if the color is not Grayscale.

The Grayscale color model is a color mode that displays images using 256 shades of gray. Each color is defined as a value between 0 and 255, where 0 is darkest (black) and 255 is lightest (white).

Parameters	Description

GrayValue	[in]

Example

The following example decreases the lightness of the grayscale fill of the object. If the uniform fill color is not grayscale, the code assigns grayscale white to the object fill, prior to changing the lightness.

Sub Test()

Dim s As Shape

Set s = ActiveSelection.Shapes(1)

If s.Fill.Type = cdrUniformFill Then

If s.Fill.UniformColor.Type <> cdrColorGray Then

s.Fill.UniformColor.GrayAssign 255

s.Fill.UniformColor.Gray = s.Fill.UniformColor.Gray / 2

End If

End If

End Sub

 Related Topics


Color.HLSAssign

Sub HLSAssign(ByVal Hue As Long, ByVal Lightness As Long, ByVal Saturation As Long)

Color

Description

The HLSAssign method assigns all three color components in one step, and sets the color model to HLS if it is not already set to HLS.

Parameters	Description

Hue	Sets the Hue for the HLS color model. Hue is the property of a color that allows us to classify it by its name. For example, blue, green, and red are all hues. Values range from 0 to 360. [in]

Lightness	Sets the Lightness for the HLS color model. Lightness determines the intensity (lightness or darkness) of the color. Values range from 0 to 100. [in]

Saturation	Sets the Saturation for the HLS color model. Saturation is the purity or vividness (from dull to intense) of a color, expressed as the absence of white. A color that has 100% saturation contains no white. A color with 0% saturation is a shade of gray. [in]

Example

The following example creates an ellipse on the active layer in the current document.

Sub LayerActive()

ActiveLayer.CreateEllipse 3, 3, 2, 1

ActiveDocument.Selection.Shapes(1).Fill.UniformColor.HLSAssign 200, 100, 100

End Sub

 Related Topics


Color.HSBAssign

Sub HSBAssign(ByVal Hue As Long, ByVal Saturation As Long, ByVal Brightness As Long)

Color

Description

The HSBAssign method assigns all three color components in one step, and sets the color model to HSB if it is not already set to HSB.

Parameters	Description

Hue	Sets the Hue for the HSB color model. Hue is the property of a color that allows us to classify it by its name. For example, blue, green, and red are all hues. Values range from 0 to 360. [in]

Saturation	Sets the Saturation for the HSB color model. Saturation determines color depth (from dull to intense). It is the purity or vividness of a color, expressed as the absence of white. A color that has 100% saturation contains no white. A color with 0% saturation is a shade of gray. [in]

Brightness	Sets the Brightness for the HSB color model. Brightness determines perceived intensity (lighter or darker color). It is the amount of light that is transmitted or reflected from a given pixel. In the HSB color model, brightness is a measure of how much white a color contains. In this case, a brightness value of 0 produces black and a brightness value of 255 produces white. [in]

Example

The following example creates an ellipse on the active layer in the current document.

Sub LayerActive()

ActiveLayer.CreateEllipse 3, 3, 2, 1

ActiveDocument.Selection.Shapes(1).Fill.UniformColor.HSBAssign 200, 100, 100

End Sub

 Related Topics


Color.IsSame

Function IsSame(ByVal Color As Color) As Boolean

Color

Description

The IsSame method returns whether or not two colors are of the same color model and have the same equal color value.

Parameters	Description

Color	Specifies the color to compare [in]

Return value

Returns Boolean

Example

The following example creates two shapes, fills one with a CMYK color, and fills the other with an RGB color. The CMYK color is converted to RGB and the two colors are tested. If the two colors are the same, the first color is changed to white.

Sub Test()

Dim s1 As Shape, s2 As Shape

'Two shapes with a red fill from different color palettes

Set s1 = ActiveDocument.ActiveLayer.CreateEllipse2(3, 3, 2)

s1.Fill.ApplyUniformFill CreateCMYKColor(0, 100, 100, 0) 'Red

Set s2 = ActiveDocument.ActiveLayer.CreateEllipse2(6, 6, 2)

s2.Fill.ApplyUniformFill CreateRGBColor(255, 0, 0) 'Red

'Convert fill of s1 to the same color palette as the fill of s2

s1.Fill.UniformColor.ConvertToRGB

If Not s1.Fill.UniformColor.IsSame(s2.Fill.UniformColor) Then

s1.Fill.UniformColor.RGBAssign 255, 255, 255

End If

End Sub

 Related Topics


Color.LabAssign

Sub LabAssign(ByVal L As Long, ByVal A As Long, ByVal B As Long)

Color

Description

The LabAssign method assigns all three color components in one step, and sets the color model to Lab if it is not already set to Lab.

Parameters	Description

L	Sets the Luminance, or brightness, value in the Lab color model. Values range from 0 to 255. [in]

A	Sets one of two chromatic components in the Lab color model. "A" refers to a range of colors between green and red. Values range from -128 to 127. [in]

B	Sets one of two chromatic components in the Lab color model. "B" refers to a range of colors between blue and yellow. Values range from -128 to 127. [in]

Example

The following example fills all shape objects with the Lab gray color.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

s.Fill.UniformColor.LabAssign 128, 0, 0

End If

Next s

End Sub

 Related Topics


Color.RegistrationAssign

Sub RegistrationAssign()

Color

Description

The RegistrationAssign method assigns the color as the registration color. The registration color is output to all separation plates for color trapping.

Example

The following example builds crop marks around selected objects and sets their outline color to the registration color.

Sub Test()

Const Offset As Double = 1 ' Crop mark offset

Const Length As Double = 5 ' Crop mark length

Dim s As Shape

Dim r As New ShapeRange

Dim lyr As Layer

Dim x1 As Double, y1 As Double, x2 As Double, y2 As Double

Set s = ActiveSelection

Set lyr = ActiveDocument.ActiveLayer

ActiveDocument.Unit = cdrMillimeter

ActiveDocument.ReferencePoint = cdrTopLeft

x1 = s.PositionX

y1 = s.PositionY

ActiveDocument.ReferencePoint = cdrBottomRight

x2 = s.PositionX

y2 = s.PositionY

r.Add lyr.CreateLineSegment(x1 - Length - Offset, y1, x1 - Offset, y1)

r.Add lyr.CreateLineSegment(x1, y1 + Length + Offset, x1, y1 + Offset)

r.Add lyr.CreateLineSegment(x2 + Offset, y1, x2 + Length + Offset, y1)

r.Add lyr.CreateLineSegment(x2, y1 + Length + Offset, x2, y1 + Offset)

r.Add lyr.CreateLineSegment(x1 - Length - Offset, y2, x1 - Offset, y2)

r.Add lyr.CreateLineSegment(x1, y2 - Length - Offset, x1, y2 - Offset)

r.Add lyr.CreateLineSegment(x2 + Offset, y2, x2 + Length + Offset, y2)

r.Add lyr.CreateLineSegment(x2, y2 - Length - Offset, x2, y2 - Offset)

For Each s In r

s.Outline.Width = 0.1

s.Outline.Color.RegistrationAssign

Next s

End Sub

 Related Topics


Color.RGBAssign

Sub RGBAssign(ByVal Red As Long, ByVal Green As Long, ByVal Blue As Long)

Color

Description

The RGBAssign method assigns the three color components in one step, and sets the color model to the RGB color model if it is not already set.

Parameters	Description

Red	Sets the level of red in the RGB color model. Values range from 0 to 255. [in]

Green	Sets the level of green in the RGB color model. Values range from 0 to 255. [in]

Blue	Sets the level of blue in the RGB color model. Values range from 0 to 255. [in]

Example

The following example changes the background color of the current page in the open document to red.

Sub PageActive()

ActivePage.Color.RGBAssign 255, 0, 0

End Sub

 Related Topics


Color.SetName

Sub SetName(ByVal Name As String)

Color

Description

The SetName method assigns a name to an unnamed color.

This method is reserved for future development.

Parameters	Description

Name	Specifies the name [in]

 Related Topics


Color.UserAssign

Sub UserAssign()

Color

Description

The UserAssign method displays the Color dialog box, allowing the user to assign a color. The chosen color is applied to the Color object.

Example

The following example creates a new color object, then shows the color dialog and prompts the user to select a color. The color is then applied to all the object fills in the selection.

Sub Test()

Dim c As New color

Dim s As Shape

c.UserAssign

For Each s In ActiveSelection.Shapes

s.Fill.ApplyUniformFill c

Next s

End Sub

 Related Topics


Color.UserAssignEx

Function UserAssignEx() As Boolean

Color

Description

The UserAssignEx method displays the Select Color dialog box, allowing the user to select a color. The chosen color is applied to the Color object. UserAssignEx returns True if the color dialog was closed by clicking OK. It returns False if the dialog was canceled by pressing the Cancel or the Esc key.

Return value

Returns Boolean

Example

The following example displays the Select Color dialog box. If the user does not select a color, the color is set to blue.

Sub Test()

Dim cColor As New Color

If cColor.UserAssignEx = False Then 'User closed the dialog without selecting a color

Set cColor = CreateRGBColor(0, 0, 255)

End If

End Sub

 Related Topics


Color.YIQAssign

Sub YIQAssign(ByVal Y As Long, ByVal I As Long, ByVal Q As Long)

Color

Description

The YIQAssign method assigns all three color components in one step, and sets the color model to YIQ if it is not already set to YIQ.

Parameters	Description

Y	Sets the luminance, or brightness, value in the YIQ color model. Values range from 0 to 255. [in]

I	Sets one of two chromaticity (hue adjustment) values in the YIQ color model. Values range from 0 to 255. [in]

Q	Sets one of two chromaticity values in the YIQ color model. Values range from 0 to 255. [in]

Example

The following example sets the fill of the object to YIQ purple.

Sub Test()

ActiveSelection.Shapes(1).Fill.UniformColor.YIQAssign 100, 255, 255

End Sub

 Related Topics


Colors properties

Colors     Legend

    Application
    Count
  Item
    Parent


Colors

Class Colors

Properties     Referenced By

The Colors class represents a collection of colors in a color palette.

 Related Topics


Colors.Application

Property Application As Object

Colors

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Colors.Count

Property Count As Long

Colors

Description

The Count property returns the number of colors in the palette.

See also the ColorCount property of the Palette object.

Read-Only

Example

The following example displays the number of colors in the active palette.

Sub ColorsCount()

MsgBox "Active palette '" & ActivePalette.Name & "' contains " & _

ActivePalette.Colors.Count & " colors"

End Sub

 Related Topics


Colors.Item

Property Item(ByVal Index As Long) As Color

Colors

Description

The Item property returns the specified color from the color palette. For example, Colors(2) refers to the second color in the Colors collection of CorelDRAW.

The Item property is the default property and its reference may be omitted when referring to items in the collection. For example, Colors.Item(2) is the same as Colors(2) - they both reference the second color in the palette.

Read-Only

Parameters	Description

Index	Specifies a color by its index number [in]

Example

The following example creates an ellipse and fills it with 15th color of the current color palette.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(2, 2, 1)

s.Fill.ApplyUniformFill ActivePalette.Colors(15)

End Sub

 Related Topics


Colors.Parent

Property Parent As Palette

Colors

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


CommandBar properties

CommandBar     Legend

    BuiltIn
    Controls
      Enabled
    Height
    Index
      Left
    Modes
    Name
      NameLocal
      Position
      Protection
      Top
    Type
      Visible
    Width


CommandBar methods

CommandBar     Legend

   Delete
   Reset
   SetWidth
   ShowPopup


CommandBar

Class CommandBar

Properties     Methods     Referenced By

This class is reserved for future development.

 Related Topics


CommandBar.BuiltIn

Property BuiltIn As Boolean

CommandBar

Description

This property is reserved for future development.

Read-Only

 Related Topics


CommandBar.Controls

Property Controls As CommandBarControls

CommandBar

Description

This property is reserved for future development.

Read-Only

 Related Topics


CommandBar.Enabled

Property Enabled As Boolean

CommandBar

Description

This property is reserved for future development.

 Related Topics


CommandBar.Height

Property Height As Long

CommandBar

Description

This property is reserved for future development.

Read-Only

 Related Topics


CommandBar.Index

Property Index As Long

CommandBar

Description

This property is reserved for future development.

Read-Only

 Related Topics


CommandBar.Left

Property Left As Long

CommandBar

Description

This property is reserved for future development.

 Related Topics


CommandBar.Modes

Property Modes As CommandBarModes

CommandBar

Description

This property is reserved for future development.

Read-Only

 Related Topics


CommandBar.Name

Property Name As String

CommandBar

Description

This property is reserved for future development.

 Related Topics


CommandBar.NameLocal

Property NameLocal As String

CommandBar

Description

This property is reserved for future development.

 Related Topics


CommandBar.Position

Property Position As cuiBarPosition

CommandBar

Description

This property is reserved for future development.

 Related Topics


CommandBar.Protection

Property Protection As cuiBarProtection

CommandBar

Description

This property is reserved for future development.

 Related Topics


CommandBar.Top

Property Top As Long

CommandBar

Description

This property is reserved for future development.

 Related Topics


CommandBar.Type

Property Type As cuiBarType

CommandBar

Description

This property is reserved for future development.

Read-Only

 Related Topics


CommandBar.Visible

Property Visible As Boolean

CommandBar

Description

This property is reserved for future development.

 Related Topics


CommandBar.Width

Property Width As Long

CommandBar

Description

This property is reserved for future development.

Read-Only

 Related Topics


CommandBar.Delete

Sub Delete()

CommandBar

Description

This function is reserved for future development.

 Related Topics


CommandBar.Reset

Sub Reset()

CommandBar

Description

This function is reserved for future development.

 Related Topics


CommandBar.SetWidth

Sub SetWidth(ByVal Width As Long)

CommandBar

Description

This function is reserved for future development.

Parameters	Description

Width	[in]

 Related Topics


CommandBar.ShowPopup

Sub ShowPopup(ByVal X As Variant, ByVal Y As Variant)

CommandBar

Description

This function is reserved for future development.

Parameters	Description

X	[in]

Y	[in]

 Related Topics


CommandBarControl properties

CommandBarControl     Legend

    Caption
      DescriptionText
      Height
    ID
      Parameter
      Tag
      ToolTipText
      Visible
      Width


CommandBarControl

Class CommandBarControl

Properties     Referenced By

This class is reserved for future development.

 Related Topics


CommandBarControl.Caption

Property Caption As String

CommandBarControl

Description

This property is reserved for future development.

 Related Topics


CommandBarControl.DescriptionText

Property DescriptionText As String

CommandBarControl

Description

This property is reserved for future development.

 Related Topics


CommandBarControl.Height

Property Height As Long

CommandBarControl

Description

This property is reserved for future development.

 Related Topics


CommandBarControl.ID

Property ID As Long

CommandBarControl

Description

This property is reserved for future development.

Read-Only

 Related Topics


CommandBarControl.Parameter

Property Parameter As Variant

CommandBarControl

Description

This property is reserved for future development.

 Related Topics


CommandBarControl.Tag

Property Tag As String

CommandBarControl

Description

This property is reserved for future development.

 Related Topics


CommandBarControl.ToolTipText

Property ToolTipText As String

CommandBarControl

Description

This property is reserved for future development.

 Related Topics


CommandBarControl.Visible

Property Visible As Boolean

CommandBarControl

Description

This property is reserved for future development.

 Related Topics


CommandBarControl.Width

Property Width As Long

CommandBarControl

Description

This property is reserved for future development.

 Related Topics


CommandBarControls properties

CommandBarControls     Legend

    Count
  Item


CommandBarControls

Class CommandBarControls

Properties     Referenced By

This class is reserved for future development.

 Related Topics


CommandBarControls.Count

Property Count As Long

CommandBarControls

Description

This property is reserved for future development.

Read-Only

 Related Topics


CommandBarControls.Item

Property Item(ByVal Index As Long) As CommandBarControl

CommandBarControls

Description

This property is reserved for future development.

Read-Only

Parameters	Description

Index	[in]

 Related Topics


CommandBarMode properties

CommandBarMode     Legend

    Controls
    Name
    NameLocal


CommandBarMode

Class CommandBarMode

Properties     Referenced By

This class is reserved for future development.

 Related Topics


CommandBarMode.Controls

Property Controls As CommandBarControls

CommandBarMode

Description

This property is reserved for future development.

Read-Only

 Related Topics


CommandBarMode.Name

Property Name As String

CommandBarMode

Description

This property is reserved for future development.

Read-Only

 Related Topics


CommandBarMode.NameLocal

Property NameLocal As String

CommandBarMode

Description

This property is reserved for future development.

Read-Only

 Related Topics


CommandBarModes properties

CommandBarModes     Legend

    Count
    Item


CommandBarModes

Class CommandBarModes

Properties     Referenced By

This class is reserved for future development.

 Related Topics


CommandBarModes.Count

Property Count As Long

CommandBarModes

Description

This property is reserved for future development.

Read-Only

 Related Topics


CommandBarModes.Item

Property Item(ByVal IndexOrName As Variant) As CommandBarMode

CommandBarModes

Description

This property is reserved for future development.

Read-Only

Parameters	Description

IndexOrName	[in]

 Related Topics


CommandBars properties

CommandBars     Legend

    Count
  Item


CommandBars methods

CommandBars     Legend

   Add


CommandBars

Class CommandBars

Properties     Methods     Referenced By

This class is reserved for future development.

 Related Topics


CommandBars.Count

Property Count As Long

CommandBars

Description

This property is reserved for future development.

Read-Only

 Related Topics


CommandBars.Item

Property Item(ByVal IndexOrName As Variant) As CommandBar

CommandBars

Description

This property is reserved for future development.

Read-Only

Parameters	Description

IndexOrName	[in]

 Related Topics


CommandBars.Add

Function Add([ByVal Name As String = ""], [ByVal Position As cuiBarPosition = cuiBarFloating (4)], [ByVal Temporary As Boolean = False]) As CommandBar

CommandBars

Description

This function is reserved for future development.

Parameters	Description

Name	[in]
Optional
Default value = ""

Position	[in]
Optional
Default value = cuiBarFloating (4)

Temporary	[in]
Optional
Default value = False

Return value

Returns CommandBar

 Related Topics


Connector properties

Connector     Legend

      EndPoint
      StartPoint


Connector

Class Connector

Properties     Referenced By

The Connector class represents a connector object, a dynamic join between two objects. The start and end points of a connector object are both SnapPoints.

 Related Topics


Connector.EndPoint

Property EndPoint As SnapPoint

Connector

Description

The EndPoint property returns or sets the ending point of the connector object. This ending point is a snap point. For example, EndPoint(5) will begin the connector line at the fifth snap point of the object.

Example

The following example sets the reference point of the document to the lower left corner and creates a new snap point with coordinates (1, 6), one inch above and 6 inches to the right of the reference point. A rectangle and ellipse are created, and a connector line is drawn between them, starting at the ninth snap point of the rectangle to the first snap point of the ellipse.

Sub PointStart()

Dim sp as New SnapPoint

Dim s1 As Shape, s2 As Shape, c As Shape

ActiveDocument.ReferencePoint = cdrBottomLeft

sp.PositionX = 1

sp.PositionY = 6

Set s1 = ActiveLayer.CreateRectangle(0, 0, 3, 3)

Set s2 = ActiveLayer.CreateEllipse(4, 4, 6, 1)

Set c = ActiveLayer.CreateConnector(s1.SnapPoints(9), s2.SnapPoints(1))

c.Connector.StartPoint = s1.SnapPoints(9)

c.Connector.EndPoint = s2.SnapPoints(1)

End Sub

 Related Topics


Connector.StartPoint

Property StartPoint As SnapPoint

Connector

Description

The StartPoint property returns or sets the starting point of the connector object. This starting point is a snap point. For example, StartPoint(5) will begin the connector line at the fifth snap point of the object.

Example

The following example sets the reference point of the document to the lower left corner and creates a new snap point with coordinates at (1, 6). A rectangle and ellipse are created, and a connector line is drawn between them, starting at the ninth snap point of the rectangle to the first snap point of the ellipse.

Sub PointStart()

Dim sp as New SnapPoint

Dim s1 As Shape, s2 As Shape, c As Shape

ActiveDocument.ReferencePoint = cdrBottomLeft

sp.PositionX = 1

sp.PositionY = 6

Set s1 = ActiveLayer.CreateRectangle(0, 0, 3, 3)

Set s2 = ActiveLayer.CreateEllipse(4, 4, 6, 1)

Set c = ActiveLayer.CreateConnector(s1.SnapPoints(9), s2.SnapPoints(1))

c.Connector.StartPoint = s1.SnapPoints(9)

c.Connector.EndPoint = s2.SnapPoints(1)

End Sub

 Related Topics


CorelScript methods

CorelScript     Legend

   AddArrowPoint
   AddBezierPoint
   AddEnvelopeEffect
   AddFreehandPoint
   AddNode
   AddObjectDataField
   AddPageFrame
   AddTabStop
   AfterObject
   AlignObjects
   AlignTextToBaseline
   AlignToCenterOfPage
   AlignToGrid
   AppendCurveLine
   AppendObjectToSelection
   ApplyBitmapEffect
   ApplyBlend
   ApplyContour
   ApplyDistortion
   ApplyDropShadow
   ApplyEnvelopeFrom
   ApplyExtrude
   ApplyFountainBitmapLens
   ApplyFountainFill
   ApplyFullColorFill
   ApplyLensEffect
   ApplyNoFill
   ApplyOutline
   ApplyPerspectiveEffect
   ApplyPostscriptFill
   ApplyPreset
   ApplyPresetEnvelope
   ApplyRotatedExtrude
   ApplyStyle
   ApplyTextureBitmapLens
   ApplyTextureFill
   ApplyTwoColorBitmapLens
   ApplyTwoColorFill
   ApplyUniformBitmapLens
   ApplyUniformFillColor
   BeforeObject
   BeginCommandGroup
   BeginDrawArrow
   BeginDrawBezier
   BeginDrawCurve
   BeginDrawFreehand
   BeginEditObject
   Benchmark
   BreakApart
   ChangeLayerColor
   ChangeLayerName
   ClearAllObjectData
   ClearEffect
   ClearNodeSelection
   ClearObjectData
   ClickedDialogButton
   CloneObject
   CloseCurve
   Combine
   ConvertBitmapTo
   ConvertColor
   ConvertOutlineToObject
   ConvertToBitmap
   ConvertToCurves
   CopyEffectFrom
   CopyObjectDataFields
   CopyPowerClip
   CopyPropertiesFrom
   CopyToClipboard
   CopyToLayer
   CreateAngleDimension
   CreateArtisticText
   CreateCallout
   CreateConnector
   CreateDimension
   CreateEllipse
   CreateGridBoxes
   CreateGuidelineUsingAngle
   CreateGuidelineUsingTwoPoints
   CreateNewStyle
   CreateObjectDataField
   CreatePaletteFromDocument
   CreatePaletteFromSelection
   CreateRectangle
   CreateSpiral
   CreateSymPolygon
   CreateTextString
   CutToClipboard
   DefineObjectDataField
   DeleteGuidelineByIndex
   DeleteGuidelineUsingAngle
   DeleteGuidelineUsingTwoPoints
   DeleteLayer
   DeleteNode
   DeleteObject
   DeleteObjectDataField
   DeletePages
   DeletePaletteColor
   DeleteStyle
   DetachBlendPath
   DisplayFacingPages
   DistributeObjects
   DrawCurveClosePath
   DrawCurveCurveTo
   DrawCurveLineTo
   DrawCurveMoveTo
   DropSymbol
   DuplicateObject
   EditAngleDimensionLabel
   EditDimensionLabel
   EditLayer
   EditObjectCommand
   EndCommandGroup
   EndDrawArrow
   EndDrawBezier
   EndDrawCurve
   EndDrawFreehand
   EndEditObject
   EndOfRecording
   ExtractContents
   ExtractText
   FileClose
   FileExit
   FileExport
   FileImport
   FileNew
   FileOpen
   FilePrint
   FileSave
   FindNextObjectOfStyle
   FindObjectOfStyle
   FitTextToPath
   FuseBlend
   GetBitmapResolution
   GetBitmapSize
   GetCDRFileCompRatio
   GetCDRFileKeywords
   GetCDRFileLastSavedBy
   GetCDRFileNotes
   GetCDRFileThumbnail
   GetCDRFileVersion
   GetColor
   GetCurrentPageName
   GetCurrentPageOrientation
   GetCurrentPageSize
   GetCurrentPaletteName
   GetCurrentWorkspaceName
   GetCurveClose
   GetCurveFirstNodePosition
   GetCurveIthNodePosition
   GetCurveLastNodePosition
   GetCurveLength
   GetCurveNodeCount
   GetCurveSubpathCount
   GetDocumentCount
   GetDocumentName
   GetEllipseClockwise
   GetEllipseEndAngle
   GetEllipseStartAngle
   GetEllipseType
   GetFillType
   GetFountainFill
   GetFountainFillColor
   GetGuidelineInformation
   GetNodeIndex
   GetNodePosition
   GetNodeSelectedCount
   GetNodeType
   GetNumberOfGuidelines
   GetObjectCount
   GetObjectData
   GetObjectID
   GetObjectsCDRStaticID
   GetObjectType
   GetOutline
   GetOutlineColor
   GetPageCount
   GetPageSize
   GetPaletteColor
   GetPaletteColorCount
   GetPaletteColorName
   GetPolygonSharpness
   GetPolygonSides
   GetPolygonType
   GetPosition
   GetRectangleRadius
   GetSegmentLength
   GetSegmentType
   GetSize
   GetTextFontName
   GetTextFontSize
   GetTextString
   GetTextWordCount
   GetUniformFillColor
   GetUserClick
   GetUserDataField
   GetWorkspaceCount
   GetWorkspaceDescription
   GetWorkspaceName
   Group
   InflateBitmap
   InitBezierTool
   InsertOLEObject
   InsertOLEObjectFromFile
   InsertPages
   InsertPaletteColor
   Intersection
   IsBitmapExternallyLinked
   IsDefaultWorkspace
   IsDocument
   IsSelection
   LoadPalette
   LoadStyles
   LockGuidelineByIndex
   MenuCommand
   MergeBackText
   MoveBezierControl
   MoveCenter
   MoveGuidelineUsingAngleByIndex
   MoveGuidelineUsingTwoPointsByIndex
   MoveLayerTo
   MoveNode
   MoveObject
   MoveToLayer
   NewLayer
   OLEObjectDoVerb
   OrderBackOne
   OrderForwardOne
   OrderObjectDataFields
   OrderReverseOrder
   OrderToBack
   OrderToFront
   OverprintFill
   OverprintOutline
   PasteCustomClipboardFormat
   PasteFromClipboard
   PasteObjectData
   PasteSystemClipboardFormat
   PlaceInside
   RecorderApplyPerspective
   RecorderBeginEditParaText
   RecorderBeginEditText
   RecorderEditParaReplaceText
   RecorderEditParaTextChangeCase
   RecorderEditParaTextCharAttributes
   RecorderEditParaTextIndents
   RecorderEditParaTextSpacing
   RecorderEditReplaceText
   RecorderEditTextChangeCase
   RecorderEditTextCharAttributes
   RecorderEndEditParaText
   RecorderEndEditText
   RecorderObjectScaleInfo
   RecorderSelectObjectByIndex
   RecorderSelectObjectsByIndex
   RecorderSelectPreselectedObjects
   RecorderStorePreselectedObjects
   Redo
   RedrawAllScreens
   RedrawScreen
   RegisterObject
   RemoveAllGuidelines
   RemoveFountainFillColor
   RenameObjectDataField
   RenameStyle
   Repeat
   RepeatLastCommand
   ReplacePaletteColor
   ResetTransfo
   ResolveAllBitmapsLink
   ResolveBitmapLink
   ResumePainting
   RevertToStyle
   RotateObject
   SavePalette
   SaveStyleAs
   SaveStyleProp
   SaveTemplate
   SelectAllObjects
   SelectLayer
   SelectNextNode
   SelectNextObject
   SelectNode
   SelectNodeAt
   SelectObjectAtPoint
   SelectObjectOfCDRStaticID
   SelectObjectOfType
   SelectObjectsInRect
   SelectPreviousObject
   Separate
   SetApplyToDuplicate
   SetArtisticText
   SetBullet
   SetCharacterAttributes
   SetColorOverride
   SetCornerRoundness
   SetCurrentDocument
   SetCurrentPage
   SetCurrentPageName
   SetCurrentPageOrientation
   SetCurrentPageSize
   SetCurrentWorkspace
   SetDocVisible
   SetEllipseProperties
   SetErrorHandling
   SetFrameColumn
   SetFullScreenPreview
   SetIndents
   SetLayerLocked
   SetLayerPrintable
   SetLayerVisible
   SetMultiLayer
   SetNodeType
   SetObjectData
   SetOptionsForAllPages
   SetOutlineArrow
   SetOutlineColor
   SetOutlineMiscProperties
   SetOutlineWidth
   SetPageLayout
   SetPageOrientation
   SetPageSize
   SetPageSizeFromPrinter
   SetPaperColor
   SetParagraphSpacing
   SetPolygonProperties
   SetPosition
   SetReferencePoint
   SetSegmentType
   SetSize
   SetTextString
   SetToMasterLayer
   SetUserDataField
   SetVisible
   ShareExtrudeVP
   ShowPageBorder
   SkewObject
   SplitBlend
   StartEditContents
   StartOfRecording
   StopEditContents
   StoreColor
   StraightenText
   StretchObject
   SuppressPainting
   Trim
   Undo
   Ungroup
   UngroupAll
   UnlockGuidelineByIndex
   UnRegisterObject
   UnSelectAll
   UpdateBitmapLink
   Weld
   ZoomIn
   ZoomOut
   ZoomToAllObjects
   ZoomToHeight
   ZoomToPage
   ZoomToRectangle
   ZoomToSelection
   ZoomToWidth


CorelScript

Class CorelScript

Methods     Referenced By

 Related Topics


CorelScript.AddArrowPoint

Function AddArrowPoint(ByVal X As Long, ByVal Y As Long, ByVal Enabled As Boolean, ByVal Letter As Boolean, ByVal User As Boolean, ByVal Closed As Boolean, ByVal Continuity As Long, ByVal NodeType As Long) As Long

CorelScript

Description

Parameters	Description

X	Description of X goes here

Y	Description of Y goes here

Enabled	Description of Enabled goes here

Letter	Description of Letter goes here

User	Description of User goes here

Closed	Description of Closed goes here

Continuity	Description of Continuity goes here

NodeType	Description of NodeType goes here

Return value

Returns Long

 Related Topics


CorelScript.AddBezierPoint

Function AddBezierPoint(ByVal X As Long, ByVal Y As Long, ByVal Constrain As Boolean, ByVal Cusp As Boolean) As Long

CorelScript

Description

Parameters	Description

X	Description of X goes here

Y	Description of Y goes here

Constrain	Description of Constrain goes here

Cusp	Description of Cusp goes here

Return value

Returns Long

 Related Topics


CorelScript.AddEnvelopeEffect

Function AddEnvelopeEffect(ByVal PresetNumber As Long, ByVal MappingMode As Long, ByVal KeepLines As Boolean) As Long

CorelScript

Description

Parameters	Description

PresetNumber	Description of PresetNumber goes here

MappingMode	Description of MappingMode goes here

KeepLines	Description of KeepLines goes here

Return value

Returns Long

 Related Topics


CorelScript.AddFreehandPoint

Function AddFreehandPoint(ByVal ConvertToDPCoords As Boolean, ByVal X As Long, ByVal Y As Long) As Long

CorelScript

Description

Parameters	Description

ConvertToDPCoords	Description of ConvertToDPCoords goes here

X	Description of X goes here

Y	Description of Y goes here

Return value

Returns Long

 Related Topics


CorelScript.AddNode

Function AddNode(ByVal X As Long, ByVal Y As Long) As Long

CorelScript

Description

Parameters	Description

X	Description of X goes here

Y	Description of Y goes here

Return value

Returns Long

 Related Topics


CorelScript.AddObjectDataField

Function AddObjectDataField(ByVal FieldName As String) As Long

CorelScript

Description

Parameters	Description

FieldName	Description of FieldName goes here

Return value

Returns Long

 Related Topics


CorelScript.AddPageFrame

Function AddPageFrame() As Long

CorelScript

Description

Return value

Returns Long

 Related Topics


CorelScript.AddTabStop

Function AddTabStop(ByVal FirstSelectedChar As Long, ByVal LastSelectedChar As Long, ByVal TabStop As Long) As Long

CorelScript

Description

Parameters	Description

FirstSelectedChar	Description of FirstSelectedChar goes here

LastSelectedChar	Description of LastSelectedChar goes here

TabStop	Description of TabStop goes here

Return value

Returns Long

 Related Topics


CorelScript.AfterObject

Function AfterObject(ByVal CorelDRAWID As Long) As Long

CorelScript

Description

Parameters	Description

CorelDRAWID	Description of CorelDRAWID goes here

Return value

Returns Long

 Related Topics


CorelScript.AlignObjects

Function AlignObjects(ByVal HorizontalAlignment As Long, ByVal VerticalAlignment As Long) As Long

CorelScript

Description

Parameters	Description

HorizontalAlignment	Description of HorizontalAlignment goes here

VerticalAlignment	Description of VerticalAlignment goes here

Return value

Returns Long

 Related Topics


CorelScript.AlignTextToBaseline

Function AlignTextToBaseline(ByVal FirstSelectedChar As Long, ByVal LastSelectedChar As Long) As Long

CorelScript

Description

Parameters	Description

FirstSelectedChar	Description of FirstSelectedChar goes here

LastSelectedChar	Description of LastSelectedChar goes here

Return value

Returns Long

 Related Topics


CorelScript.AlignToCenterOfPage

Function AlignToCenterOfPage(ByVal HorizontalAlignment As Long, ByVal VerticalAlignment As Long) As Long

CorelScript

Description

Parameters	Description

HorizontalAlignment	Description of HorizontalAlignment goes here

VerticalAlignment	Description of VerticalAlignment goes here

Return value

Returns Long

 Related Topics


CorelScript.AlignToGrid

Function AlignToGrid(ByVal HorizontalAlignment As Long, ByVal VerticalAlignment As Long) As Long

CorelScript

Description

Parameters	Description

HorizontalAlignment	Description of HorizontalAlignment goes here

VerticalAlignment	Description of VerticalAlignment goes here

Return value

Returns Long

 Related Topics


CorelScript.AppendCurveLine

Function AppendCurveLine(ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) As Long

CorelScript

Description

Parameters	Description

x1	Description of x1 goes here

y1	Description of y1 goes here

x2	Description of x2 goes here

y2	Description of y2 goes here

Return value

Returns Long

 Related Topics


CorelScript.AppendObjectToSelection

Function AppendObjectToSelection(ByVal ObjectID As Long) As Boolean

CorelScript

Description

Parameters	Description

ObjectID	Description of ObjectID goes here

Return value

Returns Boolean

 Related Topics


CorelScript.ApplyBitmapEffect

Function ApplyBitmapEffect(ByVal EffectID As Long) As Long

CorelScript

Description

Parameters	Description

EffectID	Description of EffectID goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyBlend

Function ApplyBlend(ByVal Steps As Boolean, ByVal NoOfStepsSpaces As Long, ByVal AngleOfRotation As Long, ByVal Loop As Boolean, ByVal PathObjectID As Long, ByVal FullPath As Boolean, ByVal RotateAll As Boolean, ByVal ColorWheelMode As Long, ByVal MapNodeStartObject As Long, ByVal MapNodeEndObject As Long, ByVal LinearBlend As Boolean, ByVal LinearSpacing As Boolean, ByVal LinkAccelerations As Boolean, ByVal AccelShapes As Boolean, ByVal BlendLogBase As Long, ByVal SpacingLogBase As Long, ByVal BlendID As Long, ByVal BlendType As Long, ByVal MapNodes As Boolean) As Long

CorelScript

Description

Parameters	Description

Steps	Description of Steps goes here

NoOfStepsSpaces	Description of NoOfStepsSpaces goes here

AngleOfRotation	Description of AngleOfRotation goes here

Loop	Description of Loop goes here

PathObjectID	Description of PathObjectID goes here

FullPath	Description of FullPath goes here

RotateAll	Description of RotateAll goes here

ColorWheelMode	Description of ColorWheelMode goes here

MapNodeStartObject	Description of MapNodeStartObject goes here

MapNodeEndObject	Description of MapNodeEndObject goes here

LinearBlend	Description of LinearBlend goes here

LinearSpacing	Description of LinearSpacing goes here

LinkAccelerations	Description of LinkAccelerations goes here

AccelShapes	Description of AccelShapes goes here

BlendLogBase	Description of BlendLogBase goes here

SpacingLogBase	Description of SpacingLogBase goes here

BlendID	Description of BlendID goes here

BlendType	Description of BlendType goes here

MapNodes	Description of MapNodes goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyContour

Function ApplyContour(ByVal ContourType As Long, ByVal Offset As Long, ByVal Steps As Long, ByVal ColorWheelDirection As Long) As Long

CorelScript

Description

Parameters	Description

ContourType	Description of ContourType goes here

Offset	Description of Offset goes here

Steps	Description of Steps goes here

ColorWheelDirection	Description of ColorWheelDirection goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyDistortion

Function ApplyDistortion(ByVal New As Boolean, ByVal DistortionType As Long, ByVal Amplitude As Long, ByVal Frequency As Long, ByVal Seed As Long, ByVal Angle As Long, ByVal CenterX As Long, ByVal CenterY As Long, ByVal Flag As Long) As Long

CorelScript

Description

Parameters	Description

New	Description of New goes here

DistortionType	Description of DistortionType goes here

Amplitude	Description of Amplitude goes here

Frequency	Description of Frequency goes here

Seed	Description of Seed goes here

Angle	Description of Angle goes here

CenterX	Description of CenterX goes here

CenterY	Description of CenterY goes here

Flag	Description of Flag goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyDropShadow

Function ApplyDropShadow(ByVal HorizOffset As Long, ByVal VertOffset As Long, ByVal Opacity As Long, ByVal Feather As Long, ByVal FeatherType As Long, ByVal FeatherEdge As Long, ByVal PerspectiveType As Long, ByVal PerspectiveSkewAngle As Long, ByVal PerspectiveStretch As Double, ByVal Fade As Long, ByVal IdenticalValues As Boolean) As Long

CorelScript

Description

Parameters	Description

HorizOffset	Description of HorizOffset goes here

VertOffset	Description of VertOffset goes here

Opacity	Description of Opacity goes here

Feather	Description of Feather goes here

FeatherType	Description of FeatherType goes here

FeatherEdge	Description of FeatherEdge goes here

PerspectiveType	Description of PerspectiveType goes here

PerspectiveSkewAngle	Description of PerspectiveSkewAngle goes here

PerspectiveStretch	Description of PerspectiveStretch goes here

Fade	Description of Fade goes here

IdenticalValues	Description of IdenticalValues goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyEnvelopeFrom

Function ApplyEnvelopeFrom(ByVal ObjectID As Long, ByVal MappingMode As Long, ByVal KeepLines As Boolean) As Long

CorelScript

Description

Parameters	Description

ObjectID	Description of ObjectID goes here

MappingMode	Description of MappingMode goes here

KeepLines	Description of KeepLines goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyExtrude

Function ApplyExtrude(ByVal ExtrudeType As Long, ByVal VPProperties As Long, ByVal CopyObjectID As Long, ByVal Depth As Long, ByVal VPHorizPos As Long, ByVal VPVertPos As Long, ByVal PageOrigin As Boolean, ByVal Light1Pos As Long, ByVal Light1Intensity As Long, ByVal Light2Pos As Long, ByVal Light2Intensity As Long, ByVal Light3Pos As Long, ByVal Light3Intensity As Long, ByVal FillType As Long, ByVal DrapeFill As Boolean) As Long

CorelScript

Description

Parameters	Description

ExtrudeType	Description of ExtrudeType goes here

VPProperties	Description of VPProperties goes here

CopyObjectID	Description of CopyObjectID goes here

Depth	Description of Depth goes here

VPHorizPos	Description of VPHorizPos goes here

VPVertPos	Description of VPVertPos goes here

PageOrigin	Description of PageOrigin goes here

Light1Pos	Description of Light1Pos goes here

Light1Intensity	Description of Light1Intensity goes here

Light2Pos	Description of Light2Pos goes here

Light2Intensity	Description of Light2Intensity goes here

Light3Pos	Description of Light3Pos goes here

Light3Intensity	Description of Light3Intensity goes here

FillType	Description of FillType goes here

DrapeFill	Description of DrapeFill goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyFountainBitmapLens

Function ApplyFountainBitmapLens(ByVal Type As Long, ByVal CenterX As Long, ByVal CenterY As Long, ByVal Angle As Long, ByVal Steps As Long, ByVal Padding As Long, ByVal Blend As Long, ByVal Rate As Long, ByVal Starting As Long, ByVal Operation As Long, ByVal Freeze As Boolean) As Long

CorelScript

Description

Parameters	Description

Type	Description of Type goes here

CenterX	Description of CenterX goes here

CenterY	Description of CenterY goes here

Angle	Description of Angle goes here

Steps	Description of Steps goes here

Padding	Description of Padding goes here

Blend	Description of Blend goes here

Rate	Description of Rate goes here

Starting	Description of Starting goes here

Operation	Description of Operation goes here

Freeze	Description of Freeze goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyFountainFill

Function ApplyFountainFill(ByVal Type As Long, ByVal CenterX As Long, ByVal CenterY As Long, ByVal Angle As Long, ByVal Steps As Long, ByVal Padding As Long, ByVal Blend As Long, ByVal Rate As Long) As Long

CorelScript

Description

Parameters	Description

Type	Description of Type goes here

CenterX	Description of CenterX goes here

CenterY	Description of CenterY goes here

Angle	Description of Angle goes here

Steps	Description of Steps goes here

Padding	Description of Padding goes here

Blend	Description of Blend goes here

Rate	Description of Rate goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyFullColorFill

Function ApplyFullColorFill(ByVal FileName As String, ByVal TileWidth As Long, ByVal TileHeight As Long, ByVal FirstTileOffsetX As Long, ByVal FirstTileOffsetY As Long, ByVal RowOffset As Boolean, ByVal RowColumnOffset As Long, ByVal SeamlessTiling As Boolean, ByVal ScaleWithObject As Boolean, ByVal VectorBBoxTop As Long, ByVal VectorBBoxBottom As Long, ByVal VectorBBoxLeft As Long, ByVal VectorBBoxRight As Long, ByVal RotationAngle As Long, ByVal SkewAngle As Long) As Long

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

TileWidth	Description of TileWidth goes here

TileHeight	Description of TileHeight goes here

FirstTileOffsetX	Description of FirstTileOffsetX goes here

FirstTileOffsetY	Description of FirstTileOffsetY goes here

RowOffset	Description of RowOffset goes here

RowColumnOffset	Description of RowColumnOffset goes here

SeamlessTiling	Description of SeamlessTiling goes here

ScaleWithObject	Description of ScaleWithObject goes here

VectorBBoxTop	Description of VectorBBoxTop goes here

VectorBBoxBottom	Description of VectorBBoxBottom goes here

VectorBBoxLeft	Description of VectorBBoxLeft goes here

VectorBBoxRight	Description of VectorBBoxRight goes here

RotationAngle	Description of RotationAngle goes here

SkewAngle	Description of SkewAngle goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyLensEffect

Function ApplyLensEffect(ByVal LensType As Long, ByVal Frozen As Boolean, ByVal RemoveFace As Boolean, ByVal ViewPoint As Boolean, ByVal VPX As Long, ByVal VPY As Long, ByVal Param1 As Long) As Long

CorelScript

Description

Parameters	Description

LensType	Description of LensType goes here

Frozen	Description of Frozen goes here

RemoveFace	Description of RemoveFace goes here

ViewPoint	Description of ViewPoint goes here

VPX	Description of VPX goes here

VPY	Description of VPY goes here

Param1	Description of Param1 goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyNoFill

Function ApplyNoFill() As Long

CorelScript

Description

Return value

Returns Long

 Related Topics


CorelScript.ApplyOutline

Function ApplyOutline(ByVal Width As Long, ByVal Type As Long, ByVal EndCaps As Long, ByVal JoinType As Long, ByVal Aspect As Long, ByVal Angle As Long, ByVal DotDash As Long, ByVal RightArrow As Long, ByVal LeftArrow As Long, ByVal BehindFill As Boolean, ByVal OutlineType As Long, ByVal Preset As Long, ByVal ScalePen As Boolean) As Long

CorelScript

Description

Parameters	Description

Width	Description of Width goes here

Type	Description of Type goes here

EndCaps	Description of EndCaps goes here

JoinType	Description of JoinType goes here

Aspect	Description of Aspect goes here

Angle	Description of Angle goes here

DotDash	Description of DotDash goes here

RightArrow	Description of RightArrow goes here

LeftArrow	Description of LeftArrow goes here

BehindFill	Description of BehindFill goes here

OutlineType	Description of OutlineType goes here

Preset	Description of Preset goes here

ScalePen	Description of ScalePen goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyPerspectiveEffect

Function ApplyPerspectiveEffect(ByVal Handle As Long, ByVal PosX As Long, ByVal PosY As Long) As Long

CorelScript

Description

Parameters	Description

Handle	Description of Handle goes here

PosX	Description of PosX goes here

PosY	Description of PosY goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyPostscriptFill

Function ApplyPostscriptFill(ByVal PSFill As String, ByVal NumParms As Long, ByVal Parm1 As Long, ByVal Parm2 As Long, ByVal Parm3 As Long, ByVal Parm4 As Long, ByVal Parm5 As Long) As Long

CorelScript

Description

Parameters	Description

PSFill	Description of PSFill goes here

NumParms	Description of NumParms goes here

Parm1	Description of Parm1 goes here

Parm2	Description of Parm2 goes here

Parm3	Description of Parm3 goes here

Parm4	Description of Parm4 goes here

Parm5	Description of Parm5 goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyPreset

Function ApplyPreset(ByVal PresetFileName As String, ByVal PresetName As String) As Long

CorelScript

Description

Parameters	Description

PresetFileName	Description of PresetFileName goes here

PresetName	Description of PresetName goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyPresetEnvelope

Function ApplyPresetEnvelope(ByVal PresetNumber As Long, ByVal MappingMode As Long, ByVal KeepLines As Boolean) As Long

CorelScript

Description

Parameters	Description

PresetNumber	Description of PresetNumber goes here

MappingMode	Description of MappingMode goes here

KeepLines	Description of KeepLines goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyRotatedExtrude

Function ApplyRotatedExtrude(ByVal ExtrudeType As Long, ByVal Depth As Long, ByVal XRotation As Long, ByVal YRotation As Long, ByVal ZRotation As Long, ByVal VPHorizPos As Long, ByVal VPVertPos As Long, ByVal PageOrigin As Boolean, ByVal Light1Pos As Long, ByVal Light1Intensity As Long, ByVal Light2Pos As Long, ByVal Light2Intensity As Long, ByVal Light3Pos As Long, ByVal Light3Intensity As Long, ByVal FillType As Long, ByVal DrapeFill As Boolean) As Long

CorelScript

Description

Parameters	Description

ExtrudeType	Description of ExtrudeType goes here

Depth	Description of Depth goes here

XRotation	Description of XRotation goes here

YRotation	Description of YRotation goes here

ZRotation	Description of ZRotation goes here

VPHorizPos	Description of VPHorizPos goes here

VPVertPos	Description of VPVertPos goes here

PageOrigin	Description of PageOrigin goes here

Light1Pos	Description of Light1Pos goes here

Light1Intensity	Description of Light1Intensity goes here

Light2Pos	Description of Light2Pos goes here

Light2Intensity	Description of Light2Intensity goes here

Light3Pos	Description of Light3Pos goes here

Light3Intensity	Description of Light3Intensity goes here

FillType	Description of FillType goes here

DrapeFill	Description of DrapeFill goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyStyle

Function ApplyStyle(ByVal Style As String) As Long

CorelScript

Description

Parameters	Description

Style	Description of Style goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyTextureBitmapLens

Function ApplyTextureBitmapLens(ByVal TextureLibrary As String, ByVal TextureName As String, ByVal TextureStyle As String, ByVal TextureWidth As Long, ByVal TextureHeight As Long, ByVal TextureOffsetX As Long, ByVal TextureOffsetY As Long, ByVal RowOffset As Boolean, ByVal RowColumnOffset As Long, ByVal ScaleWithObject As Boolean, ByVal RotationAngle As Long, ByVal SkewAngle As Long, ByVal Starting As Long, ByVal Ending As Long, ByVal Operation As Long, ByVal Freeze As Boolean) As Long

CorelScript

Description

Parameters	Description

TextureLibrary	Description of TextureLibrary goes here

TextureName	Description of TextureName goes here

TextureStyle	Description of TextureStyle goes here

TextureWidth	Description of TextureWidth goes here

TextureHeight	Description of TextureHeight goes here

TextureOffsetX	Description of TextureOffsetX goes here

TextureOffsetY	Description of TextureOffsetY goes here

RowOffset	Description of RowOffset goes here

RowColumnOffset	Description of RowColumnOffset goes here

ScaleWithObject	Description of ScaleWithObject goes here

RotationAngle	Description of RotationAngle goes here

SkewAngle	Description of SkewAngle goes here

Starting	Description of Starting goes here

Ending	Description of Ending goes here

Operation	Description of Operation goes here

Freeze	Description of Freeze goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyTextureFill

Function ApplyTextureFill(ByVal TextureLibrary As String, ByVal TextureName As String, ByVal TextureStyle As String, ByVal TextureWidth As Long, ByVal TextureHeight As Long, ByVal TextureOffestX As Long, ByVal TextureOffsetY As Long, ByVal RowOffset As Boolean, ByVal RowColumnOffset As Long, ByVal ScaleWithObject As Boolean, ByVal RotationAngle As Long, ByVal SkewAngle As Long) As Long

CorelScript

Description

Parameters	Description

TextureLibrary	Description of TextureLibrary goes here

TextureName	Description of TextureName goes here

TextureStyle	Description of TextureStyle goes here

TextureWidth	Description of TextureWidth goes here

TextureHeight	Description of TextureHeight goes here

TextureOffestX	Description of TextureOffestX goes here

TextureOffsetY	Description of TextureOffsetY goes here

RowOffset	Description of RowOffset goes here

RowColumnOffset	Description of RowColumnOffset goes here

ScaleWithObject	Description of ScaleWithObject goes here

RotationAngle	Description of RotationAngle goes here

SkewAngle	Description of SkewAngle goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyTwoColorBitmapLens

Function ApplyTwoColorBitmapLens(ByVal FileName As String, ByVal TileWidth As Long, ByVal TileHeight As Long, ByVal FirstTileOffsetX As Long, ByVal FirstTileOffsetY As Long, ByVal RowOffset As Boolean, ByVal RowColumnOffset As Long, ByVal SeamlessTiling As Boolean, ByVal ScaleWithObject As Boolean, ByVal RotationAngle As Long, ByVal SkewAngle As Long, ByVal Starting As Long, ByVal Ending As Long, ByVal Operation As Long, ByVal Freeze As Boolean) As Long

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

TileWidth	Description of TileWidth goes here

TileHeight	Description of TileHeight goes here

FirstTileOffsetX	Description of FirstTileOffsetX goes here

FirstTileOffsetY	Description of FirstTileOffsetY goes here

RowOffset	Description of RowOffset goes here

RowColumnOffset	Description of RowColumnOffset goes here

SeamlessTiling	Description of SeamlessTiling goes here

ScaleWithObject	Description of ScaleWithObject goes here

RotationAngle	Description of RotationAngle goes here

SkewAngle	Description of SkewAngle goes here

Starting	Description of Starting goes here

Ending	Description of Ending goes here

Operation	Description of Operation goes here

Freeze	Description of Freeze goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyTwoColorFill

Function ApplyTwoColorFill(ByVal FileName As String, ByVal TileWidth As Long, ByVal TileHeight As Long, ByVal FirstTileOffsetX As Long, ByVal FirstTileOffsetY As Long, ByVal RowOffset As Boolean, ByVal RowColumnOffset As Long, ByVal SeamlessTiling As Boolean, ByVal ScaleWithObject As Boolean, ByVal RotationAngle As Long, ByVal SkewAngle As Long) As Long

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

TileWidth	Description of TileWidth goes here

TileHeight	Description of TileHeight goes here

FirstTileOffsetX	Description of FirstTileOffsetX goes here

FirstTileOffsetY	Description of FirstTileOffsetY goes here

RowOffset	Description of RowOffset goes here

RowColumnOffset	Description of RowColumnOffset goes here

SeamlessTiling	Description of SeamlessTiling goes here

ScaleWithObject	Description of ScaleWithObject goes here

RotationAngle	Description of RotationAngle goes here

SkewAngle	Description of SkewAngle goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyUniformBitmapLens

Function ApplyUniformBitmapLens(ByVal Starting As Long, ByVal Operation As Long, ByVal Freeze As Boolean) As Long

CorelScript

Description

Parameters	Description

Starting	Description of Starting goes here

Operation	Description of Operation goes here

Freeze	Description of Freeze goes here

Return value

Returns Long

 Related Topics


CorelScript.ApplyUniformFillColor

Function ApplyUniformFillColor() As Long

CorelScript

Description

Return value

Returns Long

 Related Topics


CorelScript.BeforeObject

Function BeforeObject(ByVal CorelDRAWID As Long) As Long

CorelScript

Description

Parameters	Description

CorelDRAWID	Description of CorelDRAWID goes here

Return value

Returns Long

 Related Topics


CorelScript.BeginCommandGroup

Function BeginCommandGroup(ByVal UndoString As String) As Long

CorelScript

Description

Parameters	Description

UndoString	Description of UndoString goes here

Return value

Returns Long

 Related Topics


CorelScript.BeginDrawArrow

Function BeginDrawArrow(ByVal LeftArrow As Boolean, ByVal LineOffset As Long, ByVal NumOfPoints As Long) As Long

CorelScript

Description

Parameters	Description

LeftArrow	Description of LeftArrow goes here

LineOffset	Description of LineOffset goes here

NumOfPoints	Description of NumOfPoints goes here

Return value

Returns Long

 Related Topics


CorelScript.BeginDrawBezier

Function BeginDrawBezier(ByVal X As Long, ByVal Y As Long, ByVal Cusp As Boolean) As Long

CorelScript

Description

Parameters	Description

X	Description of X goes here

Y	Description of Y goes here

Cusp	Description of Cusp goes here

Return value

Returns Long

 Related Topics


CorelScript.BeginDrawCurve

Function BeginDrawCurve(ByVal X As Long, ByVal Y As Long) As Long

CorelScript

Description

Parameters	Description

X	Description of X goes here

Y	Description of Y goes here

Return value

Returns Long

 Related Topics


CorelScript.BeginDrawFreehand

Function BeginDrawFreehand(ByVal ConvertToDPCoords As Boolean, ByVal X As Long, ByVal Y As Long) As Long

CorelScript

Description

Parameters	Description

ConvertToDPCoords	Description of ConvertToDPCoords goes here

X	Description of X goes here

Y	Description of Y goes here

Return value

Returns Long

 Related Topics


CorelScript.BeginEditObject

Function BeginEditObject() As Long

CorelScript

Description

Return value

Returns Long

 Related Topics


CorelScript.Benchmark

Function Benchmark(ByVal Enable As Boolean) As Long

CorelScript

Description

Parameters	Description

Enable	Description of Enable goes here

Return value

Returns Long

 Related Topics


CorelScript.BreakApart

Function BreakApart() As Long

CorelScript

Description

Return value

Returns Long

 Related Topics


CorelScript.ChangeLayerColor

Function ChangeLayerColor(ByVal LayerName As String, ByVal PageNum As Long) As Long

CorelScript

Description

Parameters	Description

LayerName	Description of LayerName goes here

PageNum	Description of PageNum goes here

Return value

Returns Long

 Related Topics


CorelScript.ChangeLayerName

Function ChangeLayerName(ByVal NewLayerName As String) As Long

CorelScript

Description

Parameters	Description

NewLayerName	Description of NewLayerName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ClearAllObjectData

Function ClearAllObjectData() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ClearEffect

Function ClearEffect(ByVal LeaveTarget As Boolean) As Long

CorelScript

Description

Parameters	Description

LeaveTarget	Description of LeaveTarget goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ClearNodeSelection

Function ClearNodeSelection() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ClearObjectData

Function ClearObjectData(ByVal FieldName As String) As Long

CorelScript

Description

Parameters	Description

FieldName	Description of FieldName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ClickedDialogButton

Function ClickedDialogButton(ByVal DialogID As Long, ByVal ButtonID As Long) As Long

CorelScript

Description

Parameters	Description

DialogID	Description of DialogID goes here

ButtonID	Description of ButtonID goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CloneObject

Function CloneObject(ByVal XOffset As Long, ByVal YOffset As Long) As Long

CorelScript

Description

Parameters	Description

XOffset	Description of XOffset goes here

YOffset	Description of YOffset goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CloseCurve

Function CloseCurve() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.Combine

Function Combine() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ConvertBitmapTo

Function ConvertBitmapTo(ByVal EffectID As Long) As Long

CorelScript

Description

Parameters	Description

EffectID	Description of EffectID goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ConvertColor

Function ConvertColor(ByVal ToColorModel As Long, ByRef ToV1 As Long, ByRef ToV2 As Long, ByRef ToV3 As Long, ByRef ToV4 As Long, ByRef ToV5 As Long, ByRef ToV6 As Long, ByRef ToDensity As Long) As Long

CorelScript

Description

Parameters	Description

ToColorModel	Description of ToColorModel goes here

ToV1	Description of ToV1 goes here

ToV2	Description of ToV2 goes here

ToV3	Description of ToV3 goes here

ToV4	Description of ToV4 goes here

ToV5	Description of ToV5 goes here

ToV6	Description of ToV6 goes here

ToDensity	Description of ToDensity goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ConvertOutlineToObject

Function ConvertOutlineToObject() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ConvertToBitmap

Function ConvertToBitmap(ByVal BitDepth As Long, ByVal Grayscale As Boolean, ByVal Dithered As Boolean, ByVal TransparentBG As Boolean, ByVal Resolution As Long, ByVal AntiAliasing As Long, ByVal UseColorProfile As Boolean) As Long

CorelScript

Description

Parameters	Description

BitDepth	Description of BitDepth goes here

Grayscale	Description of Grayscale goes here

Dithered	Description of Dithered goes here

TransparentBG	Description of TransparentBG goes here

Resolution	Description of Resolution goes here

AntiAliasing	Description of AntiAliasing goes here

UseColorProfile	Description of UseColorProfile goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ConvertToCurves

Function ConvertToCurves() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CopyEffectFrom

Function CopyEffectFrom(ByVal Clone As Boolean, ByVal SourceObjectID As Long) As Long

CorelScript

Description

Parameters	Description

Clone	Description of Clone goes here

SourceObjectID	Description of SourceObjectID goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CopyObjectDataFields

Function CopyObjectDataFields(ByVal Index As Long) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CopyPowerClip

Function CopyPowerClip(ByVal Index As Long, ByVal XDisp As Long, ByVal YDisp As Long) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

XDisp	Description of XDisp goes here

YDisp	Description of YDisp goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CopyPropertiesFrom

Function CopyPropertiesFrom(ByVal FromObjectID As Long, ByVal OutlinePen As Boolean, ByVal OutlineColor As Boolean, ByVal Fill As Boolean, ByVal TextAttributes As Boolean) As Long

CorelScript

Description

Parameters	Description

FromObjectID	Description of FromObjectID goes here

OutlinePen	Description of OutlinePen goes here

OutlineColor	Description of OutlineColor goes here

Fill	Description of Fill goes here

TextAttributes	Description of TextAttributes goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CopyToClipboard

Function CopyToClipboard() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CopyToLayer

Function CopyToLayer(ByVal LayerName As String) As Long

CorelScript

Description

Parameters	Description

LayerName	Description of LayerName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateAngleDimension

Function CreateAngleDimension(ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal X3 As Long, ByVal Y3 As Long, ByVal X4 As Long, ByVal Y4 As Long, ByVal LargeAngle As Boolean, ByVal WitnessExtension As Long, ByVal WitnessGap As Long, ByVal LabelGap As Long) As Long

CorelScript

Description

Parameters	Description

x1	Description of x1 goes here

y1	Description of y1 goes here

x2	Description of x2 goes here

y2	Description of y2 goes here

X3	Description of X3 goes here

Y3	Description of Y3 goes here

X4	Description of X4 goes here

Y4	Description of Y4 goes here

LargeAngle	Description of LargeAngle goes here

WitnessExtension	Description of WitnessExtension goes here

WitnessGap	Description of WitnessGap goes here

LabelGap	Description of LabelGap goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateArtisticText

Function CreateArtisticText(ByVal NewText As String, ByVal Left As Long, ByVal Top As Long) As Long

CorelScript

Description

Parameters	Description

NewText	Description of NewText goes here

Left	Description of Left goes here

Top	Description of Top goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateCallout

Function CreateCallout(ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal X3 As Long, ByVal Y3 As Long, ByVal Text As String) As Long

CorelScript

Description

Parameters	Description

x1	Description of x1 goes here

y1	Description of y1 goes here

x2	Description of x2 goes here

y2	Description of y2 goes here

X3	Description of X3 goes here

Y3	Description of Y3 goes here

Text	Description of Text goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateConnector

Function CreateConnector(ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal Placement As Boolean) As Long

CorelScript

Description

Parameters	Description

x1	Description of x1 goes here

y1	Description of y1 goes here

x2	Description of x2 goes here

y2	Description of y2 goes here

Placement	Description of Placement goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateDimension

Function CreateDimension(ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal X3 As Long, ByVal Y3 As Long, ByVal Style As Long, ByVal WitnessExtension As Long, ByVal WitnessGap As Long, ByVal LabelGap As Long) As Long

CorelScript

Description

Parameters	Description

x1	Description of x1 goes here

y1	Description of y1 goes here

x2	Description of x2 goes here

y2	Description of y2 goes here

X3	Description of X3 goes here

Y3	Description of Y3 goes here

Style	Description of Style goes here

WitnessExtension	Description of WitnessExtension goes here

WitnessGap	Description of WitnessGap goes here

LabelGap	Description of LabelGap goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateEllipse

Function CreateEllipse(ByVal Top As Long, ByVal Left As Long, ByVal Bottom As Long, ByVal Right As Long, ByVal StartAngle As Long, ByVal EndAngle As Long, ByVal Arc As Boolean) As Long

CorelScript

Description

Parameters	Description

Top	Description of Top goes here

Left	Description of Left goes here

Bottom	Description of Bottom goes here

Right	Description of Right goes here

StartAngle	Description of StartAngle goes here

EndAngle	Description of EndAngle goes here

Arc	Description of Arc goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateGridBoxes

Function CreateGridBoxes(ByVal Top As Long, ByVal Left As Long, ByVal Bottom As Long, ByVal Right As Long, ByVal Wide As Long, ByVal High As Long) As Long

CorelScript

Description

Parameters	Description

Top	Description of Top goes here

Left	Description of Left goes here

Bottom	Description of Bottom goes here

Right	Description of Right goes here

Wide	Description of Wide goes here

High	Description of High goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateGuidelineUsingAngle

Function CreateGuidelineUsingAngle(ByVal IntersectPointX As Long, ByVal IntersectPointY As Long, ByVal Angle As Long, ByVal Locked As Boolean) As Long

CorelScript

Description

Parameters	Description

IntersectPointX	Description of IntersectPointX goes here

IntersectPointY	Description of IntersectPointY goes here

Angle	Description of Angle goes here

Locked	Description of Locked goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateGuidelineUsingTwoPoints

Function CreateGuidelineUsingTwoPoints(ByVal Point1X As Long, ByVal Point1Y As Long, ByVal Point2X As Long, ByVal Point2Y As Long, ByVal Locked As Boolean) As Long

CorelScript

Description

Parameters	Description

Point1X	Description of Point1X goes here

Point1Y	Description of Point1Y goes here

Point2X	Description of Point2X goes here

Point2Y	Description of Point2Y goes here

Locked	Description of Locked goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateNewStyle

Function CreateNewStyle(ByVal StyleType As Long, ByVal StyleName As String) As Long

CorelScript

Description

Parameters	Description

StyleType	Description of StyleType goes here

StyleName	Description of StyleName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateObjectDataField

Function CreateObjectDataField(ByVal FieldName As String, ByVal Format As String, ByVal Order As Long, ByVal ColumnWidth As Long, ByVal DrawDefault As Boolean, ByVal DocDefault As Boolean, ByVal SummarizeGroup As Boolean) As Long

CorelScript

Description

Parameters	Description

FieldName	Description of FieldName goes here

Format	Description of Format goes here

Order	Description of Order goes here

ColumnWidth	Description of ColumnWidth goes here

DrawDefault	Description of DrawDefault goes here

DocDefault	Description of DocDefault goes here

SummarizeGroup	Description of SummarizeGroup goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreatePaletteFromDocument

Function CreatePaletteFromDocument(ByVal FileName As String, ByVal Overwrite As Boolean) As Long

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

Overwrite	Description of Overwrite goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreatePaletteFromSelection

Function CreatePaletteFromSelection(ByVal FileName As String, ByVal Overwrite As Boolean) As Long

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

Overwrite	Description of Overwrite goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateRectangle

Function CreateRectangle(ByVal Top As Long, ByVal Left As Long, ByVal Bottom As Long, ByVal Right As Long, ByVal CornerRadius As Long, ByVal CornerRadius2 As Long, ByVal CornerRadius3 As Long, ByVal CornerRadius4 As Long) As Long

CorelScript

Description

Parameters	Description

Top	Description of Top goes here

Left	Description of Left goes here

Bottom	Description of Bottom goes here

Right	Description of Right goes here

CornerRadius	Description of CornerRadius goes here

CornerRadius2	Description of CornerRadius2 goes here

CornerRadius3	Description of CornerRadius3 goes here

CornerRadius4	Description of CornerRadius4 goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateSpiral

Function CreateSpiral(ByVal Top As Long, ByVal Left As Long, ByVal Bottom As Long, ByVal Right As Long, ByVal NumRevolutions As Long, ByVal SpiralType As Long, ByVal GrowthRate As Long) As Long

CorelScript

Description

Parameters	Description

Top	Description of Top goes here

Left	Description of Left goes here

Bottom	Description of Bottom goes here

Right	Description of Right goes here

NumRevolutions	Description of NumRevolutions goes here

SpiralType	Description of SpiralType goes here

GrowthRate	Description of GrowthRate goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateSymPolygon

Function CreateSymPolygon(ByVal Top As Long, ByVal Left As Long, ByVal Bottom As Long, ByVal Right As Long, ByVal Sides As Long, ByVal Subpaths As Long, ByVal Complexity As Long, ByVal Star As Boolean, ByVal StarComplexity As Long, ByVal MaxComplexity As Long) As Long

CorelScript

Description

Parameters	Description

Top	Description of Top goes here

Left	Description of Left goes here

Bottom	Description of Bottom goes here

Right	Description of Right goes here

Sides	Description of Sides goes here

Subpaths	Description of Subpaths goes here

Complexity	Description of Complexity goes here

Star	Description of Star goes here

StarComplexity	Description of StarComplexity goes here

MaxComplexity	Description of MaxComplexity goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CreateTextString

Function CreateTextString(ByVal Top As Long, ByVal Left As Long, ByVal Bottom As Long, ByVal Right As Long, ByVal Text As String) As Long

CorelScript

Description

Parameters	Description

Top	Description of Top goes here

Left	Description of Left goes here

Bottom	Description of Bottom goes here

Right	Description of Right goes here

Text	Description of Text goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.CutToClipboard

Function CutToClipboard() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DefineObjectDataField

Function DefineObjectDataField(ByVal FieldName As String, ByVal Format As String, ByVal DrawDefault As Boolean, ByVal DocDefault As Boolean, ByVal SummarizeGroup As Boolean) As Long

CorelScript

Description

Parameters	Description

FieldName	Description of FieldName goes here

Format	Description of Format goes here

DrawDefault	Description of DrawDefault goes here

DocDefault	Description of DocDefault goes here

SummarizeGroup	Description of SummarizeGroup goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DeleteGuidelineByIndex

Function DeleteGuidelineByIndex(ByVal Index As Long) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DeleteGuidelineUsingAngle

Function DeleteGuidelineUsingAngle(ByVal IntersectX As Long, ByVal IntersectY As Long, ByVal Angle As Long) As Boolean

CorelScript

Description

Parameters	Description

IntersectX	Description of IntersectX goes here

IntersectY	Description of IntersectY goes here

Angle	Description of Angle goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DeleteGuidelineUsingTwoPoints

Function DeleteGuidelineUsingTwoPoints(ByVal Point1X As Long, ByVal Point1Y As Long, ByVal Point2X As Long, ByVal Point2Y As Long) As Boolean

CorelScript

Description

Parameters	Description

Point1X	Description of Point1X goes here

Point1Y	Description of Point1Y goes here

Point2X	Description of Point2X goes here

Point2Y	Description of Point2Y goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DeleteLayer

Function DeleteLayer(ByVal LayerName As String) As Long

CorelScript

Description

Parameters	Description

LayerName	Description of LayerName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DeleteNode

Function DeleteNode() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DeleteObject

Function DeleteObject() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DeleteObjectDataField

Function DeleteObjectDataField(ByVal FieldName As String) As Long

CorelScript

Description

Parameters	Description

FieldName	Description of FieldName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DeletePages

Function DeletePages(ByVal UnusedParameter As Boolean, ByVal NumberOfPages As Long, ByVal StartPageNumber As Long) As Long

CorelScript

Description

Parameters	Description

UnusedParameter	Description of UnusedParameter goes here

NumberOfPages	Description of NumberOfPages goes here

StartPageNumber	Description of StartPageNumber goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DeletePaletteColor

Function DeletePaletteColor(ByVal Index As Long) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DeleteStyle

Function DeleteStyle(ByVal Style As String) As Long

CorelScript

Description

Parameters	Description

Style	Description of Style goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DetachBlendPath

Function DetachBlendPath() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DisplayFacingPages

Function DisplayFacingPages(ByVal FacingPages As Boolean, ByVal LeftFirst As Boolean) As Long

CorelScript

Description

Parameters	Description

FacingPages	Description of FacingPages goes here

LeftFirst	Description of LeftFirst goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DistributeObjects

Function DistributeObjects(ByVal HorizontalDistribution As Long, ByVal VerticalDistribution As Long, ByVal ObjectOrPageExtents As Long) As Long

CorelScript

Description

Parameters	Description

HorizontalDistribution	Description of HorizontalDistribution goes here

VerticalDistribution	Description of VerticalDistribution goes here

ObjectOrPageExtents	Description of ObjectOrPageExtents goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DrawCurveClosePath

Function DrawCurveClosePath() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DrawCurveCurveTo

Function DrawCurveCurveTo(ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal XEnd As Long, ByVal YEnd As Long) As Long

CorelScript

Description

Parameters	Description

x1	Description of x1 goes here

y1	Description of y1 goes here

x2	Description of x2 goes here

y2	Description of y2 goes here

XEnd	Description of XEnd goes here

YEnd	Description of YEnd goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DrawCurveLineTo

Function DrawCurveLineTo(ByVal X As Long, ByVal Y As Long) As Long

CorelScript

Description

Parameters	Description

X	Description of X goes here

Y	Description of Y goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DrawCurveMoveTo

Function DrawCurveMoveTo(ByVal X As Long, ByVal Y As Long) As Long

CorelScript

Description

Parameters	Description

X	Description of X goes here

Y	Description of Y goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DropSymbol

Function DropSymbol(ByVal SymbolLibrary As String, ByVal SymbolNumber As Long, ByVal Tile As Boolean, ByVal XPosOrGridSize As Long, ByVal YPosOrGridSize As Long, ByVal ProportionalSizing As Boolean, ByVal SymbolSize As Long) As Long

CorelScript

Description

Parameters	Description

SymbolLibrary	Description of SymbolLibrary goes here

SymbolNumber	Description of SymbolNumber goes here

Tile	Description of Tile goes here

XPosOrGridSize	Description of XPosOrGridSize goes here

YPosOrGridSize	Description of YPosOrGridSize goes here

ProportionalSizing	Description of ProportionalSizing goes here

SymbolSize	Description of SymbolSize goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.DuplicateObject

Function DuplicateObject(ByVal XOffset As Long, ByVal YOffset As Long) As Long

CorelScript

Description

Parameters	Description

XOffset	Description of XOffset goes here

YOffset	Description of YOffset goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.EditAngleDimensionLabel

Function EditAngleDimensionLabel(ByVal Dynamic As Boolean, ByVal Precision As Integer, ByVal Units As Integer, ByVal ShowUnits As Boolean, ByVal Prefix As String, ByVal Suffix As String) As Long

CorelScript

Description

Parameters	Description

Dynamic	Description of Dynamic goes here

Precision	Description of Precision goes here

Units	Description of Units goes here

ShowUnits	Description of ShowUnits goes here

Prefix	Description of Prefix goes here

Suffix	Description of Suffix goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.EditDimensionLabel

Function EditDimensionLabel(ByVal Placement As Integer, ByVal Horizontal As Boolean, ByVal Center As Boolean, ByVal Dynamic As Boolean, ByVal Style As Integer, ByVal Precision As Integer, ByVal Units As Integer, ByVal ShowUnits As Boolean, ByVal Prefix As String, ByVal Suffix As String) As Long

CorelScript

Description

Parameters	Description

Placement	Description of Placement goes here

Horizontal	Description of Horizontal goes here

Center	Description of Center goes here

Dynamic	Description of Dynamic goes here

Style	Description of Style goes here

Precision	Description of Precision goes here

Units	Description of Units goes here

ShowUnits	Description of ShowUnits goes here

Prefix	Description of Prefix goes here

Suffix	Description of Suffix goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.EditLayer

Function EditLayer(ByVal LayerName As String, ByVal PageNum As Long, ByVal NewName As String, ByVal Visible As Boolean, ByVal Printable As Boolean, ByVal Locked As Boolean, ByVal Master As Boolean, ByVal WireOverride As Boolean, ByVal ChangeColor As Boolean) As Long

CorelScript

Description

Parameters	Description

LayerName	Description of LayerName goes here

PageNum	Description of PageNum goes here

NewName	Description of NewName goes here

Visible	Description of Visible goes here

Printable	Description of Printable goes here

Locked	Description of Locked goes here

Master	Description of Master goes here

WireOverride	Description of WireOverride goes here

ChangeColor	Description of ChangeColor goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.EditObjectCommand

Function EditObjectCommand(ByVal Cmd As Long, ByVal X As Long, ByVal Y As Long, ByVal key As Long, ByVal AddToSelection As Boolean) As Long

CorelScript

Description

Parameters	Description

Cmd	Description of Cmd goes here

X	Description of X goes here

Y	Description of Y goes here

key	Description of key goes here

AddToSelection	Description of AddToSelection goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.EndCommandGroup

Function EndCommandGroup() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.EndDrawArrow

Function EndDrawArrow() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.EndDrawBezier

Function EndDrawBezier() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.EndDrawCurve

Function EndDrawCurve() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.EndDrawFreehand

Function EndDrawFreehand(ByVal StraightTightness As Long, ByVal CurveTightness As Long, ByVal CornerThreshold As Long, ByVal SnapTightness As Long) As Long

CorelScript

Description

Parameters	Description

StraightTightness	Description of StraightTightness goes here

CurveTightness	Description of CurveTightness goes here

CornerThreshold	Description of CornerThreshold goes here

SnapTightness	Description of SnapTightness goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.EndEditObject

Function EndEditObject() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.EndOfRecording

Function EndOfRecording() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ExtractContents

Function ExtractContents() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ExtractText

Function ExtractText(ByVal DestinationFile As String) As Boolean

CorelScript

Description

Parameters	Description

DestinationFile	Description of DestinationFile goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.FileClose

Function FileClose(ByVal PromptUser As Boolean) As Boolean

CorelScript

Description

Parameters	Description

PromptUser	Description of PromptUser goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.FileExit

Function FileExit(ByVal PromptUser As Boolean) As Boolean

CorelScript

Description

Parameters	Description

PromptUser	Description of PromptUser goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.FileExport

Function FileExport(ByVal FileName As String, ByVal FilterID As Long, ByVal Width As Long, ByVal Height As Long, ByVal XResolution As Long, ByVal YResolution As Long, ByVal ImageType As Long, ByVal AntiAliasing As Long, ByVal Overwrite As Boolean, ByVal SelectionOnly As Boolean) As Long

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

FilterID	Description of FilterID goes here

Width	Description of Width goes here

Height	Description of Height goes here

XResolution	Description of XResolution goes here

YResolution	Description of YResolution goes here

ImageType	Description of ImageType goes here

AntiAliasing	Description of AntiAliasing goes here

Overwrite	Description of Overwrite goes here

SelectionOnly	Description of SelectionOnly goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.FileImport

Function FileImport(ByVal FileName As String, ByVal FilterID As Long, ByVal MaintainLayersAndPages As Boolean) As Long

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

FilterID	Description of FilterID goes here

MaintainLayersAndPages	Description of MaintainLayersAndPages goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.FileNew

Function FileNew() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.FileOpen

Function FileOpen(ByVal FileName As String) As Long

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.FilePrint

Function FilePrint() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.FileSave

Function FileSave(ByVal FileName As String, ByVal ThumbnailSize As Long, ByVal SaveSelectedOnly As Boolean, ByVal FileVersion As Long, ByVal IncludeCMXData As Boolean) As Long

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

ThumbnailSize	Description of ThumbnailSize goes here

SaveSelectedOnly	Description of SaveSelectedOnly goes here

FileVersion	Description of FileVersion goes here

IncludeCMXData	Description of IncludeCMXData goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.FindNextObjectOfStyle

Function FindNextObjectOfStyle() As Boolean

CorelScript

Description

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.FindObjectOfStyle

Function FindObjectOfStyle(ByVal StyleName As String) As Boolean

CorelScript

Description

Parameters	Description

StyleName	Description of StyleName goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.FitTextToPath

Function FitTextToPath(ByVal TextOrientation As Long, ByVal VertAlign As Long, ByVal HorizAlign As Long, ByVal CurveSideToFit As Long, ByVal FitOtherSide As Boolean, ByVal HorizOffset As Long, ByVal DistFromPath As Long) As Long

CorelScript

Description

Parameters	Description

TextOrientation	Description of TextOrientation goes here

VertAlign	Description of VertAlign goes here

HorizAlign	Description of HorizAlign goes here

CurveSideToFit	Description of CurveSideToFit goes here

FitOtherSide	Description of FitOtherSide goes here

HorizOffset	Description of HorizOffset goes here

DistFromPath	Description of DistFromPath goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.FuseBlend

Function FuseBlend(ByVal End As Boolean, ByVal PositionX As Long, ByVal PositionY As Long) As Long

CorelScript

Description

Parameters	Description

End	Description of End goes here

PositionX	Description of PositionX goes here

PositionY	Description of PositionY goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetBitmapResolution

Function GetBitmapResolution(ByRef XRes As Long, ByRef YRes As Long) As Long

CorelScript

Description

Parameters	Description

XRes	Description of XRes goes here

YRes	Description of YRes goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetBitmapSize

Function GetBitmapSize(ByRef Width As Long, ByRef Height As Long) As Long

CorelScript

Description

Parameters	Description

Width	Description of Width goes here

Height	Description of Height goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCDRFileCompRatio

Function GetCDRFileCompRatio(ByVal FileName As String) As Long

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCDRFileKeywords

Function GetCDRFileKeywords(ByVal FileName As String) As String

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

Return value

Returns String

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCDRFileLastSavedBy

Function GetCDRFileLastSavedBy(ByVal FileName As String) As String

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

Return value

Returns String

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCDRFileNotes

Function GetCDRFileNotes(ByVal FileName As String) As String

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

Return value

Returns String

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCDRFileThumbnail

Function GetCDRFileThumbnail(ByVal CDRFileName As String, ByVal BMPFileName As String) As Long

CorelScript

Description

Parameters	Description

CDRFileName	Description of CDRFileName goes here

BMPFileName	Description of BMPFileName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCDRFileVersion

Function GetCDRFileVersion(ByVal FileName As String) As Long

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetColor

Function GetColor(ByVal StoreColor As Boolean, ByRef ColorModel As Long, ByRef V1 As Long, ByRef V2 As Long, ByRef V3 As Long, ByRef V4 As Long, ByRef V5 As Long, ByRef V6 As Long, ByRef V7 As Long) As Long

CorelScript

Description

Parameters	Description

StoreColor	Description of StoreColor goes here

ColorModel	Description of ColorModel goes here

V1	Description of V1 goes here

V2	Description of V2 goes here

V3	Description of V3 goes here

V4	Description of V4 goes here

V5	Description of V5 goes here

V6	Description of V6 goes here

V7	Description of V7 goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCurrentPageName

Function GetCurrentPageName() As String

CorelScript

Description

Return value

Returns String

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCurrentPageOrientation

Function GetCurrentPageOrientation() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCurrentPageSize

Function GetCurrentPageSize(ByRef Width As Long, ByRef Height As Long) As Long

CorelScript

Description

Parameters	Description

Width	Description of Width goes here

Height	Description of Height goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCurrentPaletteName

Function GetCurrentPaletteName() As String

CorelScript

Description

Return value

Returns String

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCurrentWorkspaceName

Function GetCurrentWorkspaceName() As String

CorelScript

Description

Return value

Returns String

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCurveClose

Function GetCurveClose() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCurveFirstNodePosition

Function GetCurveFirstNodePosition(ByRef X As Long, ByRef Y As Long) As Long

CorelScript

Description

Parameters	Description

X	Description of X goes here

Y	Description of Y goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCurveIthNodePosition

Function GetCurveIthNodePosition(ByVal Index As Long, ByRef X As Long, ByRef Y As Long) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

X	Description of X goes here

Y	Description of Y goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCurveLastNodePosition

Function GetCurveLastNodePosition(ByRef X As Long, ByRef Y As Long) As Long

CorelScript

Description

Parameters	Description

X	Description of X goes here

Y	Description of Y goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCurveLength

Function GetCurveLength() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCurveNodeCount

Function GetCurveNodeCount() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetCurveSubpathCount

Function GetCurveSubpathCount() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetDocumentCount

Function GetDocumentCount() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetDocumentName

Function GetDocumentName() As String

CorelScript

Description

Return value

Returns String

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetEllipseClockwise

Function GetEllipseClockwise() As Boolean

CorelScript

Description

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetEllipseEndAngle

Function GetEllipseEndAngle() As Double

CorelScript

Description

Return value

Returns Double

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetEllipseStartAngle

Function GetEllipseStartAngle() As Double

CorelScript

Description

Return value

Returns Double

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetEllipseType

Function GetEllipseType() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetFillType

Function GetFillType() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetFountainFill

Function GetFountainFill(ByRef Type As Long, ByRef CenterX As Long, ByRef CenterY As Long, ByRef Angle As Long, ByRef Steps As Long, ByRef Padding As Long, ByRef Blend As Long, ByRef Rate As Long, ByRef NumColors As Long) As Long

CorelScript

Description

Parameters	Description

Type	Description of Type goes here

CenterX	Description of CenterX goes here

CenterY	Description of CenterY goes here

Angle	Description of Angle goes here

Steps	Description of Steps goes here

Padding	Description of Padding goes here

Blend	Description of Blend goes here

Rate	Description of Rate goes here

NumColors	Description of NumColors goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetFountainFillColor

Function GetFountainFillColor(ByVal Index As Long, ByRef Position As Long, ByRef ColorModel As Long, ByRef V1 As Long, ByRef V2 As Long, ByRef V3 As Long, ByRef V4 As Long, ByRef V5 As Long, ByRef V6 As Long, ByRef Density As Long) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

Position	Description of Position goes here

ColorModel	Description of ColorModel goes here

V1	Description of V1 goes here

V2	Description of V2 goes here

V3	Description of V3 goes here

V4	Description of V4 goes here

V5	Description of V5 goes here

V6	Description of V6 goes here

Density	Description of Density goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetGuidelineInformation

Function GetGuidelineInformation(ByVal Index As Long, ByRef Point1X As Long, ByRef Point1Y As Long, ByRef Point2X As Long, ByRef Point2Y As Long, ByRef InterceptX As Long, ByRef InterceptY As Long, ByRef Angle As Long, ByRef Locked As Boolean) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

Point1X	Description of Point1X goes here

Point1Y	Description of Point1Y goes here

Point2X	Description of Point2X goes here

Point2Y	Description of Point2Y goes here

InterceptX	Description of InterceptX goes here

InterceptY	Description of InterceptY goes here

Angle	Description of Angle goes here

Locked	Description of Locked goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetNodeIndex

Function GetNodeIndex(ByVal Position As Long) As Long

CorelScript

Description

Parameters	Description

Position	Description of Position goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetNodePosition

Function GetNodePosition(ByRef X As Long, ByRef Y As Long, ByVal Position As Long) As Long

CorelScript

Description

Parameters	Description

X	Description of X goes here

Y	Description of Y goes here

Position	Description of Position goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetNodeSelectedCount

Function GetNodeSelectedCount() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetNodeType

Function GetNodeType() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetNumberOfGuidelines

Function GetNumberOfGuidelines() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetObjectCount

Function GetObjectCount(ByVal Selection As Boolean, ByVal Grouped As Boolean) As Long

CorelScript

Description

Parameters	Description

Selection	Description of Selection goes here

Grouped	Description of Grouped goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetObjectData

Function GetObjectData(ByVal FieldName As String) As String

CorelScript

Description

Parameters	Description

FieldName	Description of FieldName goes here

Return value

Returns String

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetObjectID

Function GetObjectID(ByVal Index As Long, ByVal Selection As Boolean, ByVal Grouped As Boolean) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

Selection	Description of Selection goes here

Grouped	Description of Grouped goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetObjectsCDRStaticID

Function GetObjectsCDRStaticID() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetObjectType

Function GetObjectType() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetOutline

Function GetOutline(ByRef Width As Long, ByRef Type As Long, ByRef EndCaps As Long, ByRef JoinType As Long, ByRef Aspect As Long, ByRef Angle As Long, ByRef DotDash As Long, ByRef RightArrow As Long, ByRef LeftArrow As Long, ByRef BehindFill As Boolean, ByRef ScalePen As Boolean) As Long

CorelScript

Description

Parameters	Description

Width	Description of Width goes here

Type	Description of Type goes here

EndCaps	Description of EndCaps goes here

JoinType	Description of JoinType goes here

Aspect	Description of Aspect goes here

Angle	Description of Angle goes here

DotDash	Description of DotDash goes here

RightArrow	Description of RightArrow goes here

LeftArrow	Description of LeftArrow goes here

BehindFill	Description of BehindFill goes here

ScalePen	Description of ScalePen goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetOutlineColor

Function GetOutlineColor(ByRef ColorModel As Long, ByRef V1 As Long, ByRef V2 As Long, ByRef V3 As Long, ByRef V4 As Long, ByRef V5 As Long, ByRef V6 As Long, ByRef Density As Long) As Long

CorelScript

Description

Parameters	Description

ColorModel	Description of ColorModel goes here

V1	Description of V1 goes here

V2	Description of V2 goes here

V3	Description of V3 goes here

V4	Description of V4 goes here

V5	Description of V5 goes here

V6	Description of V6 goes here

Density	Description of Density goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetPageCount

Function GetPageCount() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetPageSize

Function GetPageSize(ByRef Width As Long, ByRef Height As Long) As Long

CorelScript

Description

Parameters	Description

Width	Description of Width goes here

Height	Description of Height goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetPaletteColor

Function GetPaletteColor(ByVal Index As Long, ByRef ColorModel As Long, ByRef V1 As Long, ByRef V2 As Long, ByRef V3 As Long, ByRef V4 As Long, ByRef V5 As Long, ByRef V6 As Long, ByRef V7 As Long) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

ColorModel	Description of ColorModel goes here

V1	Description of V1 goes here

V2	Description of V2 goes here

V3	Description of V3 goes here

V4	Description of V4 goes here

V5	Description of V5 goes here

V6	Description of V6 goes here

V7	Description of V7 goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetPaletteColorCount

Function GetPaletteColorCount() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetPaletteColorName

Function GetPaletteColorName(ByVal Index As Long) As String

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

Return value

Returns String

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetPolygonSharpness

Function GetPolygonSharpness() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetPolygonSides

Function GetPolygonSides() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetPolygonType

Function GetPolygonType() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetPosition

Function GetPosition(ByRef XPos As Long, ByRef YPos As Long) As Long

CorelScript

Description

Parameters	Description

XPos	Description of XPos goes here

YPos	Description of YPos goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetRectangleRadius

Function GetRectangleRadius(ByRef Radius1 As Double, ByRef Radius2 As Double, ByRef Radius3 As Double, ByRef Radius4 As Double) As Long

CorelScript

Description

Parameters	Description

Radius1	Description of Radius1 goes here

Radius2	Description of Radius2 goes here

Radius3	Description of Radius3 goes here

Radius4	Description of Radius4 goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetSegmentLength

Function GetSegmentLength() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetSegmentType

Function GetSegmentType() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetSize

Function GetSize(ByRef XSize As Long, ByRef YSize As Long) As Long

CorelScript

Description

Parameters	Description

XSize	Description of XSize goes here

YSize	Description of YSize goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetTextFontName

Function GetTextFontName() As String

CorelScript

Description

Return value

Returns String

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetTextFontSize

Function GetTextFontSize() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetTextString

Function GetTextString() As String

CorelScript

Description

Return value

Returns String

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetTextWordCount

Function GetTextWordCount() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetUniformFillColor

Function GetUniformFillColor(ByRef ColorModel As Long, ByRef V1 As Long, ByRef V2 As Long, ByRef V3 As Long, ByRef V4 As Long, ByRef V5 As Long, ByRef V6 As Long, ByRef Density As Long) As Long

CorelScript

Description

Parameters	Description

ColorModel	Description of ColorModel goes here

V1	Description of V1 goes here

V2	Description of V2 goes here

V3	Description of V3 goes here

V4	Description of V4 goes here

V5	Description of V5 goes here

V6	Description of V6 goes here

Density	Description of Density goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetUserClick

Function GetUserClick(ByRef XCoord As Long, ByRef YCoord As Long, ByVal TimeOut As Long, ByVal IgnoreSnap As Boolean) As Long

CorelScript

Description

Parameters	Description

XCoord	Description of XCoord goes here

YCoord	Description of YCoord goes here

TimeOut	Description of TimeOut goes here

IgnoreSnap	Description of IgnoreSnap goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetUserDataField

Function GetUserDataField(ByVal FieldName As String) As String

CorelScript

Description

Parameters	Description

FieldName	Description of FieldName goes here

Return value

Returns String

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetWorkspaceCount

Function GetWorkspaceCount() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetWorkspaceDescription

Function GetWorkspaceDescription(ByVal Name As String) As String

CorelScript

Description

Parameters	Description

Name	Description of Name goes here

Return value

Returns String

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.GetWorkspaceName

Function GetWorkspaceName(ByVal Index As Long) As String

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

Return value

Returns String

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.Group

Function Group() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.InflateBitmap

Function InflateBitmap(ByVal Width As Long, ByVal Height As Long, ByVal InflationType As Long) As Long

CorelScript

Description

Parameters	Description

Width	Description of Width goes here

Height	Description of Height goes here

InflationType	Description of InflationType goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.InitBezierTool

Function InitBezierTool() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.InsertOLEObject

Function InsertOLEObject(ByVal ProgID As String) As Long

CorelScript

Description

Parameters	Description

ProgID	Description of ProgID goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.InsertOLEObjectFromFile

Function InsertOLEObjectFromFile(ByVal FileName As String, ByVal CreateLink As Boolean) As Long

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

CreateLink	Description of CreateLink goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.InsertPages

Function InsertPages(ByVal BeforePage As Boolean, ByVal NumberOfPages As Long, ByVal StartPageNumber As Long) As Long

CorelScript

Description

Parameters	Description

BeforePage	Description of BeforePage goes here

NumberOfPages	Description of NumberOfPages goes here

StartPageNumber	Description of StartPageNumber goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.InsertPaletteColor

Function InsertPaletteColor(ByVal Index As Long, ByVal Name As String, ByVal ColorModel As Long, ByVal V1 As Long, ByVal V2 As Long, ByVal V3 As Long, ByVal V4 As Long, ByVal V5 As Long, ByVal V6 As Long, ByVal V7 As Long) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

Name	Description of Name goes here

ColorModel	Description of ColorModel goes here

V1	Description of V1 goes here

V2	Description of V2 goes here

V3	Description of V3 goes here

V4	Description of V4 goes here

V5	Description of V5 goes here

V6	Description of V6 goes here

V7	Description of V7 goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.Intersection

Function Intersection(ByVal LeaveTarget As Boolean, ByVal LeaveModifiers As Boolean) As Long

CorelScript

Description

Parameters	Description

LeaveTarget	Description of LeaveTarget goes here

LeaveModifiers	Description of LeaveModifiers goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.IsBitmapExternallyLinked

Function IsBitmapExternallyLinked() As Boolean

CorelScript

Description

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.IsDefaultWorkspace

Function IsDefaultWorkspace(ByVal Name As String) As Long

CorelScript

Description

Parameters	Description

Name	Description of Name goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.IsDocument

Function IsDocument() As Boolean

CorelScript

Description

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.IsSelection

Function IsSelection() As Boolean

CorelScript

Description

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.LoadPalette

Function LoadPalette(ByVal FileName As String) As Long

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.LoadStyles

Function LoadStyles(ByVal StyleSheet As String) As Long

CorelScript

Description

Parameters	Description

StyleSheet	Description of StyleSheet goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.LockGuidelineByIndex

Function LockGuidelineByIndex(ByVal Index As Long) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.MenuCommand

Function MenuCommand(ByVal MenuID As Long) As Long

CorelScript

Description

Parameters	Description

MenuID	Description of MenuID goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.MergeBackText

Function MergeBackText(ByVal SourceFile As String) As Boolean

CorelScript

Description

Parameters	Description

SourceFile	Description of SourceFile goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.MoveBezierControl

Function MoveBezierControl(ByVal X As Long, ByVal Y As Long, ByVal Constrain As Boolean) As Long

CorelScript

Description

Parameters	Description

X	Description of X goes here

Y	Description of Y goes here

Constrain	Description of Constrain goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.MoveCenter

Function MoveCenter(ByVal AnchorID As Long, ByVal XOffset As Long, ByVal YOffset As Long) As Long

CorelScript

Description

Parameters	Description

AnchorID	Description of AnchorID goes here

XOffset	Description of XOffset goes here

YOffset	Description of YOffset goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.MoveGuidelineUsingAngleByIndex

Function MoveGuidelineUsingAngleByIndex(ByVal Index As Long, ByVal InterceptX As Long, ByVal InterceptY As Long, ByVal Angle As Long, ByVal Locked As Boolean) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

InterceptX	Description of InterceptX goes here

InterceptY	Description of InterceptY goes here

Angle	Description of Angle goes here

Locked	Description of Locked goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.MoveGuidelineUsingTwoPointsByIndex

Function MoveGuidelineUsingTwoPointsByIndex(ByVal Index As Long, ByVal Point1X As Long, ByVal Point1Y As Long, ByVal Point2X As Long, ByVal Point2Y As Long, ByVal Locked As Boolean) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

Point1X	Description of Point1X goes here

Point1Y	Description of Point1Y goes here

Point2X	Description of Point2X goes here

Point2Y	Description of Point2Y goes here

Locked	Description of Locked goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.MoveLayerTo

Function MoveLayerTo(ByVal DestLayer As String, ByVal BeforeDest As Boolean) As Long

CorelScript

Description

Parameters	Description

DestLayer	Description of DestLayer goes here

BeforeDest	Description of BeforeDest goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.MoveNode

Function MoveNode(ByVal DeltaX As Long, ByVal DeltaY As Long) As Long

CorelScript

Description

Parameters	Description

DeltaX	Description of DeltaX goes here

DeltaY	Description of DeltaY goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.MoveObject

Function MoveObject(ByVal XDelta As Long, ByVal YDelta As Long) As Long

CorelScript

Description

Parameters	Description

XDelta	Description of XDelta goes here

YDelta	Description of YDelta goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.MoveToLayer

Function MoveToLayer(ByVal LayerName As String) As Long

CorelScript

Description

Parameters	Description

LayerName	Description of LayerName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.NewLayer

Function NewLayer(ByVal LayerName As String) As Long

CorelScript

Description

Parameters	Description

LayerName	Description of LayerName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.OLEObjectDoVerb

Function OLEObjectDoVerb(ByVal Verb As Long) As Long

CorelScript

Description

Parameters	Description

Verb	Description of Verb goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.OrderBackOne

Function OrderBackOne() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.OrderForwardOne

Function OrderForwardOne() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.OrderObjectDataFields

Function OrderObjectDataFields(ByVal FieldToMove As Long, ByVal NewPosition As Long) As Long

CorelScript

Description

Parameters	Description

FieldToMove	Description of FieldToMove goes here

NewPosition	Description of NewPosition goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.OrderReverseOrder

Function OrderReverseOrder() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.OrderToBack

Function OrderToBack() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.OrderToFront

Function OrderToFront() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.OverprintFill

Function OverprintFill() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.OverprintOutline

Function OverprintOutline() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.PasteCustomClipboardFormat

Function PasteCustomClipboardFormat(ByVal Format As String) As Long

CorelScript

Description

Parameters	Description

Format	Description of Format goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.PasteFromClipboard

Function PasteFromClipboard() As Boolean

CorelScript

Description

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.PasteObjectData

Function PasteObjectData(ByVal Index As Long, ByVal FieldName As String) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

FieldName	Description of FieldName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.PasteSystemClipboardFormat

Function PasteSystemClipboardFormat(ByVal Format As Long) As Long

CorelScript

Description

Parameters	Description

Format	Description of Format goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.PlaceInside

Function PlaceInside(ByVal Index As Long, ByVal XDisp As Long, ByVal YDisp As Long, ByVal ForceCenter As Boolean, ByVal Center As Boolean) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

XDisp	Description of XDisp goes here

YDisp	Description of YDisp goes here

ForceCenter	Description of ForceCenter goes here

Center	Description of Center goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderApplyPerspective

Function RecorderApplyPerspective(ByVal Type As Long, ByVal Flags As Long, ByVal Box0X As Long, ByVal Box0Y As Long, ByVal Box1X As Long, ByVal Box1Y As Long, ByVal Box2X As Long, ByVal Box2Y As Long, ByVal Box3X As Long, ByVal Box3Y As Long, ByVal VPHorizRef As Long, ByVal VPHorizX As Long, ByVal VPHorizY As Long, ByVal VPVertRef As Long, ByVal VPVertX As Long, ByVal VPVertY As Long) As Long

CorelScript

Description

Parameters	Description

Type	Description of Type goes here

Flags	Description of Flags goes here

Box0X	Description of Box0X goes here

Box0Y	Description of Box0Y goes here

Box1X	Description of Box1X goes here

Box1Y	Description of Box1Y goes here

Box2X	Description of Box2X goes here

Box2Y	Description of Box2Y goes here

Box3X	Description of Box3X goes here

Box3Y	Description of Box3Y goes here

VPHorizRef	Description of VPHorizRef goes here

VPHorizX	Description of VPHorizX goes here

VPHorizY	Description of VPHorizY goes here

VPVertRef	Description of VPVertRef goes here

VPVertX	Description of VPVertX goes here

VPVertY	Description of VPVertY goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderBeginEditParaText

Function RecorderBeginEditParaText() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderBeginEditText

Function RecorderBeginEditText() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderEditParaReplaceText

Function RecorderEditParaReplaceText(ByVal String As String) As Long

CorelScript

Description

Parameters	Description

String	Description of String goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderEditParaTextChangeCase

Function RecorderEditParaTextChangeCase(ByVal CaseID As Long) As Long

CorelScript

Description

Parameters	Description

CaseID	Description of CaseID goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderEditParaTextCharAttributes

Function RecorderEditParaTextCharAttributes(ByVal FirstSelectedChar As Long, ByVal LastSelectedChar As Long, ByVal FontName As String, ByVal FontStyle As Long, ByVal PointSize As Long, ByVal Underline As Long, ByVal Overline As Long, ByVal StrikeOut As Long, ByVal Placement As Long) As Long

CorelScript

Description

Parameters	Description

FirstSelectedChar	Description of FirstSelectedChar goes here

LastSelectedChar	Description of LastSelectedChar goes here

FontName	Description of FontName goes here

FontStyle	Description of FontStyle goes here

PointSize	Description of PointSize goes here

Underline	Description of Underline goes here

Overline	Description of Overline goes here

StrikeOut	Description of StrikeOut goes here

Placement	Description of Placement goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderEditParaTextIndents

Function RecorderEditParaTextIndents(ByVal FirstSelectedChar As Long, ByVal LastSelectedChar As Long, ByVal FirstLine As Long, ByVal RestOfLines As Long, ByVal RightMargin As Long) As Long

CorelScript

Description

Parameters	Description

FirstSelectedChar	Description of FirstSelectedChar goes here

LastSelectedChar	Description of LastSelectedChar goes here

FirstLine	Description of FirstLine goes here

RestOfLines	Description of RestOfLines goes here

RightMargin	Description of RightMargin goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderEditParaTextSpacing

Function RecorderEditParaTextSpacing(ByVal FirstSelectedChar As Long, ByVal LastSelectedChar As Long, ByVal CharacterSpacing As Long, ByVal WordSpacing As Long, ByVal LineSpacing As Long, ByVal BeforeParagraph As Long, ByVal AfterParagraph As Long, ByVal Alignment As Long, ByVal AutoHyphenation As Boolean, ByVal HyphenHotZone As Long, ByVal Direction As Long) As Long

CorelScript

Description

Parameters	Description

FirstSelectedChar	Description of FirstSelectedChar goes here

LastSelectedChar	Description of LastSelectedChar goes here

CharacterSpacing	Description of CharacterSpacing goes here

WordSpacing	Description of WordSpacing goes here

LineSpacing	Description of LineSpacing goes here

BeforeParagraph	Description of BeforeParagraph goes here

AfterParagraph	Description of AfterParagraph goes here

Alignment	Description of Alignment goes here

AutoHyphenation	Description of AutoHyphenation goes here

HyphenHotZone	Description of HyphenHotZone goes here

Direction	Description of Direction goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderEditReplaceText

Function RecorderEditReplaceText(ByVal String As String) As Long

CorelScript

Description

Parameters	Description

String	Description of String goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderEditTextChangeCase

Function RecorderEditTextChangeCase(ByVal CaseID As Long) As Long

CorelScript

Description

Parameters	Description

CaseID	Description of CaseID goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderEditTextCharAttributes

Function RecorderEditTextCharAttributes(ByVal FirstSelectedChar As Long, ByVal LastSelectedChar As Long, ByVal FontName As String, ByVal FontStyle As Long, ByVal PointSize As Long, ByVal Underline As Long, ByVal Overline As Long, ByVal StrikeOut As Long, ByVal Placement As Long, ByVal Effect As Long, ByVal CharacterSpacing As Long, ByVal WordSpacing As Long, ByVal LineSpacing As Long, ByVal Alignment As Long, ByVal Direction As Long) As Long

CorelScript

Description

Parameters	Description

FirstSelectedChar	Description of FirstSelectedChar goes here

LastSelectedChar	Description of LastSelectedChar goes here

FontName	Description of FontName goes here

FontStyle	Description of FontStyle goes here

PointSize	Description of PointSize goes here

Underline	Description of Underline goes here

Overline	Description of Overline goes here

StrikeOut	Description of StrikeOut goes here

Placement	Description of Placement goes here

Effect	Description of Effect goes here

CharacterSpacing	Description of CharacterSpacing goes here

WordSpacing	Description of WordSpacing goes here

LineSpacing	Description of LineSpacing goes here

Alignment	Description of Alignment goes here

Direction	Description of Direction goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderEndEditParaText

Function RecorderEndEditParaText() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderEndEditText

Function RecorderEndEditText() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderObjectScaleInfo

Function RecorderObjectScaleInfo(ByVal ScaledSizeX As Long, ByVal ScaledSizeY As Long, ByVal DisplacementX As Long, ByVal DisplacementY As Long) As Long

CorelScript

Description

Parameters	Description

ScaledSizeX	Description of ScaledSizeX goes here

ScaledSizeY	Description of ScaledSizeY goes here

DisplacementX	Description of DisplacementX goes here

DisplacementY	Description of DisplacementY goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderSelectObjectByIndex

Function RecorderSelectObjectByIndex(ByVal ClearFirst As Boolean, ByVal Index As Long) As Long

CorelScript

Description

Parameters	Description

ClearFirst	Description of ClearFirst goes here

Index	Description of Index goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderSelectObjectsByIndex

Function RecorderSelectObjectsByIndex(ByVal ClearFirst As Boolean, ByVal Index1 As Long, ByVal Index2 As Long, ByVal Index3 As Long, ByVal Index4 As Long, ByVal Index5 As Long) As Long

CorelScript

Description

Parameters	Description

ClearFirst	Description of ClearFirst goes here

Index1	Description of Index1 goes here

Index2	Description of Index2 goes here

Index3	Description of Index3 goes here

Index4	Description of Index4 goes here

Index5	Description of Index5 goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderSelectPreselectedObjects

Function RecorderSelectPreselectedObjects(ByVal ClearFirst As Boolean) As Long

CorelScript

Description

Parameters	Description

ClearFirst	Description of ClearFirst goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RecorderStorePreselectedObjects

Function RecorderStorePreselectedObjects(ByVal ConvertPreset As Boolean) As Long

CorelScript

Description

Parameters	Description

ConvertPreset	Description of ConvertPreset goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.Redo

Function Redo() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RedrawAllScreens

Function RedrawAllScreens() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RedrawScreen

Function RedrawScreen() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RegisterObject

Function RegisterObject(ByVal ObjectID As String) As Boolean

CorelScript

Description

Parameters	Description

ObjectID	Description of ObjectID goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RemoveAllGuidelines

Function RemoveAllGuidelines() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RemoveFountainFillColor

Function RemoveFountainFillColor(ByVal Position As Long) As Long

CorelScript

Description

Parameters	Description

Position	Description of Position goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RenameObjectDataField

Function RenameObjectDataField(ByVal OldFieldName As String, ByVal NewFieldName As String) As Long

CorelScript

Description

Parameters	Description

OldFieldName	Description of OldFieldName goes here

NewFieldName	Description of NewFieldName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RenameStyle

Function RenameStyle(ByVal OldName As String, ByVal NewName As String) As Long

CorelScript

Description

Parameters	Description

OldName	Description of OldName goes here

NewName	Description of NewName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.Repeat

Function Repeat() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RepeatLastCommand

Function RepeatLastCommand() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ReplacePaletteColor

Function ReplacePaletteColor(ByVal Index As Long, ByVal Name As String, ByVal ColorModel As Long, ByVal V1 As Long, ByVal V2 As Long, ByVal V3 As Long, ByVal V4 As Long, ByVal V5 As Long, ByVal V6 As Long, ByVal V7 As Long) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

Name	Description of Name goes here

ColorModel	Description of ColorModel goes here

V1	Description of V1 goes here

V2	Description of V2 goes here

V3	Description of V3 goes here

V4	Description of V4 goes here

V5	Description of V5 goes here

V6	Description of V6 goes here

V7	Description of V7 goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ResetTransfo

Function ResetTransfo() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ResolveAllBitmapsLink

Function ResolveAllBitmapsLink() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ResolveBitmapLink

Function ResolveBitmapLink() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ResumePainting

Function ResumePainting() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RevertToStyle

Function RevertToStyle() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.RotateObject

Function RotateObject(ByVal Angle As Long, ByVal UseObjectsCenter As Boolean, ByVal XCenter As Long, ByVal YCenter As Long) As Long

CorelScript

Description

Parameters	Description

Angle	Description of Angle goes here

UseObjectsCenter	Description of UseObjectsCenter goes here

XCenter	Description of XCenter goes here

YCenter	Description of YCenter goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SavePalette

Function SavePalette(ByVal FileName As String, ByVal Overwrite As Boolean) As Long

CorelScript

Description

Parameters	Description

FileName	Description of FileName goes here

Overwrite	Description of Overwrite goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SaveStyleAs

Function SaveStyleAs(ByVal Style As String, ByVal Fill As Boolean, ByVal Outline As Boolean, ByVal TypeFace As Boolean, ByVal TypeStyle As Boolean, ByVal Size As Boolean, ByVal Justify As Boolean, ByVal Tabs As Boolean, ByVal Hyphenation As Boolean, ByVal SpaceChar As Boolean, ByVal SpaceWord As Boolean, ByVal SpaceLine As Boolean, ByVal BeforePara As Boolean, ByVal AfterPara As Boolean, ByVal Underline As Boolean, ByVal Overline As Boolean, ByVal StrikeOut As Boolean, ByVal BulletIndent As Boolean, ByVal FirstLineIndent As Boolean, ByVal RestOfLinesIndent As Boolean, ByVal RightMargin As Boolean, ByVal SuperOrSubScript As Boolean, ByVal Capitalize As Boolean, ByVal Bullet As Boolean) As Long

CorelScript

Description

Parameters	Description

Style	Description of Style goes here

Fill	Description of Fill goes here

Outline	Description of Outline goes here

TypeFace	Description of TypeFace goes here

TypeStyle	Description of TypeStyle goes here

Size	Description of Size goes here

Justify	Description of Justify goes here

Tabs	Description of Tabs goes here

Hyphenation	Description of Hyphenation goes here

SpaceChar	Description of SpaceChar goes here

SpaceWord	Description of SpaceWord goes here

SpaceLine	Description of SpaceLine goes here

BeforePara	Description of BeforePara goes here

AfterPara	Description of AfterPara goes here

Underline	Description of Underline goes here

Overline	Description of Overline goes here

StrikeOut	Description of StrikeOut goes here

BulletIndent	Description of BulletIndent goes here

FirstLineIndent	Description of FirstLineIndent goes here

RestOfLinesIndent	Description of RestOfLinesIndent goes here

RightMargin	Description of RightMargin goes here

SuperOrSubScript	Description of SuperOrSubScript goes here

Capitalize	Description of Capitalize goes here

Bullet	Description of Bullet goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SaveStyleProp

Function SaveStyleProp(ByVal StyleName As String, ByVal UseFill As Boolean, ByVal UseOutline As Boolean, ByVal UseFont As Long, ByVal UseAlignment As Long, ByVal UseSpacing As Long, ByVal UseLines As Long, ByVal UseIndentsAndMargins As Long, ByVal UseTextEffects As Long) As Long

CorelScript

Description

Parameters	Description

StyleName	Description of StyleName goes here

UseFill	Description of UseFill goes here

UseOutline	Description of UseOutline goes here

UseFont	Description of UseFont goes here

UseAlignment	Description of UseAlignment goes here

UseSpacing	Description of UseSpacing goes here

UseLines	Description of UseLines goes here

UseIndentsAndMargins	Description of UseIndentsAndMargins goes here

UseTextEffects	Description of UseTextEffects goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SaveTemplate

Function SaveTemplate(ByVal StyleSheet As String) As Long

CorelScript

Description

Parameters	Description

StyleSheet	Description of StyleSheet goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SelectAllObjects

Function SelectAllObjects() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SelectLayer

Function SelectLayer(ByVal LayerName As String) As Long

CorelScript

Description

Parameters	Description

LayerName	Description of LayerName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SelectNextNode

Function SelectNextNode() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SelectNextObject

Function SelectNextObject(ByVal SelectInsideGroup As Boolean) As Boolean

CorelScript

Description

Parameters	Description

SelectInsideGroup	Description of SelectInsideGroup goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SelectNode

Function SelectNode(ByVal Index As Long, ByVal AddToSelection As Boolean) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

AddToSelection	Description of AddToSelection goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SelectNodeAt

Function SelectNodeAt(ByVal X As Long, ByVal Y As Long, ByVal AddToSelection As Boolean) As Long

CorelScript

Description

Parameters	Description

X	Description of X goes here

Y	Description of Y goes here

AddToSelection	Description of AddToSelection goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SelectObjectAtPoint

Function SelectObjectAtPoint(ByVal XPos As Long, ByVal YPos As Long, ByVal SelectInsideGroup As Boolean) As Boolean

CorelScript

Description

Parameters	Description

XPos	Description of XPos goes here

YPos	Description of YPos goes here

SelectInsideGroup	Description of SelectInsideGroup goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SelectObjectOfCDRStaticID

Function SelectObjectOfCDRStaticID(ByVal CorelDRAWID As Long) As Boolean

CorelScript

Description

Parameters	Description

CorelDRAWID	Description of CorelDRAWID goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SelectObjectOfType

Function SelectObjectOfType(ByVal Type As Long) As Long

CorelScript

Description

Parameters	Description

Type	Description of Type goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SelectObjectsInRect

Function SelectObjectsInRect(ByVal Top As Long, ByVal Left As Long, ByVal Bottom As Long, ByVal Right As Long, ByVal IncludeIntersecting As Boolean) As Boolean

CorelScript

Description

Parameters	Description

Top	Description of Top goes here

Left	Description of Left goes here

Bottom	Description of Bottom goes here

Right	Description of Right goes here

IncludeIntersecting	Description of IncludeIntersecting goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SelectPreviousObject

Function SelectPreviousObject(ByVal SelectInsideGroup As Boolean) As Boolean

CorelScript

Description

Parameters	Description

SelectInsideGroup	Description of SelectInsideGroup goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.Separate

Function Separate() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetApplyToDuplicate

Function SetApplyToDuplicate(ByVal ApplyToDuplicate As Boolean) As Long

CorelScript

Description

Parameters	Description

ApplyToDuplicate	Description of ApplyToDuplicate goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetArtisticText

Function SetArtisticText(ByVal String As String) As Long

CorelScript

Description

Parameters	Description

String	Description of String goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetBullet

Function SetBullet(ByVal FirstSelectedChar As Long, ByVal LastSelectedChar As Long, ByVal SymbolLibrary As String, ByVal SymbolNumber As Long, ByVal PointSize As Long, ByVal BulletIndent As Long, ByVal VerticalShift As Long) As Long

CorelScript

Description

Parameters	Description

FirstSelectedChar	Description of FirstSelectedChar goes here

LastSelectedChar	Description of LastSelectedChar goes here

SymbolLibrary	Description of SymbolLibrary goes here

SymbolNumber	Description of SymbolNumber goes here

PointSize	Description of PointSize goes here

BulletIndent	Description of BulletIndent goes here

VerticalShift	Description of VerticalShift goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetCharacterAttributes

Function SetCharacterAttributes(ByVal FirstSelectedChar As Long, ByVal LastSelectedChar As Long, ByVal FontName As String, ByVal FontStyle As Long, ByVal PointSize As Long, ByVal Underline As Long, ByVal Overline As Long, ByVal StrikeOut As Long, ByVal Placement As Long, ByVal CharacterSpacing As Long, ByVal WordSpacing As Long, ByVal LineSpacing As Long, ByVal Alignment As Long) As Long

CorelScript

Description

Parameters	Description

FirstSelectedChar	Description of FirstSelectedChar goes here

LastSelectedChar	Description of LastSelectedChar goes here

FontName	Description of FontName goes here

FontStyle	Description of FontStyle goes here

PointSize	Description of PointSize goes here

Underline	Description of Underline goes here

Overline	Description of Overline goes here

StrikeOut	Description of StrikeOut goes here

Placement	Description of Placement goes here

CharacterSpacing	Description of CharacterSpacing goes here

WordSpacing	Description of WordSpacing goes here

LineSpacing	Description of LineSpacing goes here

Alignment	Description of Alignment goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetColorOverride

Function SetColorOverride(ByVal Override As Boolean) As Long

CorelScript

Description

Parameters	Description

Override	Description of Override goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetCornerRoundness

Function SetCornerRoundness(ByVal Roundness As Long, ByVal Roundness2 As Long, ByVal Roundness3 As Long, ByVal Roundness4 As Long) As Long

CorelScript

Description

Parameters	Description

Roundness	Description of Roundness goes here

Roundness2	Description of Roundness2 goes here

Roundness3	Description of Roundness3 goes here

Roundness4	Description of Roundness4 goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetCurrentDocument

Function SetCurrentDocument() As Boolean

CorelScript

Description

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetCurrentPage

Function SetCurrentPage(ByVal CurrentPage As Long) As Long

CorelScript

Description

Parameters	Description

CurrentPage	Description of CurrentPage goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetCurrentPageName

Function SetCurrentPageName(ByVal Name As String) As Long

CorelScript

Description

Parameters	Description

Name	Description of Name goes here

Return value

Returns Long

 Related Topics


CorelScript.SetCurrentPageOrientation

Function SetCurrentPageOrientation(ByVal Orient As Long) As Long

CorelScript

Description

Parameters	Description

Orient	Description of Orient goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetCurrentPageSize

Function SetCurrentPageSize(ByVal Width As Long, ByVal Height As Long) As Long

CorelScript

Description

Parameters	Description

Width	Description of Width goes here

Height	Description of Height goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetCurrentWorkspace

Function SetCurrentWorkspace(ByVal Name As String) As Long

CorelScript

Description

Parameters	Description

Name	Description of Name goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetDocVisible

Function SetDocVisible(ByVal Show As Boolean) As Long

CorelScript

Description

Parameters	Description

Show	Description of Show goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetEllipseProperties

Function SetEllipseProperties(ByVal Arc As Boolean, ByVal StartAngle As Long, ByVal EndAngle As Long) As Long

CorelScript

Description

Parameters	Description

Arc	Description of Arc goes here

StartAngle	Description of StartAngle goes here

EndAngle	Description of EndAngle goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetErrorHandling

Function SetErrorHandling(ByVal Msg As Boolean) As Boolean

CorelScript

Description

Parameters	Description

Msg	Description of Msg goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetFrameColumn

Function SetFrameColumn(ByVal ColumnNumber As Long, ByVal Width As Long, ByVal GutterWidth As Long) As Long

CorelScript

Description

Parameters	Description

ColumnNumber	Description of ColumnNumber goes here

Width	Description of Width goes here

GutterWidth	Description of GutterWidth goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetFullScreenPreview

Function SetFullScreenPreview(ByVal FullScreen As Boolean) As Long

CorelScript

Description

Parameters	Description

FullScreen	Description of FullScreen goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetIndents

Function SetIndents(ByVal FirstSelectedChar As Long, ByVal LastSelectedChar As Long, ByVal FirstLine As Long, ByVal RestOfLines As Long, ByVal RightMargin As Long) As Long

CorelScript

Description

Parameters	Description

FirstSelectedChar	Description of FirstSelectedChar goes here

LastSelectedChar	Description of LastSelectedChar goes here

FirstLine	Description of FirstLine goes here

RestOfLines	Description of RestOfLines goes here

RightMargin	Description of RightMargin goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetLayerLocked

Function SetLayerLocked(ByVal Locked As Boolean, ByVal LayerName As String, ByVal PageNum As Long) As Long

CorelScript

Description

Parameters	Description

Locked	Description of Locked goes here

LayerName	Description of LayerName goes here

PageNum	Description of PageNum goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetLayerPrintable

Function SetLayerPrintable(ByVal Printable As Boolean, ByVal LayerName As String, ByVal PageNum As Long) As Long

CorelScript

Description

Parameters	Description

Printable	Description of Printable goes here

LayerName	Description of LayerName goes here

PageNum	Description of PageNum goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetLayerVisible

Function SetLayerVisible(ByVal Visible As Boolean, ByVal LayerName As String, ByVal PageNum As Long) As Long

CorelScript

Description

Parameters	Description

Visible	Description of Visible goes here

LayerName	Description of LayerName goes here

PageNum	Description of PageNum goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetMultiLayer

Function SetMultiLayer(ByVal MultiLayer As Boolean) As Long

CorelScript

Description

Parameters	Description

MultiLayer	Description of MultiLayer goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetNodeType

Function SetNodeType(ByVal Type As Long) As Long

CorelScript

Description

Parameters	Description

Type	Description of Type goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetObjectData

Function SetObjectData(ByVal FieldName As String, ByVal FieldValue As String) As Long

CorelScript

Description

Parameters	Description

FieldName	Description of FieldName goes here

FieldValue	Description of FieldValue goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetOptionsForAllPages

Function SetOptionsForAllPages(ByVal AllPages As Boolean) As Long

CorelScript

Description

Parameters	Description

AllPages	Description of AllPages goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetOutlineArrow

Function SetOutlineArrow(ByVal ArrowType As Long) As Long

CorelScript

Description

Parameters	Description

ArrowType	Description of ArrowType goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetOutlineColor

Function SetOutlineColor() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetOutlineMiscProperties

Function SetOutlineMiscProperties(ByVal Type As Long, ByVal Style As Long, ByVal Corners As Long, ByVal LineCaps As Long, ByVal Aspect As Long, ByVal Angle As Long, ByVal BehindFill As Boolean, ByVal ScalePen As Boolean) As Long

CorelScript

Description

Parameters	Description

Type	Description of Type goes here

Style	Description of Style goes here

Corners	Description of Corners goes here

LineCaps	Description of LineCaps goes here

Aspect	Description of Aspect goes here

Angle	Description of Angle goes here

BehindFill	Description of BehindFill goes here

ScalePen	Description of ScalePen goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetOutlineWidth

Function SetOutlineWidth(ByVal Width As Long) As Long

CorelScript

Description

Parameters	Description

Width	Description of Width goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetPageLayout

Function SetPageLayout(ByVal LayoutType As Long) As Long

CorelScript

Description

Parameters	Description

LayoutType	Description of LayoutType goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetPageOrientation

Function SetPageOrientation(ByVal Orient As Long) As Long

CorelScript

Description

Parameters	Description

Orient	Description of Orient goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetPageSize

Function SetPageSize(ByVal Width As Long, ByVal Height As Long) As Long

CorelScript

Description

Parameters	Description

Width	Description of Width goes here

Height	Description of Height goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetPageSizeFromPrinter

Function SetPageSizeFromPrinter() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetPaperColor

Function SetPaperColor() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetParagraphSpacing

Function SetParagraphSpacing(ByVal FirstSelectedChar As Long, ByVal LastSelectedChar As Long, ByVal CharacterSpacing As Long, ByVal WordSpacing As Long, ByVal LineSpacing As Long, ByVal BeforeParagraph As Long, ByVal AfterParagraph As Long, ByVal Alignment As Long, ByVal AutoHyphenation As Boolean, ByVal HyphenHotZone As Long) As Long

CorelScript

Description

Parameters	Description

FirstSelectedChar	Description of FirstSelectedChar goes here

LastSelectedChar	Description of LastSelectedChar goes here

CharacterSpacing	Description of CharacterSpacing goes here

WordSpacing	Description of WordSpacing goes here

LineSpacing	Description of LineSpacing goes here

BeforeParagraph	Description of BeforeParagraph goes here

AfterParagraph	Description of AfterParagraph goes here

Alignment	Description of Alignment goes here

AutoHyphenation	Description of AutoHyphenation goes here

HyphenHotZone	Description of HyphenHotZone goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetPolygonProperties

Function SetPolygonProperties(ByVal Star As Boolean, ByVal Points As Long, ByVal Sharpness As Long) As Long

CorelScript

Description

Parameters	Description

Star	Description of Star goes here

Points	Description of Points goes here

Sharpness	Description of Sharpness goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetPosition

Function SetPosition(ByVal XPos As Long, ByVal YPos As Long) As Long

CorelScript

Description

Parameters	Description

XPos	Description of XPos goes here

YPos	Description of YPos goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetReferencePoint

Function SetReferencePoint(ByVal ReferencePoint As Long) As Long

CorelScript

Description

Parameters	Description

ReferencePoint	Description of ReferencePoint goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetSegmentType

Function SetSegmentType(ByVal Type As Long) As Long

CorelScript

Description

Parameters	Description

Type	Description of Type goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetSize

Function SetSize(ByVal XSize As Long, ByVal YSize As Long) As Long

CorelScript

Description

Parameters	Description

XSize	Description of XSize goes here

YSize	Description of YSize goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetTextString

Function SetTextString(ByVal FirstSelectedChar As Long, ByVal LastSelectedChar As Long, ByVal Text As String) As Long

CorelScript

Description

Parameters	Description

FirstSelectedChar	Description of FirstSelectedChar goes here

LastSelectedChar	Description of LastSelectedChar goes here

Text	Description of Text goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetToMasterLayer

Function SetToMasterLayer(ByVal Master As Boolean, ByVal LayerName As String) As Long

CorelScript

Description

Parameters	Description

Master	Description of Master goes here

LayerName	Description of LayerName goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetUserDataField

Function SetUserDataField(ByVal FieldName As String, ByVal FieldValue As String) As Long

CorelScript

Description

Parameters	Description

FieldName	Description of FieldName goes here

FieldValue	Description of FieldValue goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SetVisible

Function SetVisible(ByVal Visible As Boolean) As Long

CorelScript

Description

Parameters	Description

Visible	Description of Visible goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ShareExtrudeVP

Function ShareExtrudeVP(ByVal ExtrudeIndex As Long, ByVal VPToShareIndex As Long, ByVal SharedVP As Boolean) As Long

CorelScript

Description

Parameters	Description

ExtrudeIndex	Description of ExtrudeIndex goes here

VPToShareIndex	Description of VPToShareIndex goes here

SharedVP	Description of SharedVP goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ShowPageBorder

Function ShowPageBorder(ByVal ShowBorder As Boolean) As Long

CorelScript

Description

Parameters	Description

ShowBorder	Description of ShowBorder goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SkewObject

Function SkewObject(ByVal XAngle As Long, ByVal YAngle As Long, ByVal Reference As Long) As Long

CorelScript

Description

Parameters	Description

XAngle	Description of XAngle goes here

YAngle	Description of YAngle goes here

Reference	Description of Reference goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SplitBlend

Function SplitBlend(ByVal PositionX As Long, ByVal PositionY As Long) As Long

CorelScript

Description

Parameters	Description

PositionX	Description of PositionX goes here

PositionY	Description of PositionY goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.StartEditContents

Function StartEditContents() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.StartOfRecording

Function StartOfRecording() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.StopEditContents

Function StopEditContents() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.StoreColor

Function StoreColor(ByVal ColorModel As Long, ByVal V1 As Long, ByVal V2 As Long, ByVal V3 As Long, ByVal V4 As Long, ByVal V5 As Long, ByVal V6 As Long, ByVal V7 As Long, ByVal Position As Long) As Long

CorelScript

Description

Parameters	Description

ColorModel	Description of ColorModel goes here

V1	Description of V1 goes here

V2	Description of V2 goes here

V3	Description of V3 goes here

V4	Description of V4 goes here

V5	Description of V5 goes here

V6	Description of V6 goes here

V7	Description of V7 goes here

Position	Description of Position goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.StraightenText

Function StraightenText(ByVal FirstSelectedChar As Long, ByVal LastSelectedChar As Long) As Long

CorelScript

Description

Parameters	Description

FirstSelectedChar	Description of FirstSelectedChar goes here

LastSelectedChar	Description of LastSelectedChar goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.StretchObject

Function StretchObject(ByVal XScaleNumerator As Double, ByVal XScaleDenominator As Double, ByVal YScaleNumerator As Double, ByVal YScaleDenominator As Double, ByVal HMirror As Boolean, ByVal VMirror As Boolean, ByVal ReferenceNum As Long) As Long

CorelScript

Description

Parameters	Description

XScaleNumerator	Description of XScaleNumerator goes here

XScaleDenominator	Description of XScaleDenominator goes here

YScaleNumerator	Description of YScaleNumerator goes here

YScaleDenominator	Description of YScaleDenominator goes here

HMirror	Description of HMirror goes here

VMirror	Description of VMirror goes here

ReferenceNum	Description of ReferenceNum goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.SuppressPainting

Function SuppressPainting(ByVal ShowDialog As Boolean) As Long

CorelScript

Description

Parameters	Description

ShowDialog	Description of ShowDialog goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.Trim

Function Trim(ByVal LeaveTarget As Boolean, ByVal LeaveModifiers As Boolean) As Long

CorelScript

Description

Parameters	Description

LeaveTarget	Description of LeaveTarget goes here

LeaveModifiers	Description of LeaveModifiers goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.Undo

Function Undo() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.Ungroup

Function Ungroup() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.UngroupAll

Function UngroupAll() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.UnlockGuidelineByIndex

Function UnlockGuidelineByIndex(ByVal Index As Long) As Long

CorelScript

Description

Parameters	Description

Index	Description of Index goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.UnRegisterObject

Function UnRegisterObject(ByVal ObjectID As String) As Boolean

CorelScript

Description

Parameters	Description

ObjectID	Description of ObjectID goes here

Return value

Returns Boolean

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.UnSelectAll

Function UnSelectAll() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.UpdateBitmapLink

Function UpdateBitmapLink() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.Weld

Function Weld(ByVal LeaveTarget As Boolean, ByVal LeaveModifiers As Boolean) As Long

CorelScript

Description

Parameters	Description

LeaveTarget	Description of LeaveTarget goes here

LeaveModifiers	Description of LeaveModifiers goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ZoomIn

Function ZoomIn() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ZoomOut

Function ZoomOut() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ZoomToAllObjects

Function ZoomToAllObjects() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ZoomToHeight

Function ZoomToHeight() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ZoomToPage

Function ZoomToPage() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ZoomToRectangle

Function ZoomToRectangle(ByVal Top As Long, ByVal Left As Long, ByVal Bottom As Long, ByVal Right As Long) As Long

CorelScript

Description

Parameters	Description

Top	Description of Top goes here

Left	Description of Left goes here

Bottom	Description of Bottom goes here

Right	Description of Right goes here

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ZoomToSelection

Function ZoomToSelection() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScript.ZoomToWidth

Function ZoomToWidth() As Long

CorelScript

Description

Return value

Returns Long

Example

Example of usage goes here

Code line

 Related Topics


CorelScriptFile properties

CorelScriptFile     Legend

    Application
    FileName
      Name
    Parent


CorelScriptFile methods

CorelScriptFile     Legend

   Delete
   Play
   Translate


CorelScriptFile

Class CorelScriptFile

Properties     Methods     Referenced By

Corel SCRIPT File Class

 Related Topics


CorelScriptFile.Application

Property Application As Object

CorelScriptFile

Description

Gets the application to which the object belongs

Read-Only

 Related Topics


CorelScriptFile.FileName

Property FileName As String

CorelScriptFile

Description

The FileName property returns the Corel SCRIPT filename.

Read-Only

 Related Topics


CorelScriptFile.Name

Property Name As String

CorelScriptFile

Description

Gets or sets a friendly name for the script; will be used as a macro name if the script is translated to VBA

 Related Topics


CorelScriptFile.Parent

Property Parent As Object

CorelScriptFile

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


CorelScriptFile.Delete

Sub Delete()

CorelScriptFile

Description

The Delete method deletes the Corel SCRIPT file from disk

 Related Topics


CorelScriptFile.Play

Sub Play([ByVal Document As Object = Nothing])

CorelScriptFile

Description

Plays a Corel SCRIPT

Parameters	Description

Document	[in]
Optional
Default value = Nothing

 Related Topics


CorelScriptFile.Translate

Sub Translate([ByVal Document As Object = Nothing])

CorelScriptFile

Description

Translates a Corel SCRIPT

Parameters	Description

Document	[in]
Optional
Default value = Nothing

 Related Topics


CorelScriptTools methods

CorelScriptTools     Legend

   AngleConvert
   ASin
   BeginWaitCursor
   BuildDate
   BuildTime
   Dec
   EndWaitCursor
   FileAttr
   FindFirstFolder
   FindNextFolder
   FormatTime
   FromCentimeters
   FromCiceros
   FromDidots
   FromInches
   FromPicas
   FromPoints
   GetAppHandle
   GetColor
   GetCommandLine
   GetCurrFolder
   GetDateInfo
   GetFileBox
   GetFolder
   GetFont
   GetProcessInfo
   GetScriptFolder
   GetTempFolder
   GetTimeInfo
   GetType
   GetVersion
   GetWinHandle
   Kill
   LengthConvert
   Log
   MkFolder
   RegistryQuery
   Rename
   RmFolder
   ToCentimeters
   ToCiceros
   ToDidots
   ToInches
   ToPicas
   ToPoints


CorelScriptTools

Class CorelScriptTools

Methods     Referenced By

CorelScriptTools Class

 Related Topics


CorelScriptTools.AngleConvert

Function AngleConvert(ByVal FromUnit As Long, ByVal ToUnit As Long, ByVal Value As Double) As Double

CorelScriptTools

Description

Angle Convert

Parameters	Description

FromUnit	[in]

ToUnit	[in]

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.ASin

Function ASin(ByVal Value As Double) As Double

CorelScriptTools

Description

Arc Sine

Parameters	Description

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.BeginWaitCursor

Sub BeginWaitCursor()

CorelScriptTools

Description

Begin Wait Cursor

 Related Topics


CorelScriptTools.BuildDate

Function BuildDate(ByVal Year As Long, ByVal Month As Long, ByVal Day As Long) As Date

CorelScriptTools

Description

Build Date

Parameters	Description

Year	[in]

Month	[in]

Day	[in]

Return value

Returns Date

 Related Topics


CorelScriptTools.BuildTime

Function BuildTime(ByVal Hour As Long, ByVal Minute As Long, ByVal Second As Long) As Date

CorelScriptTools

Description

Build Time

Parameters	Description

Hour	[in]

Minute	[in]

Second	[in]

Return value

Returns Date

 Related Topics


CorelScriptTools.Dec

Function Dec(ByVal Hex As String) As Long

CorelScriptTools

Description

Decimal

Parameters	Description

Hex	[in]

Return value

Returns Long

 Related Topics


CorelScriptTools.EndWaitCursor

Sub EndWaitCursor()

CorelScriptTools

Description

End Wait Cursor

 Related Topics


CorelScriptTools.FileAttr

Function FileAttr(ByVal FolderFile As String) As Long

CorelScriptTools

Description

File Attributes

Parameters	Description

FolderFile	[in]

Return value

Returns Long

 Related Topics


CorelScriptTools.FindFirstFolder

Function FindFirstFolder(ByVal SearchCriteria As String, ByVal Attributes As Long) As String

CorelScriptTools

Description

Find First Folder

Parameters	Description

SearchCriteria	[in]

Attributes	[in]

Return value

Returns String

 Related Topics


CorelScriptTools.FindNextFolder

Function FindNextFolder() As String

CorelScriptTools

Description

Find Next Folder

Return value

Returns String

 Related Topics


CorelScriptTools.FormatTime

Function FormatTime(ByVal Time As Date, ByVal Format As String) As String

CorelScriptTools

Description

Format Time

Parameters	Description

Time	[in]

Format	[in]

Return value

Returns String

 Related Topics


CorelScriptTools.FromCentimeters

Function FromCentimeters(ByVal Value As Double) As Double

CorelScriptTools

Description

From Centimeters

Parameters	Description

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.FromCiceros

Function FromCiceros(ByVal Value As Double) As Double

CorelScriptTools

Description

From Ciceros

Parameters	Description

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.FromDidots

Function FromDidots(ByVal Value As Double) As Double

CorelScriptTools

Description

From Didots

Parameters	Description

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.FromInches

Function FromInches(ByVal Value As Double) As Double

CorelScriptTools

Description

From Inches

Parameters	Description

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.FromPicas

Function FromPicas(ByVal Value As Double) As Double

CorelScriptTools

Description

From Picas

Parameters	Description

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.FromPoints

Function FromPoints(ByVal Value As Double) As Double

CorelScriptTools

Description

From Points

Parameters	Description

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.GetAppHandle

Function GetAppHandle() As Long

CorelScriptTools

Description

Gets Application Handle

Return value

Returns Long

 Related Topics


CorelScriptTools.GetColor

Function GetColor(ByRef Red As Long, ByRef Green As Long, ByRef Blue As Long) As Boolean

CorelScriptTools

Description

Gets Color

Parameters	Description

Red	[in,out]

Green	[in,out]

Blue	[in,out]

Return value

Returns Boolean

 Related Topics


CorelScriptTools.GetCommandLine

Function GetCommandLine() As String

CorelScriptTools

Description

Gets Command Line

Return value

Returns String

 Related Topics


CorelScriptTools.GetCurrFolder

Function GetCurrFolder() As String

CorelScriptTools

Description

Gets Current Folder

Return value

Returns String

 Related Topics


CorelScriptTools.GetDateInfo

Sub GetDateInfo(ByVal Date As Date, ByRef Year As Long, ByRef Month As Long, ByRef Day As Long, ByRef DayOfWeek As Long)

CorelScriptTools

Description

Gets Date Info

Parameters	Description

Date	[in]

Year	[out]

Month	[out]

Day	[out]

DayOfWeek	[out]

 Related Topics


CorelScriptTools.GetFileBox

Function GetFileBox([ByVal Filter As String = "All Files (*.*)|*.*"], [ByVal Title As String = ""], [ByVal Type As Long = 0], [ByVal File As String = ""], [ByVal Extension As String = ""], [ByVal Folder As String = ""], [ByVal Button As String = ""]) As String

CorelScriptTools

Description

Gets File Box

Parameters	Description

Filter	[in]
Optional
Default value = "All Files (*.*)|*.*"

Title	[in]
Optional
Default value = ""

Type	[in]
Optional
Default value = 0

File	[in]
Optional
Default value = ""

Extension	[in]
Optional
Default value = ""

Folder	[in]
Optional
Default value = ""

Button	[in]
Optional
Default value = ""

Return value

Returns String

 Related Topics


CorelScriptTools.GetFolder

Function GetFolder([ByVal InitFolder As String = ""]) As String

CorelScriptTools

Description

Gets Folder

Parameters	Description

InitFolder	[in]
Optional
Default value = ""

Return value

Returns String

 Related Topics


CorelScriptTools.GetFont

Function GetFont(ByRef FaceName As String, ByRef PointSize As Long, ByRef Weight As Long, ByRef Italic As Boolean, ByRef Underline As Boolean, ByRef StrikeOut As Boolean, ByRef Red As Long, ByRef Green As Long, ByRef Blue As Long) As Boolean

CorelScriptTools

Description

Gets Font

Parameters	Description

FaceName	[in,out]

PointSize	[in,out]

Weight	[in,out]

Italic	[in,out]

Underline	[in,out]

StrikeOut	[in,out]

Red	[in,out]

Green	[in,out]

Blue	[in,out]

Return value

Returns Boolean

 Related Topics


CorelScriptTools.GetProcessInfo

Function GetProcessInfo(ByVal ProcessHandle As Long) As Long

CorelScriptTools

Description

Gets Process Info

Parameters	Description

ProcessHandle	[in]

Return value

Returns Long

 Related Topics


CorelScriptTools.GetScriptFolder

Function GetScriptFolder() As String

CorelScriptTools

Description

Gets Script Folder

Return value

Returns String

 Related Topics


CorelScriptTools.GetTempFolder

Function GetTempFolder() As String

CorelScriptTools

Description

Gets Temp Folder

Return value

Returns String

 Related Topics


CorelScriptTools.GetTimeInfo

Sub GetTimeInfo(ByVal Time As Date, ByRef Hour As Long, ByRef Minute As Long, ByRef Second As Long)

CorelScriptTools

Description

Gets Time Info

Parameters	Description

Time	[in]

Hour	[out]

Minute	[out]

Second	[out]

 Related Topics


CorelScriptTools.GetType

Function GetType(ByVal Expression As Variant) As Long

CorelScriptTools

Description

Gets Type

Parameters	Description

Expression	[in]

Return value

Returns Long

 Related Topics


CorelScriptTools.GetVersion

Function GetVersion(ByVal Option As Long) As Long

CorelScriptTools

Description

Gets Version

Parameters	Description

Option	[in]

Return value

Returns Long

 Related Topics


CorelScriptTools.GetWinHandle

Function GetWinHandle() As Long

CorelScriptTools

Description

Gets Window Handle

Return value

Returns Long

 Related Topics


CorelScriptTools.Kill

Function Kill(ByVal FileName As String) As Boolean

CorelScriptTools

Description

Kill

Parameters	Description

FileName	[in]

Return value

Returns Boolean

 Related Topics


CorelScriptTools.LengthConvert

Function LengthConvert(ByVal FromUnit As Long, ByVal ToUnit As Long, ByVal Value As Double) As Double

CorelScriptTools

Description

Length Convert

Parameters	Description

FromUnit	[in]

ToUnit	[in]

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.Log

Function Log(ByVal Value As Double) As Double

CorelScriptTools

Description

Log

Parameters	Description

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.MkFolder

Function MkFolder(ByVal Folder As String) As Boolean

CorelScriptTools

Description

Makes Folder

Parameters	Description

Folder	[in]

Return value

Returns Boolean

 Related Topics


CorelScriptTools.RegistryQuery

Function RegistryQuery(ByVal MainKey As Long, ByVal SubKey As String, ByVal Value As String) As Variant

CorelScriptTools

Description

Registry Query

Parameters	Description

MainKey	[in]

SubKey	[in]

Value	[in]

Return value

Returns Variant

 Related Topics


CorelScriptTools.Rename

Function Rename(ByVal Src As String, ByVal Dst As String, [ByVal Overwrite As Long = 1]) As Boolean

CorelScriptTools

Description

Rename

Parameters	Description

Src	[in]

Dst	[in]

Overwrite	[in]
Optional
Default value = 1

Return value

Returns Boolean

 Related Topics


CorelScriptTools.RmFolder

Function RmFolder(ByVal Folder As String) As Boolean

CorelScriptTools

Description

Removes Folder

Parameters	Description

Folder	[in]

Return value

Returns Boolean

 Related Topics


CorelScriptTools.ToCentimeters

Function ToCentimeters(ByVal Value As Double) As Double

CorelScriptTools

Description

To Centimeters

Parameters	Description

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.ToCiceros

Function ToCiceros(ByVal Value As Double) As Double

CorelScriptTools

Description

To Ciceros

Parameters	Description

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.ToDidots

Function ToDidots(ByVal Value As Double) As Double

CorelScriptTools

Description

To Didots

Parameters	Description

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.ToInches

Function ToInches(ByVal Value As Double) As Double

CorelScriptTools

Description

To Inches

Parameters	Description

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.ToPicas

Function ToPicas(ByVal Value As Double) As Double

CorelScriptTools

Description

To Picas

Parameters	Description

Value	[in]

Return value

Returns Double

 Related Topics


CorelScriptTools.ToPoints

Function ToPoints(ByVal Value As Double) As Double

CorelScriptTools

Description

To Points

Parameters	Description

Value	[in]

Return value

Returns Double

 Related Topics


CrossPoint properties

CrossPoint     Legend

    Offset
    PositionX
    PositionY


CrossPoint

Class CrossPoint

Properties     Referenced By

The CrossPoint class represents the point where curve segments intersect. This object is returned in a collection from the GetIntersections method of the SubPath and Segment objects.

 Related Topics


CrossPoint.Offset

Property Offset As Double

CrossPoint

Description

The Offset property returns the offset distance from the intersection point to the beginning of the subpath (segment). The value depends on the OffsetType parameter in the call to GetIntersections.

The default value of the offset distance in CorelDRAW is 0.5 document units.

Read-Only

Example

The following example creates two intersecting line segments and determines where they intersect. The first segment is then broken apart at that point.

Sub CrossPointOffset()

Dim s As Shape

Dim spath As SubPath

Dim cps As CrossPoints

Set s = ActiveLayer.CreateLineSegment(0, 0, 4, 4)

Set spath = s.Curve.CreateSubPath(0, 4)

spath.AppendLineSegment 4, 0, False

Set cps = s.Curve.Segments(1).GetIntersections(s.Curve.Segments(2))

s.Curve.Subpaths(1).BreakApartAt cps(1).Offset

End Sub

 Related Topics


CrossPoint.PositionX

Property PositionX As Double

CrossPoint

Description

Definition

The PositionX property returns the horizontal coordinate of the point of intersection of curve segments.

Read-Only

Example

The following example creates two intersecting ellipses and combines them into a single curve. At the intersections of the ellipses (now subpaths), small circles are created.

Sub XPosition()

Dim s1 As Shape, sr As New ShapeRange

Dim s As Shape

Dim cps As CrossPoints

Dim cp As CrossPoint

sr.Add ActiveLayer.CreateEllipse2(4, 4, 3)

sr.Add ActiveLayer.CreateEllipse2(5, 3, 2)

Set s = sr.Combine

Set cps = s.Curve.Subpaths(1).GetIntersections(s.Curve.Subpaths(2))

For Each cp In cps

ActiveLayer.CreateEllipse2 cp.PositionX, cp.PositionY, 0.1

Next cp

End Sub

 Related Topics


CrossPoint.PositionY

Property PositionY As Double

CrossPoint

Description

The PositionY property returns the vertical coordinate of the point of intersection of curve segments.

Read-Only

Example

The following example creates two intersecting ellipses and combines them into a single curve. At the intersections of the ellipses (now subpaths), small circles are created.

Sub YPosition()

Dim s1 As Shape, sr As New ShapeRange

Dim s As Shape

Dim cps As CrossPoints

Dim cp As CrossPoint

sr.Add ActiveLayer.CreateEllipse2(4, 4, 3)

sr.Add ActiveLayer.CreateEllipse2(5, 3, 2)

Set s = sr.Combine

Set cps = s.Curve.Subpaths(1).GetIntersections(s.Curve.Subpaths(2))

For Each cp In cps

ActiveLayer.CreateEllipse2 cp.PositionX, cp.PositionY, 0.1

Next cp

End Sub

 Related Topics


CrossPoints properties

CrossPoints     Legend

    Count
  Item


CrossPoints

Class CrossPoints

Properties     Referenced By

The CrossPoints class represents a collection of intersection points. This object is returned in a collection from the GetIntersections method of the SubPath and Segment objects.

 Related Topics


CrossPoints.Count

Property Count As Long

CrossPoints

Description

The Count property returns the number of intersection points that are found. The value depends on the OffsetType parameter in the call to the GetIntersections method.

Read-Only

Example

The following example creates two separate ellipses with the CreateEllipse method. The active document is cleared, both ellipses are added to the active selection, and the ellipses are combined to create a single shape object. The intersections, or CrossPoints, of this new shape are identified by creating small circles around each point, using its x and y coordinates to serve as the coordinates of the small circles. The number of crosspoints and the X position of the first crosspoint display in a message box.

Sub XPosition()

Dim s1 As Shape, s2 As Shape

Dim s As Shape

Dim cps As CrossPoints

Dim cp As CrossPoint

Set s1 = ActiveLayer.CreateEllipse(4, 2, 1, 0)

Set s2 = ActiveLayer.CreateEllipse(3, 1, 2, 5)

ActiveDocument.ClearSelection

s1.AddToSelection

s2.AddToSelection

ActiveSelection.Combine

Set s = ActiveSelection.Shapes(1)

Set cps = s.Curve.Subpaths(1).GetIntersections(s.Curve.Subpaths(2))

MsgBox cps.Count

MsgBox cps.Item(1).PositionX

End Sub

 Related Topics


CrossPoints.Item

Property Item(ByVal Index As Long) As CrossPoint

CrossPoints

Description

The Item property returns the given intersection point. For example, CrossPoints(2) refers to the second crosspoint object in the CrossPoints collection of CorelDRAW.

The Item property is the default property and its reference can be omitted when referencing items in the collection. For example, CrossPoints.Item(2) is the same as CrossPoint(2).

Read-Only

Parameters	Description

Index	Index is a preset placeholder for each object in a CrossPoints collection; it uniquely identifies each member of the collection. [in]

Example

The following example creates two separate ellipses with the CreateEllipse method. The active document is cleared, both ellipses are added to the active selection, and the ellipses are combined to create a single shape object. The intersections, or CrossPoints, of this new shape are identified by creating small circles around each point, using its x and y coordinates to serve as the coordinates of the small circles. The number of crosspoints and the X position of the first crosspoint display in a message box.

Sub XPosition()

Dim s1 As Shape, s2 As Shape

Dim s As Shape

Dim cps As CrossPoints

Dim cp As CrossPoint

Set s1 = ActiveLayer.CreateEllipse(4, 2, 1, 0)

Set s2 = ActiveLayer.CreateEllipse(3, 1, 2, 5)

ActiveDocument.ClearSelection

s1.AddToSelection

s2.AddToSelection

ActiveSelection.Combine

Set s = ActiveSelection.Shapes(1)

Set cps = s.Curve.Subpaths(1).GetIntersections(s.Curve.Subpaths(2))

MsgBox cps.Count

MsgBox cps.Item(1).PositionX

End Sub

 Related Topics


Curve properties

Curve     Legend

      Closed
    Length
    Nodes
    Segments
    Subpaths


Curve methods

Curve     Legend

   AppendCurve
   BindToDocument
   CopyAssign
   CreateSubPath
   CreateSubPathFromArray
   GetCopy
   IsOnCurve
   ReverseDirection
   Selection


Curve

Class Curve

Properties     Methods     Referenced By

The Curve class represents the curve-specific properties of the Shape object.

 Related Topics


Curve.Closed

Property Closed As Boolean

Curve

Description

The Closed property returns or sets the value of a curve object's closed status. Curves are closed if all of its subpaths are closed. Assigning a value to this property opens or closes the curve (all subpaths).

Example

The following example selects an object in the active document and determines if the object is a curve object. If the selection is a curve, it changes its Closed status to True, joining all the segments in the shape to make a self-contained object. A color fountain fill is then applied to the new closed curve object using the CreateColorEx method.

Sub CurveClosed()

Dim s As Shape

Set s = ActiveSelection.Shapes(1)

If s.Type = cdrCurveShape Then

s.Curve.Closed = True

End If

s.Fill.ApplyFountainFill CreateColorEx(5005, 255, 0, 0), _

CreateColorEx(5005, 0, 0, 0), 1

End Sub

 Related Topics


Curve.Length

Property Length As Double

Curve

Description

The Length property returns the total length of a selected curve object in CoreDRAW

The curve calculation is an approximation; the length cannot be calculated with absolute mathematical precision. The precision of the calculation may be set with the CurvePrecision property of the Document object.

Read-Only

Example

The following example selects a shape object in the active document and determines if that shape is a curve object. If the shape is a curve, a message box displays the length of that curve, in a measurement of inches.

Sub CurveLength()

Dim s As Shape

Set s = ActiveSelection.Shapes(1)

If s.Type = cdrCurveShape Then

MsgBox "The length of the curve is: " _

& vbCrLf & s.Curve.Length & " inches"

End If

End Sub

 Related Topics


Curve.Nodes

Property Nodes As Nodes

Curve

Description

The Nodes property returns the collection of all nodes on all subpaths in the curve.

Read-Only

Example

The following example selects a shape in the active document and determines if the selected shape is a curve object. If the shape is a curve, it displays the number of nodes found on the selected curve in a message box.

Sub CurveNodes()

Dim s As Shape

Dim nr As NodeRange

Set s = ActiveSelection.Shapes(1)

If s.Type = cdrCurveShape Then

MsgBox "The selected shape has " & _

s.Curve.Nodes.Count & " nodes"

End If

End Sub

 Related Topics


Curve.Segments

Property Segments As Segments

Curve

Description

The Segments property returns the collection of all segments of all subpaths in the curve.

Read-Only

Example

The following example makes a selection of shapes in the active document and determines if the objects selected are shape objects. It converts all shapes in the selection to curves and changes the segment type for all of the subpath's segments to linear.

Sub CurveSegments()

Dim s As Shape

Dim seg As Segment

For Each s In ActiveSelection.Shapes

If s.Type <> cdrCurveShape Then

s.ConvertToCurves

End If

If s.Type = cdrCurveShape Then

For Each seg In s.Curve.Segments

seg.Type = cdrLineSegment

Next seg

End If

Next s

End Sub

 Related Topics


Curve.Subpaths

Property Subpaths As Subpaths

Curve

Description

The Subpaths property returns a collection of all subpaths in the curve. A subpath is a curve or shape within a single curve object. Curve objects may have several subpaths and each member of the subpath collection is identified by its index number. For example, Subpaths(2) refers to the second subpath of a selected curve object in CorelDRAW.

Read-Only

Example

The following example creates a rectangle around each subpath of each curve in the selection.

Sub Test()

Dim s As Shape

Dim spath As SubPath

Dim x1 As Double, y1 As Double, x2 As Double, y2 As Double

ActiveDocument.ReferencePoint = cdrBottomLeft

For Each s In ActiveSelection.Shapes

If s.Type <> cdrCurveShape Then s.ConvertToCurves

If s.Type = cdrCurveShape Then

For Each spath In s.curve.Subpaths

x1 = spath.PositionX

y1 = spath.PositionY

x2 = x1 + spath.SizeWidth

y2 = y1 + spath.SizeHeight

ActiveLayer.CreateRectangle x1, y1, x2, y2

Next spath

End If

Next s

End Sub

 Related Topics


Curve.AppendCurve

Sub AppendCurve(ByVal Source As Curve)

Curve

Description

The AppendCurve method appends subpaths from a source curve to the current curve.

Parameters	Description

Source	Specifies the source curve [in]

Example

The following example iterates through all the shapes on the active page and creates a new curve that contains all the shapes. The new curve is filled with red.

Sub Test()

Dim crv As Curve, s As Shape

Set crv = CreateCurve(ActiveDocument)

For Each s In ActivePage.Shapes

crv.AppendCurve s.DisplayCurve

Next s

Set s = ActiveLayer.CreateCurve(crv)

s.Fill.UniformColor.RGBAssign 255, 0, 0

End Sub

 Related Topics


Curve.BindToDocument

Sub BindToDocument(ByVal Document As Document)

Curve

Description

The BindToDocument method attaches a curve in memory to a document which allows you to reference the document's system of measurement.

Parameters	Description

Document	Specifies the name of the document [in]

Example

The following example creates a shape similar to a snowman. It then creates a curve similar to the shape and fills the curve with green.

Sub Test()

Dim s1 As Shape, s2 As Shape, sCurve As Shape

Dim c As Curve

Set s1 = ActiveDocument.ActiveLayer.CreateEllipse2(4, 6.5, 0.5)

Set s2 = ActiveDocument.ActiveLayer.CreateEllipse2(4, 5, 1)

s1.Fill.ApplyUniformFill CreateRGBColor(255, 0, 0)

s2.Fill.ApplyUniformFill CreateRGBColor(0, 0, 255)

Set c = New Curve

c.BindToDocument ActiveDocument

c.AppendCurve s1.DisplayCurve

c.AppendCurve s2.DisplayCurve

Set sCurve = ActiveLayer.CreateCurve(c)

sCurve.Move 1, 1

sCurve.Fill.ApplyUniformFill CreateRGBColor(0, 255, 0)

End Sub

 Related Topics


Curve.CopyAssign

Sub CopyAssign(ByVal Source As Curve)

Curve

Description

The CopyAssign method copies properties from another curve and applies them to the current curve.

Parameters	Description

Source	Specifies the curve to copy [in]

Example

The following example creates a spiral, makes a copy of the curve, and adjusts the nodes of the copy. It then assigns the properties of the copy to the original shape.

Sub Test()

Dim c As Curve, n As Node, s As Shape

Set s = ActiveLayer.CreateSpiral(4, 5, 7, 2, 8, cdrSymmetric, 2)

Set c = s.Curve.GetCopy

For Each n In c.Nodes

n.Move Rnd(), Rnd() - 0.5

Next n

s.Curve.CopyAssign c

End Sub

 Related Topics


Curve.CreateSubPath

Function CreateSubPath(ByVal X As Double, ByVal Y As Double) As SubPath

Curve

Description

The CreateSubPath method creates a subpath for a curve. The CreateSubPath method requires x and y coordinates to represent the first node in the subpath.

Parameters	Description

X	Specifies the horizontal position for the first node in a curve object's new subpath [in]

Y	Specifies the vertical position for the first node in a curve object's new subpath [in]

Return value

Returns SubPath

Example

The following example creates a new curve object in the active document. There are two line segments and three curve segments within the subpath.

Sub Test()

Dim s As Shape

Dim sp As SubPath

Dim crv As Curve

Set crv = CreateCurve(ActiveDocument)

ActiveDocument.ReferencePoint = cdrBottomLeft

Set sp = crv.CreateSubPath(1, 1)

sp.AppendLineSegment 1, 1

sp.AppendCurveSegment 3, 3

sp.AppendCurveSegment 5, 1

sp.AppendCurveSegment 7, 4

sp.AppendLineSegment 9, 0

sp.Nodes(2).Type = cdrSmoothNode

sp.Nodes(3).Type = cdrSmoothNode

sp.Nodes(4).Type = cdrSmoothNode

sp.Nodes(5).Type = cdrSmoothNode

Set s = ActiveLayer.CreateCurve(crv)

End Sub

 Related Topics


Curve.CreateSubPathFromArray

Function CreateSubPathFromArray(ByRef Source() As CurveElement, [ByVal Closed As Boolean = False], [ByVal NumElements As Long = -1]) As SubPath

Curve

Description

The CreateSubPathFromArray method adds a new subpath based on the properties of the specified node.

Parameters	Description

Source	Specifies the curve element to use as a source [in]

Closed	Specifies whether the curve is closed. This parameter does not automatically close the curve. The starting and ending nodes must have the same coordinates. [in]
Optional
Default value = False

NumElements	Specifies the number of valid curve elements to use. If nothing is specified then all the curve elements are used. [in]
Optional
Default value = -1

Return value

Returns SubPath

Example

The following example creates a curve.

Sub Test()

Dim ce(5) As CurveElement

Dim crv As Curve

ce(0).ElementType = cdrElementStart

ce(0).PositionX = 0

ce(0).PositionY = 0

ce(1).ElementType = cdrElementLine

ce(1).NodeType = cdrSmoothNode

ce(1).PositionX = 1

ce(1).PositionY = 1

ce(2).ElementType = cdrElementControl

ce(2).PositionX = 2

ce(2).PositionY = 2

ce(3).ElementType = cdrElementControl

ce(3).PositionX = 3

ce(3).PositionY = 2

ce(4).ElementType = cdrElementCurve

ce(4).NodeType = cdrSmoothNode

ce(4).PositionX = 4

ce(4).PositionY = 1

ce(5).ElementType = cdrElementLine

ce(5).PositionX = 5

ce(5).PositionY = 0

Set crv = CreateCurve(ActiveDocument)

crv.CreateSubPathFromArray ce

ActiveLayer.CreateCurve crv

End Sub

 Related Topics


Curve.GetCopy

Function GetCopy() As Curve

Curve

Description

The GetCopy returns a copy of the properties of a curve. The properties are copied as a free curve.

Return value

Returns Curve

Example

The following example creates a spiral, makes a copy of the curve, and adjusts the nodes of the copy. It then assigns the properties of the copy to the original shape.

Sub Test()

Dim c As Curve, n As Node, s As Shape

Set s = ActiveLayer.CreateSpiral(4, 5, 7, 2, 8, cdrSymmetric, 2)

Set c = s.Curve.GetCopy

For Each n In c.Nodes

n.Move Rnd(), Rnd() - 0.5

Next n

s.Curve.CopyAssign c

End Sub

 Related Topics


Curve.IsOnCurve

Function IsOnCurve(ByVal X As Double, ByVal Y As Double, [ByVal HotArea As Double = -1]) As cdrPositionOfPointOverShape

Curve

Description

The IsOnCurve method determines whether a given point is inside or outside of the curve, or over its outline.

Parameters	Description

X	Sets the horizontal position for a point in the active document, created in relation to the reference point [in]

Y	Sets the vertical position (using the CorelDRAW rulers as a reference) for a point in the active document, created in relation to the reference point [in]

HotArea	Defines a restricted area on the curve in which to evaluate the position of a point [in]
Optional
Default value = -1

Return value

Returns cdrPositionOfPointOverShape

Example

The following examples creates a rectangle in the active document and converts the rectangle to a curve. The ShowOnCurve function is called, coordinates are passed to the function, and a message box displays each point position in relation to the rectangle.

Sub OnCurve()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s.ConvertToCurves

ShowOnCurve 1, 1, s.Curve.IsOnCurve(1, 1)

ShowOnCurve 1, 0, s.Curve.IsOnCurve(1, 0)

ShowOnCurve 1, 3, s.Curve.IsOnCurve(1, 3)

End Sub

 Private Function ShowOnCurve(x As Double, y As Double, v As cdrPositionOfPointOverShape)

Dim s As String

s = "Point (" & x & "," & y & ") is "

Select Case v

Case cdrOutsideShape

s = s & "outside the shape"

Case cdrOnMarginOfShape

s = s & "over the outline"

Case cdrInsideShape

s = s & "inside the shape"

End Select

MsgBox s

End Function

 Related Topics


Curve.ReverseDirection

Sub ReverseDirection()

Curve

Description

The ReverseDirection method changes the curve flow to the oposite direction. The first node becomes the last and the last node becomes the first. This is performed for each subpath of the curve.

Example

The following example creates a line . An arrowhead is applied to the start position of the line and the zoom of the active window is increases to 200%. The ReverseDirection method is applied and the arrowhead that was initially applied to a specific end of the line now appears at the opposite end of the line.

Sub CurveReverse()

Dim s As Shape

Set s = ActiveLayer.CreateLineSegment(0, 0, 5, 5)

s.Outline.StartArrow = ArrowHeads(3)

ActiveWindow.ActiveView.Zoom = 200

s.Curve.ReverseDirection

End Sub

 Related Topics


Curve.Selection

Function Selection() As NodeRange

Curve

Description

The Selection method returns a NodeRange object that contains all preselected nodes of the curve. This method may only be used when the Shape tool is the active tool.

Return value

Returns NodeRange

Example

The following example selects an object in the active document and determines if the object is a curve object. If it is a curve, it evaluates the pre-selected nodes in the object's selection. If the node type in the selection is mixed nodes, it displays a message in a message box.

Sub CurveSelection()

Dim s As Shape

Dim nr As NodeRange

Set s = ActiveSelection.Shapes(1)

If s.Type = cdrCurveShape Then

Set nr = s.Curve.Selection

If nr.type=cdrMixedNodes then

MsgBox "The current curve selection has mixed nodes."

End If

End If

End Sub

 Related Topics


DataField properties

DataField     Legend

    Application
      DocDefault
      DrawDefault
      FieldWidth
      Format
      FormatType
    Index
      Name
    Parent
      SummarizeGroup


DataField methods

DataField     Legend

   Delete
   Reorder


DataField

Class DataField

Properties     Methods     Referenced By

The DataField class represents an Object Data field as defined in the Object Data Manager Docker window.

By default, CorelDRAW crates four data fields: Name, Cost, Comments, and CDRStaticID. The Cost and Comments fields are for your convenience, and can be edited or deleted as required. The Name and CDRStaticID fields are used by CorelDRAW to identify objects, and cannot be edited or deleted.

 Related Topics


DataField.Application

Property Application As Application

DataField

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


DataField.DocDefault

Property DocDefault As Boolean

DataField

Description

The DocDefault property returns or sets a value that indicates whether or not a data field is specified for a single particular shape, or whether it is common for all objects in the document.

If the data field is not a default data field in the document, the Object Data Manager Docker window will not display this field unless it contains some data for the selected shape.

Example

The following example sets the Comments data field not to be a default data field for the active document; therefore, it will not be visible in Object Data Manager Docker window.

Sub Test()

ActiveDocument.DataFields("Comments").DocDefault = False

End Sub

 Related Topics


DataField.DrawDefault

Property DrawDefault As Boolean

DataField

Description

The DrawDefault property returns or sets a value that indicates whether or not a data field is specified for a single particular shape, or whether it is common for all objects in all documents.

Example

The following example sets the data field named "Test" as a default data field for all documents. A DataField named "Test" must be created before running the example.

Sub Test()

ActiveDocument.DataFields("Test").DocDefault = True

End Sub

 Related Topics


DataField.FieldWidth

Property FieldWidth As Long

DataField

Description

The FieldWidth property returns or sets the width of a data field as seen in the Spreadsheet editor of the Object Data Manager Docker window.

Example

The following example calculates and displays the total width of all data fields.

Sub Test()

Dim df As DataField

Dim w As Long

w = 0

For Each df In ActiveDocument.DataFields

w = w + df.FieldWidth

Next df

MsgBox "Total width of all " & ActiveDocument.DataFields.Count & " data fields is " & w & " units"

End Sub

 Related Topics


DataField.Format

Property Format As String

DataField

Description

The Format property returns or sets the data format for the given data field.

Example

The following example adds a new data field, CreationDate, and sets the date format for it.

Sub Test()

Dim df As DataField

Set df = ActiveDocument.DataFields.Add("CreationDate", DocDefault:=True)

df.Format = "dd/MM/yy"

End Sub

 Related Topics


DataField.FormatType

Property FormatType As cdrDataFormatType

DataField

Description

The FormatType property returns the format type for a data field. The format type may be one of the following: General, Date/Time, Linear/Angular, or Numeric.

Example

The following example changes the format of all numeric data fields

Sub Test()

Dim df As DataField

For Each df In ActiveDocument.DataFields

If df.FormatType = cdrFormatNumeric Then

df.Format = "#,##0 K"

End If

Next df

End Sub

 Related Topics


DataField.Index

Property Index As Long

DataField

Description

The Index property returns the index number of a data field in the collection. The first item in the collection has the index of 1.

Read-Only

Example

The following example shows the list of all data fields defined for the active document and the corresponding data values for the currently selected shape. Note that this code will fail if there are any data fields that are not part of the document default and their values are not set to the shape.

Sub Test()

Dim s As String

Dim df As DataField

s = "Data Fields available:" & vbCr

For Each df In ActiveDocument.DataFields

s = s & vbCr & df.Name & " = " & ActiveShape.ObjectData(df.Index).Value

Next df

MsgBox s

End Sub

 Related Topics


DataField.Name

Property Name As String

DataField

Description

The Name property returns the name of the data field as it appears in the Object Data Manager Docker window.

Example

The following example shows the list of all data fields defined for the active document along with their format strings.

Sub Test()

Dim s As String

Dim df As DataField

s = "Data Fields available:" & vbCr

For Each df In ActiveDocument.DataFields

s = s & vbCr & df.Name & " : " & df.Format

Next df

MsgBox s

End Sub

 Related Topics


DataField.Parent

Property Parent As DataFields

DataField

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


DataField.SummarizeGroup

Property SummarizeGroup As Boolean

DataField

Description

The SummarizeGroup property returns or sets whether to summarize the data in the fields for the grouped objects.

Example

The following example shows the list of all data fields defined for the active document and whether or not the data in the fields should be summarized throughout grouped shapes.

Sub Test()

Dim s As String

Dim df As DataField

s = "Field" & vbTab & "Summarize" & vbCr

s = s & "------" & vbTab & "--------------" & vbCr

For Each df In ActiveDocument.DataFields

s = s & vbCr & df.Name & vbTab

If df.SummarizeGroup Then s = s & "Yes" Else s = s & "No"

Next df

MsgBox s

End Sub

 Related Topics


DataField.Delete

Sub Delete()

DataField

Description

The Delete method deletes a specified data field. You can delete any data field except for Name and CDRStaticID. When you delete a field, you also delete all data entered for that field in the active document.

Example

The following example deletes the data field named "Temporary" (assuming this field has previously been created).

Sub Test()

ActiveDocument.DataField("Temporary").Delete

End Sub

 Related Topics


DataField.Reorder

Sub Reorder(ByVal NewIndex As Long)

DataField

Description

The Reorder method reorders the position of a data field as it appears in the Object Data Manager Docker window. It does this by assigning a new index number to the data field.

Parameters	Description

NewIndex	Index is a preset placeholder for each object in a DataFields collection; it uniquely identifies each member of the collection [in]

Example

The following example moves the "Comments" field to the top of the list.

Sub Test()

ActiveDocument.DataFields("Comments").Reorder 1

End Sub

 Related Topics


DataFields properties

DataFields     Legend

    Application
    Count
  Item
    Parent


DataFields methods

DataFields     Legend

   Add


DataFields

Class DataFields

Properties     Methods     Referenced By

The DataFields class represents a collection of all data fields for all objects defined in a document.

By default, CorelDRAW crates four data fields: Name, Cost, Comments, and CDRStaticID. The Cost and Comments fields are for your convenience, and can be edited or deleted as required. The Name and CDRStaticID fields are used by CorelDRAW to identify objects, and cannot be edited or deleted.

 Related Topics


DataFields.Application

Property Application As Application

DataFields

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


DataFields.Count

Property Count As Long

DataFields

Description

The Count property returns the number of data field objects available.

Read-Only

Example

The following example shows the number of data fields available.

Sub Test()

Dim n As Long

n = ActiveDocument.DataFields.Count

MsgBox "There are " & n & " data fields defined."

End Sub

 Related Topics


DataFields.Item

Property Item(ByVal IndexOrName As Variant) As DataField

DataFields

Description

The Item property returns the data item (DataField object) representing a data field.

This property if the default property of the collection so the reference to Item can be omitted when referencing data fields in the collection.

Read-Only

Parameters	Description

IndexOrName	Specifies the data field by its index number or name [in]

Example

The following example shows the format string used to format the data of the "Cost" field.

Sub Test()

MsgBox ActiveDocument.DataFields.Item("Cost").Format

End Sub

 Related Topics


DataFields.Parent

Property Parent As Document

DataFields

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


DataFields.Add

Function Add(ByVal Name As String, [ByVal Format As String], [ByVal DrawDefault As Boolean = False], [ByVal DocDefault As Boolean = False], [ByVal SummarizeGroup As Boolean = False]) As DataField

DataFields

Description

The Add method adds a new data field.

Parameters	Description

Name	Sets the name of the data field. This value is a string value. [in]

Format	Sets the format value of the data field [in]
Optional

DrawDefault	Sets the data field as a default field [in]
Optional
Default value = False

DocDefault	Sets the data field as a default field in the document [in]
Optional
Default value = False

SummarizeGroup	Specifies whether to summarize the data field [in]
Optional
Default value = False

Return value

Returns DataField

Example

The following example adds a new data field named "Weight," and specifies a custom data format (2 digits after the decimal point and the "kg" suffix after the number).

Sub Test()

ActiveDocument.DataFields.Add "Weight", "#,##0.00 ""kg""", False, True, False

End Sub

 Related Topics


DataItem properties

DataItem     Legend

    Application
    DataField
    FormattedValue
    Parent
    Value


DataItem methods

DataItem     Legend

   Clear


DataItem

Class DataItem

Properties     Methods     Referenced By

The DataItem class represents an Object Data item associated with a shape. A data item stores information about a shape.

By default, CorelDRAW creates four data fields: Name, Cost, Comments, and CDRStaticID. The Cost and Comments fields are for your convenience, and can be edited or deleted as required. The Name and CDRStaticID fields are used by CorelDRAW to identify objects, and cannot be edited or deleted.

 Related Topics


DataItem.Application

Property Application As Application

DataItem

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


DataItem.DataField

Property DataField As DataField

DataItem

Description

The DataField property returns the corresponding DataField to which the given DataItem belongs.

Read-Only

Example

The following example shows a list of all object data items assigned to the selected shape. Each text line in the message box lists the field name and its value as they appear in Object Data Manager Docker window.

Sub Test()

Dim di As DataItem

Dim s As String

s = "Field = Value" & vbCr

For Each di In ActiveShape.ObjectData

s = s & vbCr & di.DataField.Name & " = " & di.FormattedValue

Next di

MsgBox s

End Sub

 Related Topics


DataItem.FormattedValue

Property FormattedValue As String

DataItem

Description

The FormattedValue property returns a string representing the value in DataItem. The returned string is formatted according to the data format specification. For example, if the Cost field is set to 10, then FormattedValue will return the string "$10.00" while Value will return a numeric 10.

The Name and CDRStaticID fields are read-only and cannot be modified.

Read-Only

Example

The following example shows a list of all object data items assigned to the selected shape.

Sub Test()

Dim di As DataItem

Dim s As String

s = "Field = Formatted/Value" & vbCr

For Each di In ActiveShape.ObjectData

s = s & vbCr & di.DataField.Name & " = " & di.FormattedValue & " / " & di.Value

Next di

MsgBox s

End Sub

 Related Topics


DataItem.Parent

Property Parent As DataItems

DataItem

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


DataItem.Value

Property Value As Variant

DataItem

Description

The Value property returns or sets the actual variant data stored in the DataItem. For example, if the Cost field is set to 10, then FormattedValue will return the string "$10.00" while Value will return a numeric 10.

The Name and CDRStaticID fields are read-only and cannot be modified.

Value is the default property of the DataItem class.

Example

The following example shows a list of all object data items assigned to the selected shape.

Sub Test()

Dim di As DataItem

Dim s As String

s = "Field = Formatted/Value" & vbCr

For Each di In ActiveShape.ObjectData

s = s & vbCr & di.DataField.Name & " = " & di.FormattedValue & " / " & di.Value

Next di

MsgBox s

End Sub

 Related Topics


DataItem.Clear

Sub Clear()

DataItem

Description

The Clear method removes the data by assigning an empty value to the field.

The Name and CDRStaticID fields are read-only and cannot be modified.

Example

The following example clears all data assigned to the currently selected shape.

Sub Test()

Dim di As DataItem

For Each di In ActiveShape.ObjectData

di.Clear

Next di

End Sub

 Related Topics


DataItems properties

DataItems     Legend

    Application
    Count
  Item
    Parent


DataItems methods

DataItems     Legend

   Add
   Clear
   CopyFrom


DataItems

Class DataItems

Properties     Methods     Referenced By

The DataItems class represents a collection of all Object Data items (fields) associated with a shape.

A data item stores information about a shape object within the CorelDRAW development environment. By customizing a data item, you are customizing information about an object within CorelDRAW.

By default, CorelDRAW crates four data fields: Name, Cost, Comments, and CDRStaticID. The Cost and Comments fields are for your convenience, and can be edited or deleted as required. The Name and CDRStaticID fields are used by CorelDRAW to identify objects, and cannot be edited or deleted.

 Related Topics


DataItems.Application

Property Application As Application

DataItems

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


DataItems.Count

Property Count As Long

DataItems

Description

The Count property returns the number of fields available. Fields that are empty and not a document default are not listed in this collection. See DataFields for the full list of data fields available in the document.

Read-Only

Example

The following example counts the number of data fields in the active shape.

Sub Test()

Dim n As Long

CountFields = ActiveSelection.Shapes(1).ObjectData.Count

MsgBox CountFields

End Sub

 Related Topics


DataItems.Item

Property Item(ByVal IndexOrName As Variant) As DataItem

DataItems

Description

The Item property returns the data item (DataItem object) representing a data field associated with the given shape.

The Item property is the default property and its reference may be omitted when referencing items in the collection. For example, ObjectData.Item(2) is the same as ObjectData(2) - they both reference the second data item object in the DataItems collection.

Read-Only

Parameters	Description

IndexOrName	A data item can be referenced by its numeric index (starting from 1) or its name. Index is a preset placeholder for each object in a DataItems collection; it uniquely identifies each member of the collection. Name is the unique text name given to each data item. [in]

Example

The following example displays the name of a data field in an object data item in CorelDRAW:

Sub FieldName()

With ActiveShape.ObjectData.Item(1)

 MsgBox .DataField.Name

End With

End Sub

 Related Topics


DataItems.Parent

Property Parent As Shape

DataItems

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


DataItems.Add

Function Add(ByVal DataField As DataField, [ByVal Value As Variant]) As DataItem

DataItems

Description

The Add method adds a new data field to a shape and optionally sets its value.

If a data field is not a document default and is empty for the current shape, it will not be listed in the shape's DataItems collection (that is, it is not returned by the ObjectData property). In this case, the Add method is the only way to set some value to that field. If the field is already listed in the collection, the Add method returns the reference to its data item.

Parameters	Description

DataField	This parameter identifies the data field. A data field is a single property or value associated with a data item object. [in]

Value	This parameter associates a value for the new data field [in]
Optional

Return value

Returns DataItem

Examples

The following example adds a new data field with name "Weight" to the active shape and sets its value to 6. The Weight field must already be defined in the current document.

Sub Test()

Dim df As DataField

Dim di As DataItem

Set df = ActiveDocument.DataFields("Weight")

Set di = ActiveShape.ObjectData.Add(df)

di.Value = 6

End Sub

The following example adds a data field and sets its value to 10.

Sub Test()

Dim df As DataField

Dim di As DataItem

Set df = ActiveDocument.DataFields("Weight")

Set di = ActiveShape.ObjectData.Add(df, 10)

MsgBox "The new value of '" & df.Name & "' field is " & di.FormattedValue

End Sub

 Related Topics


DataItems.Clear

Sub Clear()

DataItems

Description

The Clear method clears the values of all data items associated with the given shape. A data item stores information about a shape object.

The Name and CDRStaticID fields are used by CorelDRAW to identify objects, and cannot be erased.

Example

The following example clears all value from all data fields for the currently selected shape.

Sub Test()

ActiveShape.ObjectData.Clear

End Sub

 Related Topics


DataItems.CopyFrom

Sub CopyFrom(ByVal Shape As Shape)

DataItems

Description

The CopyFrom method copies the data fields and values from a shape (data item) and copies them into another shape. A data item stores information about a shape object within the CorelDRAW development environment.

The CopyFrom method does not copy values from the CDRStaticID and Name fields.

Parameters	Description

Shape	The Shape parameter identifies the shape object whose data fields and values are copied and placed into another data item object. [in]

Example

The following example copies object data from the currently selected shape to the newly created ellipse.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveShape

Set s2 = ActiveLayer.CreateEllipse2(4, 5, 3)

s2.ObjectData.CopyFrom s1

End Sub

 Related Topics


Document properties

Document     Legend

    Active
    ActiveLayer
    ActivePage
    ActivePowerClip
    ActiveShape
    ActiveWindow
    Application
      ApplyToDuplicate
      CurvePrecision
    DataFields
      Dirty
      DrawingOriginX
      DrawingOriginY
      EditAcrossLayers
    FileName
    FilePath
    FullFileName
    Grid
    Index
      Keywords
      Name
      Notes
    Pages
    PageSizes
    Parent
    PDFSettings
      PreserveSelection
    PrintSettings
    Properties
      ReferencePoint
      Resolution
    Rulers
    SelectionInfo
    SelectionRange
      ShapeEnumDirection
    Title
      Unit
    Views
    Windows
      WorldScale


Document methods

Document     Legend

   Activate
   AddPages
   AddPagesEx
   BeginCommandGroup
   ClearSelection
   Close
   CreateView
   EndCommandGroup
   Export
   ExportBitmap
   ExportEx
   GetUserArea
   GetUserClick
   InsertPages
   InsertPagesEx
   PrintOut
   PublishToPDF
   Redo
   Repeat
   ResetSettings
   ResolveAllBitmapsLinks
   RestoreSettings
   Save
   SaveAs
   SaveSettings
   Selection
   Undo


Document events

Document

AfterPrint
AfterSave
AfterSaveAs
BeforeClose
BeforePrint
BeforeSave
BeforeSaveAs
LayerCreated
LayerDeleted
LayerSelected
PageCreated
PageDeleted
PageSelected
SelectionChanged
ShapeCreated
ShapeDeleted
ShapeMoved


Document

Class Document

Properties     Methods     Events     Referenced By

The Document class represents a CorelDRAW document.

 Related Topics


Document.Active

Property Active As Boolean

Document

Description

The Active property returns True if the document is currently being edited by the user.

Read-Only

Example

The following example displays the list of all documents currently open. Modified (and not saved) documents will have an asterisk (*) next to their names, and the current document will be marked as "Current."

Sub Test()

Dim d As Document

Dim s As String

s = "List of open documents:"

For Each d In Documents

s = s & vbCr & "- " & d.Title

If d.Dirty Then s = s & "*"

If d.Active Then s = s & " (Current)"

Next d

MsgBox s

End Sub

 Related Topics


Document.ActiveLayer

Property ActiveLayer As Layer

Document

Description

The ActiveLayer property represents the active layer of the current document.

Read-Only

Example

The following example moves all selected shapes to the active layer.

Sub Test()

ActiveDocument.Selection.Layer = ActiveDocument.ActiveLayer

End Sub

 Related Topics


Document.ActivePage

Property ActivePage As Page

Document

Description

The ActivePage property represents the active page of the current document.

Read-Only

Example

The following example shows the number and name of the current page in the first open document.

Sub Test()

Dim d As Document

Set d = Documents(1)

MsgBox "Current page is " & d.ActivePage.Index & " (" & d.ActivePage.Name & ")"

End Sub

 Related Topics


Document.ActivePowerClip

Property ActivePowerClip As PowerClip

Document

Description

The ActivePowerClip property returns the current PowerClip object being edited. See also PowerClip.

Read-Only

Example

The following example displays the number of shapes in the active PowerClip of the active document:

Sub PowerClip()

MsgBox ActiveDocument.ActivePowerClip.Shapes.Count

End Sub

 Related Topics


Document.ActiveShape

Property ActiveShape As Shape

Document

Description

The ActiveShape property returns the first selected shape in the document.

Unlike the Selection method, ActiveShape returns the actual shape selected, not the selection object.

Read-Only

Example

The following example applies the Brighten lens to the currently selected shape in the second open document.

Sub Test()

Documents(2).ActiveShape.CreateLens cdrLensBrighten, 50

End Sub

 Related Topics


Document.ActiveWindow

Property ActiveWindow As Window

Document

Description

The ActiveWindow property represents the active window.

Read-Only

Example

The following example sets the width of the active document window to half the size of the main application window, and then sets its zoom factor to 200%.

Sub Test()

Dim w As Window

Set w = ActiveDocument.ActiveWindow

w.WindowState = cdrWindowNormal

w.Width = AppWindow.Width / 2

w.ActiveView.Zoom = 200

End Sub

 Related Topics


Document.Application

Property Application As Application

Document

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Document.ApplyToDuplicate

Property ApplyToDuplicate As Boolean

Document

Description

The ApplyToDuplicate property lets you specify whether to create duplicates of objects while transforming them.

The ApplyToDuplicate property is used mainly for user interface compatibility and recording. Some commands may result in several duplicates and some may produce none. There is no way of referencing the duplicated shape; therefore, it is recommended that you use the Shape.Duplicate method to create duplicates of shapes. This method works almost as fast.

It is important to note that the ApplyToDuplicate property affects the global state of the document. Changing this property may affect other script execution. You should always restore the state of ApplyToDuplicate after using it.

Example

The following example creates an ellipse, and then moves it by one inch horizontally after creating a copy of it:

Sub Test()

Dim d As Document

Dim s As Shape

Dim b As Boolean

Set d = ActiveDocument

Set s = ActiveLayer.CreateEllipse2(4, 4, 2)

b = d.ApplyToDuplicate ' store previous state

d.ApplyToDuplicate = True

s.Move 1, 0

d.ApplyToDuplicate = b ' restore state

End Sub

 Related Topics


Document.CurvePrecision

Property CurvePrecision As Long

Document

Description

The CurvePrecision property determines the linearization factor for curves.

It is not possible to find the mathematically precise length of a Bezier curve, or to find a point along a curve at given distance from its beginning. In these cases, the curve is divided in a number of line segments (internally) while performing calculations. CurvePrecision determines how many line segments will constitute a single curve segment. Usually the value of 50 gives rather good approximation for most applications. Increasing this value will improve precision but also increase the computation time needed to perform an operation.

When you change these parameters, it is recommended that you preserve previous values and then restore them at the end of the script. You can use the SaveSettings and RestoreSettings methods of the Document object to do this or just store the property value in a local variable during macro execution.

This method only affects VBA methods and will have no effect on internal tools and algorithms of CorelDRAW.

Example

The following example creates a circle with diameter of 1", converts it to curves, and then shows the curve length with different curve precision settings.

Although the curve length in this example should be equal to pi (3.1415926...), it will never be very close to that because it is not possible to represent a perfect circle using cubic Bezier curves. That is, although an ellipse looks like an ellipse it is just a rough approximation.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(4, 5, 0.5)

s.ConvertToCurves

With ActiveDocument

.SaveSettings

.CurvePrecision = 10

MsgBox s.Curve.Length

.CurvePrecision = 50

MsgBox s.Curve.Length

.RestoreSettings

End With

End Sub

 Related Topics


Document.DataFields

Property DataFields As DataFields

Document

Description

The DataFields property returns the DataFields collection which represents a list of all object data fields defined in the document.

By default, CorelDRAW creates four data fields: Name, Cost, Comments, and CDRStaticID. The Cost and Comments fields are for your convenience, and can be edited or deleted as required. The Name and CDRStaticID fields are used by CorelDRAW to identify objects, and cannot be edited or deleted.

Read-Only

Example

The following example counts the number of data fields defined in the active document.

Sub Test()

Dim n As Long

n = ActiveDocument.DataFields.Count

MsgBox "There are " & n & " data fields defined"

End Sub

 Related Topics


Document.Dirty

Property Dirty As Boolean

Document

Description

The Dirty property returns or sets a value that determines whether the document was modified after it was last saved.

Example

The following example asks the user to save the document if the changes have not been saved, and then closes the document.

Sub Test()

If ActiveDocument.Dirty Then

If MsgBox("Document is modified. Save?", vbOKCancel) = vbCancel Then Exit Sub

ActiveDocument.Save

End If

ActiveDocument.Close

End Sub

 Related Topics


Document.DrawingOriginX

Property DrawingOriginX As Double

Document

Description

The DrawingOriginX property returns or sets the horizontal drawing origin for the center of coordinates for the document relative to the center of the page. By default, the center of coordinates is set to the lower left corner of a page.

Example

The following example moves the center of coordinates to the center of the page and creates a rectangle at this new center of coordinates. The center of coordinates is then moved back to the lower left corner of the page, and an ellipse is created at this modified center of coordinates.

Sub Test()

Dim d As Document

Set d = ActiveDocument

d.DrawingOriginX = 0

d.DrawingOriginY = 0

ActiveLayer.CreateRectangle 0, 0, 1, 1

d.DrawingOriginX = -d.ActivePage.SizeWidth / 2

d.DrawingOriginY = -d.ActivePage.SizeHeight / 2

ActiveLayer.CreateEllipse 0, 0, 1, 1

End Sub

 Related Topics


Document.DrawingOriginY

Property DrawingOriginY As Double

Document

Description

The DrawingOriginY property returns or sets the vertical drawing origin for the center of coordinates for the document relative to the center of the page. By default, the center of coordinates is set to the lower left corner of a page.

Example

The following example moves the center of coordinates to the center of the page and creates a rectangle at this new center of coordinates. The center of coordinates is then moved back to the lower left corner of the page, and an ellipse is created at this modified center of coordinates.

Sub Test()

Dim d As Document

Set d = ActiveDocument

d.DrawingOriginX = 0

d.DrawingOriginY = 0

ActiveLayer.CreateRectangle 0, 0, 1, 1

d.DrawingOriginX = -d.ActivePage.SizeWidth / 2

d.DrawingOriginY = -d.ActivePage.SizeHeight / 2

ActiveLayer.CreateEllipse 0, 0, 1, 1

End Sub

 Related Topics


Document.EditAcrossLayers

Property EditAcrossLayers As Boolean

Document

Description

The EditAcrossLayers property returns a value that indicates if editing objects on different layers is permitted. If this property is set to False, only objects on the active layer can be edited.

Example

The following example allows you to edit objects on several different layers.

Sub Edit()

ActiveDocument.EditAcrossLayers = True

End Sub

 Related Topics


Document.FileName

Property FileName As String

Document

Description

The FileName property returns the filename of a saved document.

See also the Title property.

Read-Only

Example

The following example displays the filename of the active document.

Sub Path()

MsgBox ActiveDocument.FileName

End Sub

 Related Topics


Document.FilePath

Property FilePath As String

Document

Description

The FilePath property returns the file path where a document is saved. The file path always ends with a backslash (\).

Read-Only

Example

The following example displays the file path of the active document.

Sub Path()

MsgBox ActiveDocument.FilePath

End Sub

 Related Topics


Document.FullFileName

Property FullFileName As String

Document

Description

The FullFileName property returns the filename and file path where a document is saved.

See also the Title property.

Read-Only

Example

The following example shows the path and filename of the document if the document has been saved to a file.

Sub Test()

If ActiveDocument.FullFileName = "" Then

MsgBox "Current document is not saved yet"

Else

MsgBox "Current document was saved to: " & ActiveDocument.FullFileName

End If

End Sub

 Related Topics


Document.Grid

Property Grid As Grid

Document

Description

The Grid property represents grid settings in CorelDRAW. See the Grid object for more details.

Read-Only

Example

The following example sets the Visible property of the grid to True, displaying the grid in the Drawing Window. The grid type pattern is set to dots and the SetFrequency method places 5 horizontal and vertical grid dots per square inch in the grid.

Sub GridType()

With ActiveDocument.Grid

.Visible = True

.Type = cdrGridDot

.SetFrequency 5, 5

End With

End Sub

 Related Topics


Document.Index

Property Index As Long

Document

Description

The Index property returns the index value associated with a document in the Documents collection.. The first document that was opened will have the index value of 1.

Read-Only

Example

The following example activates the first document that was opened if it is not the active document.

Sub Test()

If ActiveDocument.Index <> 1 Then Documents(1).Activate

End Sub

 Related Topics


Document.Keywords

Property Keywords As String

Document

Description

The Keywords property returns or sets the keywords for a document, as set in the Save as dialog box.

Example

The following example displays the keywords associated with the active document.

Sub Note()

MsgBox ActiveDocument.Keywords

End Sub

 Related Topics


Document.Name

Property Name As String

Document

Description

The Name property returns or sets the name of the VBA object for the current document. In CorelDRAW, this name is always "Thisdocument" unless changed by the user.

Example

The following example displays the name of the VBA project in a message box.

Sub DocName()

MsgBox ActiveDocument.Name

End Sub

 Related Topics


Document.Notes

Property Notes As String

Document

Description

The Notes property returns or sets the notes for a document, as set in the Save as dialog box.

Example

The following example displays the notes associated with the active document.

Sub Note()

MsgBox ActiveDocument.Notes

End Sub

 Related Topics


Document.Pages

Property Pages As Pages

Document

Description

The Pages property returns the Pages collection which represents all pages in the document.

Read-Only

Example

The following example creates black rectangles at the bottom of each page starting from the current page to the end of the document.

Sub Test()

Dim idx As Long, i As Long

Dim doc As Document

Dim p As Page

Dim s As Shape

Set doc = ActiveDocument

idx = doc.ActivePage.Index

For i = idx To doc.Pages.Count

Set p = doc.Pages(i)

Set s = p.ActiveLayer.CreateRectangle(0, 0, p.SizeWidth, 0.5)

s.Fill.UniformColor.CMYKAssign 0, 0, 0, 100

Next i

End Sub

 Related Topics


Document.PageSizes

Property PageSizes As PageSizes

Document

Description

The PageSizes property returns the collection of available page sizes.

Read-Only

Example

The following example displays all available page sizes.

Sub Test()

Dim ps As PageSize

Dim s As String

For Each ps In ActiveDocument.PageSizes

s = s & ps.Index & " - " & ps.Name & vbCrLf

Next ps

MsgBox s

End Sub

 Related Topics


Document.Parent

Property Parent As Documents

Document

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Document.PDFSettings

Property PDFSettings As PDFVBASettings

Document

Description

Document

The PDFSettings property returns the PDFVBASettings object that allows you to set options used when publishing to PDF.

Read-Only

Example

The following example publishes the current document to PDF with some of the settings changed from their defaults.

Sub Test()

With ActiveDocument.PDFSettings

.Author = "John Doe"

.ColorMode = pdfCMYK

.ComplexFillsAsBitmaps = True

.FountainSteps = 10

End With

ActiveDocument.PublishToPDF "C:\Temp\Document.pdf"

End Sub

 Related Topics


Document.PreserveSelection

Property PreserveSelection As Boolean

Document

Description

The PreserveSelection property returns or sets a value that indicates whether or not the current selection should always be preserved when changing properties of other shapes.

Generally when CorelDRAW changes a property of a shape (e.g. changing its size, fill, outline, etc), it must first select that shape. By default, CorelDRAW stores the current selection, then selects another object, modifies it, and restores the previous selection. This may cause a considerable slowdown in performance when many shapes are in the original selection. If the original selection is not important for macro execution, you can set the PreserveSelection property to False to improve macro performance.

It is important to restore the property's previous settings when exiting the macro; otherwise, your code may affect the execution of other macros. You can use the SaveSettings or RestoreSettings methods to save and restore the value of this property or simply assign it to a local variable.

Example

The following example counts the number of bitmaps in the active document.

Sub Test()

Dim s As Shape

Dim n As Long

ActiveDocument.SaveSettings

ActiveDocument.PreserveSelection = False

n = 0

For Each s In ActivePage.Shapes

If s.Type = cdrBitmapShape Then n = n + 1

Next s

ActiveDocument.RestoreSettings

MsgBox "There are " & n & " bitmaps in the current drawing"

End Sub

 Related Topics


Document.PrintSettings

Property PrintSettings As PrintSettings

Document

Description

The PrintSettings property returns the PrintSettings object that allows you to set different printing options for the document. Those options will be used when printing out the document.

Read-Only

Example

The following example prints the active document as separations.

Sub Test()

With ActiveDocument.PrintSettings

.Separations.Enabled = True

.Separations.SpotToCMYK = True

.Options.FountainSteps = 20

.Prepress.InfoWithinPage = True

.PostScript.Level = prnPSLevel1

End With

ActiveDocument.PrintOut

End Sub

 Related Topics


Document.Properties

Property Properties As Properties

Document

Description

The Properties property returns a Properties object that is used to store any custom data with the document.

The data is saved in a CDR file and retrieved the next time the document is opened. It is persistent, so you can use it to store global macro settings in the document. The data is available for VBA macros only and is not accessible in any way though CorelDRAW's user interface.

Read-Only

Example

The following example creates three different custom property records in the current document and then retrieves their values. The values will be saved along with the document and be available in the next session unless you delete them using the Delete or DeleteByIndex methods of the Properties object.

Sub Test()

Const MyMacroName As String = "MyTestMacro"

With ActiveDocument

.Properties(MyMacroName, 1) = "My String 1" ' String

.Properties(MyMacroName, 2) = 1 ' Integer

.Properties(MyMacroName, 3) = Atn(1) * 4    ' Double

MsgBox .Properties(MyMacroName, 1)

MsgBox .Properties(MyMacroName, 2)

MsgBox .Properties(MyMacroName, 3)

End With

End Sub

 Related Topics


Document.ReferencePoint

Property ReferencePoint As cdrReferencePoint

Document

Description

The ReferencePoint property specifies the reference point whose coordinates are set or retrieved. It controls how the PositionX and PositionY properties of shapes function.

The reference point defines a central point in the document for the positioning of objects in the document.

Example

The following example creates ellipses at four corners of the bounding box of the first selected object and in the center of the object.

Private Sub DrawEllipse(s As Shape)

ActiveDocument.ActiveLayer.CreateEllipse2 s.PositionX, s.PositionY, 0.1

End Sub

Sub Test()

Dim s As Shape

Set s = ActiveShape

ActiveDocument.ReferencePoint = cdrTopLeft

DrawEllipse s

ActiveDocument.ReferencePoint = cdrTopRight

DrawEllipse s

ActiveDocument.ReferencePoint = cdrBottomLeft

DrawEllipse s

ActiveDocument.ReferencePoint = cdrBottomRight

DrawEllipse s

ActiveDocument.ReferencePoint = cdrCenter

DrawEllipse s

End Sub

 Related Topics


Document.Resolution

Property Resolution As Long

Document

Description

The Resolution property returns or sets the document rendering resolution for bitmap-based effects (drop shadows, interactive transparency, etc), measured in dots per inch (dpi).

Example

The following example displays the current resolution.

Sub Test()

MsgBox "Current document resolution is " & _

ActiveDocument.Resolution & " dpi"

End Sub

 Related Topics


Document.Rulers

Property Rulers As Rulers

Document

Description

The Rulers property returns the Rulers collection of a document. It allows you to change the properties of rulers in the document window.

Read-Only

Example

The following example sets inches as the units of measurement for the horizontal ruler, and millimeters for the vertical one.

Sub Test()

ActiveDocument.Rulers.HUnits = cdrInch

ActiveDocument.Rulers.VUnits = cdrMillimeter

End Sub

 Related Topics


Document.SelectionInfo

Property SelectionInfo As SelectionInfo

Document

Description

The SelectionInfo property returns the SelectionInfo object.

Read-Only

Example

The following example displays the number of objects which are currently selected.

Sub Test()

MsgBox "There are currently " & ActiveDocument.SelectionInfo.Count & _

" objects selected."

End Sub

 Related Topics


Document.SelectionRange

Property SelectionRange As ShapeRange

Document

Description

The SelectionRange property represents the selected objects in the document and returns them as a ShapeRange object.

Read-Only

Example

The following example removes all text objects from the selection range.

Sub Test()

Dim sr As ShapeRange

Dim s As Shape

Set sr = ActiveDocument.SelectionRange

For Each s In sr

If s.Type = cdrTextShape Then s.RemoveFromSelection

Next s

End Sub

 Related Topics


Document.ShapeEnumDirection

Property ShapeEnumDirection As cdrShapeEnumDirection

Document

Description

The ShapeEnumDirection property returns or sets how shapes in the Shapes collection are enumerated. By default, the last created shape has the index of 1; that is, it is accessible as Shapes(1), and the value is set to cdrShapeEnumTopFirst. If the value is set to cdrShapeEnumBottomFirst, the first created shape has the index of 1.

Example

The following example creates an ellipse, then an artistic text object in a new document and applies a red fill to the ellipse (the bottommost object).

Sub Test()

Dim d As Document

Set d = CreateDocument

d.ShapeEnumDirection = cdrShapeEnumBottomFirst

d.ActiveLayer.CreateEllipse2 4, 4, 2

d.ActiveLayer.CreateArtisticText 0, 0, "Text"

d.ActiveLayer.Shapes(1).Fill.UniformColor.RGBAssign 255, 0, 0

End Sub

 Related Topics


Document.Title

Property Title As String

Document

Description

The Title property returns a value that identifies the title of a document. The Title property returns the full file name, acting the same way as the FullFileName property, except that you can return the title for a document that has not yet been saved. In this case, the property returns a string such as "Graphic1". This string is also shown in the document window caption.

Read-Only

Example

The following example displays the title of the active document.

Sub DocTitle()

MsgBox ActiveDocument.Title

End Sub

 Related Topics


Document.Unit

Property Unit As cdrUnit

Document

Description

The Unit property returns or sets the unit of measurement used in the document for position, size, and dimensions of objects.

Example

The following example creates a new document, moves the center of coordinates to the center of the page, and creates three circles with radii of 1 mm, 1cm, and 1 inch.

Sub Test()

Dim d As Document

Set d = CreateDocument

d.DrawingOriginX = 0

d.DrawingOriginY = 0

d.Unit = cdrMillimeter

d.ActiveLayer.CreateEllipse2 0, 0, 1

d.Unit = cdrCentimeter

d.ActiveLayer.CreateEllipse2 0, 0, 1

d.Unit = cdrInch

d.ActiveLayer.CreateEllipse2 0, 0, 1

End Sub

 Related Topics


Document.Views

Property Views As Views

Document

Description

The Views property returns the Views collection of all views saved in the View Manager Docker window.

Read-Only

Example

The following example creates a new document and saves the current view as "Saved View." Then it creates a rectangle, zooms in at it, saves the resulting view as "Full Rectangle," shows a message box, and restores the original view.

Sub Test()

Dim d As Document

Dim v As View

Dim s As Shape

Set d = CreateDocument

Set v = d.Views.AddActiveView("Saved View")

Set s = d.ActiveLayer.CreateRectangle(0, 0, 2, 2)

d.ActiveWindow.ActiveView.ToFitShape s

d.Views.AddActiveView "Full Rectangle"

MsgBox "Zoomed in at the rectangle. Press OK to restore view."

v.Activate

End Sub

 Related Topics


Document.Windows

Property Windows As Windows

Document

Description

The Windows property returns the Windows collection which represents all document windows.

A document can have more than one document window at a time. This collection contains document windows belonging to one document only.

Read-Only

Example

The following example looks through each open document and its windows, and closes all the windows leaving open only one window per document.

Sub WindowsItem()

Dim d As Document

Dim w As Window

For Each d In Documents

For Each w In d.Windows

If w.Index <> 1 Then w.Close

Next w

Next d

End Sub

 Related Topics


Document.WorldScale

Property WorldScale As Double

Document

Description

The WorldScale property returns or sets the drawing scale for a document. The drawing scale represents the document world scale; for example, 1:2 is a drawing scale where one drawing unit represents two world units.

Example

The following example sets the drawing scale to 2:1 and creates a 2"x2" rectangle which is represented as a 1"x1" rectangle in CorelDRAW.

Sub Test()

ActiveDocument.WorldScale = 0.5

ActiveDocument.ActiveLayer.CreateRectangle 0, 0, 2, 2

End Sub

 Related Topics


Document.Activate

Sub Activate()

Document

Description

The Activate method makes the document the active one (brings its window to the foreground).

opens a document in the main application window in CorelDRAW, if the window is not currently open, and makes the document active. A document in CorelDRAW is single page drawing or a collection of single-page drawings that make up a multi-page document.

Example

The following example copies all objects from the active document to the second document, page by page, and then activates the second document.

Sub Test()

Dim doc1 As Document, doc2 As Document

Dim p As Page

If Documents.Count <> 2 Then

MsgBox "2 documents must be open"

Exit Sub

End If

If ActiveDocument Is Documents(1) Then

Set doc1 = Documents(1)

Set doc2 = Documents(2)

Else

Set doc1 = Documents(2)

Set doc2 = Documents(1)

End If

If doc1.Pages.Count > doc2.Pages.Count Then

doc2.AddPages doc1.Pages.Count - doc2.Pages.Count

End If

For Each p In doc1.Pages

p.Activate

p.Shapes.All.Copy

doc2.Pages(p.Index).Activate

doc2.ActiveLayer.Paste

Next p

doc2.Activate

End Sub

 Related Topics


Document.AddPages

Function AddPages(ByVal NumberOfPages As Long) As Page

Document

Description

The AddPages method appends blank pages to the document. The first page added is returned.

Parameters	Description

NumberOfPages	Specifies the number of pages to add to a document [in]

Return value

Returns Page

Example

The following example opens an existing CorelDRAW (CDR) document, adds a page to the document, creates a colored ellipse on the new page, and saves the entire document:

Sub DocumentOpen()

Dim doc As Document

Set doc = OpenDocument("C:\Flower.cdr")

With doc

.AddPages (1)

.ActiveLayer.CreateEllipse(0, 3, 5, 1).Fill.UniformColor.CMYKAssign 0, 100, 100, 0

.Save

End With

End Sub

 Related Topics


Document.AddPagesEx

Function AddPagesEx(ByVal NumberOfPages As Long, ByVal Width As Double, ByVal Height As Double) As Page

Document

Description

The AddPagesEx method adds pages, with a specified height and width, to a document. The first page added is returned.

Parameters	Description

NumberOfPages	Identifies the number of pages to add to a document. [in]

Width	Specifies the width of the pages that are inserted in the document, measured in document units. [in]

Height	Specifies the width of the pages that are inserted in the document, measured in document units. [in]

Return value

Returns Page

Example

The following example opens an existing CorelDRAW (CDR) document, adds a page to the document that has a width and height of 10 document units, creates a colored ellipse on the new page, and saves the entire document.

Sub DocumentOpen()

Dim doc As Document

Set doc = OpenDocument("C:\Flower.cdr")

With doc

.AddPagesEx 1, 10, 10

.ActiveLayer.CreateEllipse(0, 3, 5, 1).Fill.UniformColor.CMYKAssign 0, 100, 100, 0

.Save

End With

End Sub

 Related Topics


Document.BeginCommandGroup

Sub BeginCommandGroup([ByVal CommandName As String])

Document

Description

The BeginCommandGroup method marks the start of a group of commands. By starting a command group, you define a sequence of document handling commands that you can undo in a single step.

The BeginCommandGroup and EndCommandGroup commands must be used with extreme caution. If an error occurs after BeginCommandGroup but before EndCommandGroup, and the macro is terminated, the undo stack of CorelDRAW for the current document becomes corrupt. You must ensure that EndCommandGroup is always issued after BeginCommandGroup. Proper error trapping is strongly recommended.

Parameters	Description

CommandName	Specifies a string value that identifies a series of document commands in a document [in]
Optional

Example

The following example creates a flower. After the macro finishes, its result can be undone in one step; the Edit menu displays an "Undo Flower" item.

Sub Test()

Const Leaves As Long = 30

Const Radius As Double = 2

Dim stp As Double

Dim i As Long

Dim d As Document

Dim s As Shape

stp = 360 / Leaves

Set d = ActiveDocument

d.DrawingOriginX = 0

d.DrawingOriginY = 0

d.BeginCommandGroup "Flower"

Set s = d.ActiveLayer.CreateEllipse2(0, 0, Radius)

s.Fill.UniformColor.RGBAssign 100, 50, 50

Set s = d.ActiveLayer.CreateEllipse2(Radius + 0.5, 0, 0.5, 0.25)

s.Fill.UniformColor.RGBAssign 255, 255, 0

s.RotationCenterX = 0

s.RotationCenterY = 0

d.ApplyToDuplicate = True

For i = 1 To Leaves - 1

s.Rotate i * stp

Next i

d.EndCommandGroup

End Sub

The BeginCommandGroup and EndCommandGroup commands must be used with extreme caution. If an error occurs after BeginCommandGroup but before EndCommandGroup and the macro is terminated, the undo stack of CorelDRAW for the current document will become corrupt. You must ensure that EndCommandGroup is always issued after BeginCommandGroup. Proper error trapping, such as in the following example, is strongly recommended.

Sub Test()

ActiveDocument.BeginCommandGroup "My Command"

On Error Goto ErrHandler

' Some commands go here

ExitSub:

ActiveDocument.EndCommandGroup

Exit Sub

ErrHandler:

MsgBox "Error occured: " & Err.Description

Resume ExitSub

End Sub

 Related Topics


Document.ClearSelection

Sub ClearSelection()

Document

Description

The ClearSelection method de-selects any selected objects.

Example

The following example creates a text object and then de-selects it.

Sub Test()

ActiveLayer.CreateArtisticText 0, 0, "Text string"

ActiveDocument.ClearSelection

End Sub

 Related Topics


Document.Close

Sub Close()

Document

Description

The Close method closes the document.

If the document has been modified, this command displays a message box that prompts you to save the changes. If you want to suppress this message, set the Dirty property to False before using the Close method.

Example

The following example closes the active document.

Sub Test()

ActiveDocument.Dirty = False

ActiveDocument.Close

End Sub

 Related Topics


Document.CreateView

Function CreateView(ByVal Name As String, ByVal OriginX As Double, ByVal OriginY As Double, [ByVal Zoom As Long = 0], [ByVal Page As Page = Nothing]) As View

Document

Description

The CreateView method creates a new View object (a new item in the View Manager list).

Parameters	Description

Name	Specifies a string value associated with the name of a view in CorelDRAW. [in]

OriginX	Specifies a value associated with the X coordinate of a view, measured in document units. [in]

OriginY	Specifies a value associated with the X coordinate of a view, measured in document units. [in]

Zoom	Specifies a user-defined magnification level for a customized view [in]
Optional
Default value = 0

Page	Identifies the view to a specific page in the document [in]
Optional
Default value = Nothing

Return value

Returns View

Example

The following example creates a new view and activates it.

Sub Test()

Dim v As View

Dim x As Double, y As Double

x = ActivePage.SizeWidth / 2

y = ActivePage.SizeHeight / 2

Set v = ActiveDocument.CreateView("My New View", x, y, 200)

v.Activate

End Sub

 Related Topics


Document.EndCommandGroup

Sub EndCommandGroup()

Document

Description

The EndCommandGroup method marks the end of a group of commands. By starting a command group, you define a sequence of document handling commands that you can undo in a single step.

The BeginCommandGroup and EndCommandGroup commands must be used with extreme caution. If an error occurs after BeginCommandGroup but before EndCommandGroup, and the macro is terminated, the undo stack of CorelDRAW for the current document becomes corrupt. You must ensure that EndCommandGroup is always issued after BeginCommandGroup. Proper error trapping is strongly recommended.

Example

The following example creates a flower. After the macro finishes, its result can be undone in one step; the Edit menu displays an "Undo Flower" item.

Sub Test()

Const Leaves As Long = 30

Const Radius As Double = 2

Dim stp As Double

Dim i As Long

Dim d As Document

Dim s As Shape

stp = 360 / Leaves

Set d = ActiveDocument

d.DrawingOriginX = 0

d.DrawingOriginY = 0

d.BeginCommandGroup "Flower"

Set s = d.ActiveLayer.CreateEllipse2(0, 0, Radius)

s.Fill.UniformColor.RGBAssign 100, 50, 50

Set s = d.ActiveLayer.CreateEllipse2(Radius + 0.5, 0, 0.5, 0.25)

s.Fill.UniformColor.RGBAssign 255, 255, 0

s.RotationCenterX = 0

s.RotationCenterY = 0

d.ApplyToDuplicate = True

For i = 1 To Leaves - 1

s.Rotate i * stp

Next i

d.EndCommandGroup

End Sub

The BeginCommandGroup and EndCommandGroup commands must be used with extreme caution. If an error occurs after BeginCommandGroup but before EndCommandGroup and the macro is terminated, the undo stack of CorelDRAW for the current document will become corrupt. You must ensure that EndCommandGroup is always issued after BeginCommandGroup. Proper error trapping, such as in the following example, is strongly recommended.

Sub Test()

ActiveDocument.BeginCommandGroup "My Command"

On Error Goto ErrHandler

' Some commands go here

ExitSub:

ActiveDocument.EndCommandGroup

Exit Sub

ErrHandler:

MsgBox "Error occured: " & Err.Description

Resume ExitSub

End Sub

 Related Topics


Document.Export

Sub Export(ByVal FileName As String, ByVal Filter As cdrFilter, [ByVal Range As cdrExportRange = cdrCurrentPage (1)], [ByVal Options As StructExportOptions = Nothing], [ByVal PaletteOptions As StructPaletteOptions = Nothing])

Document

Description

The Export method exports graphics to a file.

Parameters	Description

FileName	Specifies the string value that names the document you are exporting. [in]

Filter	Specifies the filter that is used when exporting objects. A filter is the name for an application that translates digital information from one form to another. Import/Export filters convert files from one format to another. When you select a file format in the Export dialog box of CorelDRAW, you automatically activate the appropriate filter application to perform the translation. [in]

Range	Specifies the pages that are exported. You have the option of exporting all or several pages in a document, a single page in a document, or a selection of objects within a document. [in]
Optional
Default value = cdrCurrentPage (1)

Options	Identifies the Save options of the document.[in]
Optional
Default value = Nothing

PaletteOptions	Specifies the set of options when exporting to a paletted bitmap [in]
Optional
Default value = Nothing

Example

The following example creates a rectangle with fountain fill and exports it to a JPEG file:

Sub Test()

Dim opt As New StructExportOptions

Dim s As Shape

ActiveDocument.Unit = cdrInch

Set s = ActiveLayer.CreateRectangle(0, 0, 1, 1)

s.Fill.ApplyFountainFill CreateColorEx(5005, 255, 0, 0), _

CreateColorEx(5005, 0, 0, 0)

opt.AntiAliasingType = cdrNormalAntiAliasing

opt.ImageType = cdrRGBColorImage

opt.Overwrite = True

opt.ResolutionX = 72

opt.ResolutionY = 72

opt.SizeX = opt.ResolutionX * s.SizeWidth

opt.SizeY = opt.ResolutionY * s.SizeHeight

ActiveDocument.Export "C:\Rect.jpg", cdrJPEG, cdrSelection, opt

End Sub

 Related Topics


Document.ExportBitmap

Function ExportBitmap(ByVal FileName As String, ByVal Filter As cdrFilter, [ByVal Range As cdrExportRange = cdrCurrentPage (1)], [ByVal ImageType As cdrImageType = cdrRGBColorImage (4)], [ByVal Width As Long = 0], [ByVal Height As Long = 0], [ByVal ResolutionX As Long = 72], [ByVal ResolutionY As Long = 72], [ByVal AntiAliasingType As cdrAntiAliasingType = cdrNormalAntiAliasing (1)], [ByVal Dithered As Boolean = False], [ByVal Transparent As Boolean = False], [ByVal UseColorProfile As Boolean = True], [ByVal MaintainLayers As Boolean = False], [ByVal Compression As cdrCompressionType = cdrCompressionNone (0)], [ByVal PaletteOptions As StructPaletteOptions = Nothing]) As ExportFilter

Document

Description

The ExportBitmap method exports the document to another file format and returns an ExportFilter object. This function uses the StructPaletteOptions object to specify image conversion parameters.

The ExportBitmap method is essentially equivalent to the ExportEx method, except that the parameters specified as part of StructExportOptions in the call to ExportEx are specified as "in-line" for the call to ExportBitmap. It is more convenient for exporting bitmap images; however, ExportBitmap still can be used to export vector format, if desired.

Parameters	Description

FileName	Specifies the name of the document you are saving. It becomes the Name of the document. [in]

Filter	Specifies the filter that is used when saving objects. A filter translates digital information from one form to another. Import/Export filters convert files from one format to another. When you select a file format in the Export dialog box of CorelDRAW, you automatically activate the appropriate filter application to perform the translation. The Filter parameter returns a value of cdrFilter. [in]

Range	Specifies the pages that are exported. You have the option of exporting all or several pages in a document, a single page in a document, or a selection of objects within a document. The Range parameter returns a value of cdrExportRange. [in]
Optional
Default value = cdrCurrentPage (1)

ImageType	Identifies the image type being exported. This value returns cdrImageType. [in]
Optional
Default value = cdrRGBColorImage (4)

Width	Sets the height of the bitmap, measured in document units. [in]
Optional
Default value = 0

Height	Sets the height of the bitmap, measured in document units. [in]
Optional
Default value = 0

ResolutionX	Specifies a numerical value that indicates the horizontal resolution level of an image that is exported [in]
Optional
Default value = 72

ResolutionY	Specifies a numerical value that indicates the vertical resolution level of an image that is exported [in]
Optional
Default value = 72

AntiAliasingType	Specifies a value that indicates the appearance of a bitmap image's edges when it is exported. The AntiAliasingType property returns a value of cdrAntiAliasingType. [in]
Optional
Default value = cdrNormalAntiAliasing (1)

Dithered	Specifies whether the image is dithered when exported [in]
Optional
Default value = False

Transparent	Lets you specify the transparency of the image [in]
Optional
Default value = False

UseColorProfile	Specifies whether to use the color profile when exporting the image [in]
Optional
Default value = True

MaintainLayers	Specifies whether to maintain layers [in]
Optional
Default value = False

Compression	Specifies the type of compression to apply [in]
Optional
Default value = cdrCompressionNone (0)

PaletteOptions	Specifies the set of options to apply when exporting to a paletted bitmap [in]
Optional
Default value = Nothing

Return value

Returns ExportFilter

Example

The following example exports the new document to JPEG.

Sub Test()

Dim d As Document

Dim s As Shape

Dim Filter As ExportFilter

Set d = CreateDocument

Set s = d.ActiveLayer.CreateEllipse2(4, 5, 2)

s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(0, 0, 0)

Set Filter = d.ExportBitmap("C:\Temp\Doc.jpeg", cdrJPEG, cdrCurrentPage, _

cdrRGBColorImage, 0, 0, 72, 72)

With Filter

.Compression = 80

.Optimized = True

.Smoothing = 50

.SubFormat = 1

.Progressive = False

.Finish

End With

End Sub

 Related Topics


Document.ExportEx

Function ExportEx(ByVal FileName As String, ByVal Filter As cdrFilter, [ByVal Range As cdrExportRange = cdrCurrentPage (1)], [ByVal Options As StructExportOptions = Nothing], [ByVal PaletteOptions As StructPaletteOptions = Nothing]) As ExportFilter

Document

Description

The ExportEx method exports a document, with specified options, to another file format, and returns an ExportFilter object. This function uses the StructExportOptions and StructPaletteOptions objects to specify image conversion and export parameters.

The ExportEx method returns a filter object that should be used to set additional filter parameters (such as JPEG compression, GIF transparent color, and so on) and finish the export.

Parameters	Description

FileName	Specifies the name of the document you are saving. It becomes the Name of the document. [in]

Filter	Specifies the filter that is used when saving objects. A filter translates digital information from one form to another. Import/Export filters convert files from one format to another. When you select a file format in the Export dialog box of CorelDRAW, you automatically activate the appropriate filter application to perform the translation.  The Filter parameter returns a value of cdrFilter. [in]

Range	Specifies the pages that are exported. You have the option of exporting all or several pages in a document, a single page in a document, or a selection of objects within a document. The Range parameter returns a value of cdrExportRange. [in]
Optional
Default value = cdrCurrentPage (1)

Options	Identifies the Save options of the exported document [in]
Optional
Default value = Nothing

PaletteOptions	Specifies the set of options to apply when exporting to a paletted bitmap [in]
Optional
Default value = Nothing

Return value

Returns ExportFilter

Example

The following example exports the newly created document to GIF format, allowing the user to set GIF properties and ensure that the image is interlaced.

Sub Test()

Dim d As Document

Dim s As Shape

Dim opt As New StructExportOptions

Dim pal As New StructPaletteOptions

Dim Filter As ExportFilter

Set d = CreateDocument

Set s = d.ActiveLayer.CreateEllipse2(4, 5, 2)

s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(0, 0, 0)

opt.AntiAliasingType = cdrNormalAntiAliasing

opt.ImageType = cdrRGBColorImage

opt.ResolutionX = 72

opt.ResolutionY = 72

pal.PaletteType = cdrPaletteOptimized

pal.NumColors = 16

pal.DitherType = cdrDitherNone

Set Filter = d.ExportEx("C:\Temp\Doc.gif", cdrGIF, cdrCurrentPage, opt, pal)

If Filter.ShowDialog() Then

If Not Filter.Interlaced Then

MsgBox "Interlaced is not specified... Fixing this."

Filter.Interlaced = True

End If

Filter.Finish

Else

MsgBox "Export canceled"

End If

End Sub

 Related Topics


Document.GetUserArea

Function GetUserArea(ByRef x1 As Double, ByRef y1 As Double, ByRef x2 As Double, ByRef y2 As Double, ByRef ShiftState As Long, ByVal TimeOut As Long, ByVal Snap As Boolean, ByVal CursorShape As cdrCursorShape) As Long

Document

Description

The GetUserArea method allows the user to specify a rectangular area in the document window (marquee select). It also retrieves information about the state of the Ctrl, Shift, and Alt keys at the time of the selection.

Parameters	Description

x1	Returns the horizontal coordinate for the upper left corner of a rectangle shape on the active page that defines the user area. This value is measured in document units. [out]

y1	Defines the vertical coordinate for the upper left corner of a rectangle shape on the active page that defines the user area. This value is measured in document units.. [out]

x2	Defines the horizontal coordinate for the lower right corner of a rectangle shape on the active page that defines the user area. This value is measured in document units.. [out]

y2	Defines the vertical coordinate for the lower right corner of a rectangle shape on the active page that defines the user area. This value is measured in document units.. [out]

ShiftState	Specifies the shift state [out]

TimeOut	Specifies the amount of time, in seconds, to wait for the user to click. Defaults to 10. [in]

Snap	Specifies whether to recognize the snap. This value defaults to True. 0 recognizes the snap, 1 ignores the snap. [in]

CursorShape	Specifies the shape of the cursor. This value returns cdrCursorShape. [in]

Return value

Returns Long

Example

The following example allows the user to select a rectangular area and then creates a rectangle with dimensions specified by the selection. If the user pressed Shift while making the selection, the rectangle will have round corners

Sub Test()

Dim x1 As Double, y1 As Double, x2 As Double, y2 As Double

Dim Shift As Long

Dim b As Boolean

Dim s As Shape

Dim cr As Long, cg As Long, cb As Long

b = ActiveDocument.GetUserArea(x1, y1, x2, y2, Shift, 10, False, cdrCursorEyeDrop)

If Not b Then

Set s = ActiveDocument.ActiveLayer.CreateRectangle(x1, y1, x2, y2)

If (Shift And 1) <> 0 Then ' Shift pressed

s.Rectangle.SetRoundness 50

End If

End If

End Sub

 Related Topics


Document.GetUserClick

Function GetUserClick(ByRef X As Double, ByRef Y As Double, ByRef ShiftState As Long, ByVal TimeOut As Long, ByVal Snap As Boolean, ByVal CursorShape As cdrCursorShape) As Long

Document

Description

The GetUserClick method allows the user to specify a point in the document window and return the coordinates of that point back to script. It also retrieves information about the state of the Ctrl, Shift, and Alt keys at the time of the click.

Parameters	Description

X	Returns the X coordinate of the selection click. [out]

Y	Returns the Y coordinate of the selection click. [out]

ShiftState	Specifies the shift state. [out]

TimeOut	Specifies the amount of time, in seconds, to wait for the user to click. This value defaults to 10. [in]

Snap	Specifies whether to recognize the snap [in]

CursorShape	Specifies the shape of the cursor [in]

Return value

Returns Long

Example

The following example retrieves the coordinates of the point where the user clicks and draws a circle at that point. The circle fill depends on the modifier key state. If the Shift is pressed while the user clicked, red is applied. If Ctrl is pressed, green is added. If Alt is pressed, blue is applied. Therefore, pressing Ctrl + Shift + Alt produces a yellow circle. The macro loops until the user presses Esc to abort the procedure or time out interval of ten seconds elapses.

Sub Test()

Dim x As Double, y As Double

Dim Shift As Long

Dim b As Boolean

Dim s As Shape

Dim cr As Long, cg As Long, cb As Long

b = False

While Not b

b = ActiveDocument.GetUserClick(x, y, Shift, 10, False, cdrCursorEyeDrop)

If Not b Then

Set s = ActiveLayer.CreateEllipse(x - 0.1, y - 0.1, x + 0.1, y + 0.1)

cr = 0

cg = 0

cb = 0

If (Shift And 1) <> 0 Then cr = 255 ' Shift depressed - Add Red

If (Shift And 2) <> 0 Then cg = 255 ' Ctrl depressed - Add Green

If (Shift And 4) <> 0 Then cb = 255 ' Alt depressed - Add Blue

s.Fill.UniformColor.RGBAssign cr, cg, cb

End If

Wend

End Sub

 Related Topics


Document.InsertPages

Function InsertPages(ByVal NumberOfPages As Long, ByVal BeforePage As Boolean, ByVal Page As Long) As Page

Document

Description

The InsertPages method inserts blank pages in a document. The first page added is returned. You can specify if the pages are inserted before the active page.

Parameters	Description

NumberOfPages	Specifies the number of pages to add to a document [in]

BeforePage	Specifies whether the pages are inserted before the active page in the document [in]

Page	Specifies the page where new pages are inserted [in]

Return value

Returns Page

Example

The following example adds four new pages before the current page, and creates a locked rectangle with different fountain fills on each new page.

Sub Test()

Const NumPages As Long = 4

Dim p As Page

Dim Idx As Long, i As Long

Set p = ActiveDocument.InsertPages(NumPages, True, ActivePage.Index)

Idx = p.Index

For i = Idx To Idx + NumPages - 1

Set p = ActiveDocument.Pages(i)

With p.ActiveLayer.CreateRectangle(0, 0, p.SizeWidth, p.SizeHeight)

.Fill.ApplyFountainFill CreateRGBColor((i - Idx) * 255 / NumPages, 0, 0), _

CreateRGBColor(0, 0, 0)

.Locked = True

End With

Next i

End Sub

 Related Topics


Document.InsertPagesEx

Function InsertPagesEx(ByVal NumberOfPages As Long, ByVal BeforePage As Boolean, ByVal Page As Long, ByVal Width As Double, ByVal Height As Double) As Page

Document

Description

The InsertPagesEx method inserts blank pages, with a specified height and width, to a document. The first page inserted is returned. You can specify if the pages are inserted before the active page.

Parameters	Description

NumberOfPages	Identifies the number of pages to add to a document [in]

BeforePage	Returns a value indicating if the pages are inserted before the active page in the document [in]

Page	Specifies the page where new pages are inserted [in]

Width	Specifies the width of the pages that are inserted in the document. This value is measured in document units. [in]

Height	Specifies the width of the pages that are inserted in the document. This value is measured in document units. [in]

Return value

Returns Page

Example

The following example adds four new pages before the current page, and creates a locked rectangle with different fountain fills on each new page.

Sub Test()

Const NumPages As Long = 4

Dim p As Page

Dim Idx As Long, i As Long

Set p = ActiveDocument.InsertPagesEx(NumPages, True, ActivePage.Index, 8.5, 11)

Idx = p.Index

For i = Idx To Idx + NumPages - 1

Set p = ActiveDocument.Pages(i)

With p.ActiveLayer.CreateRectangle(0, 0, p.SizeWidth, p.SizeHeight)

.Fill.ApplyFountainFill CreateRGBColor((i - Idx) * 255 / NumPages, 0, 0), _

CreateRGBColor(0, 0, 0)

.Locked = True

End With

Next i

End Sub

 Related Topics


Document.PrintOut

Sub PrintOut()

Document

Description

The PrintOut method prints the document using the options set earlier using the PrintSettings object.

Example

The following example prints the active document as separations.

Sub Test()

With ActiveDocument.PrintSettings

.Separations.Enabled = True

.Separations.SpotToCMYK = True

.Options.FountainSteps = 20

.Prepress.InfoWithinPage = True

.PostScript.Level = prnPSLevel1

End With

ActiveDocument.PrintOut

End Sub

 Related Topics


Document.PublishToPDF

Sub PublishToPDF(ByVal FileName As String)

Document

Description

Document

The PublishToPDF method performs publishing to PDF using the parameters set earlier using the PDFSettings property.

Parameters	Description

FileName	Specifies the full path name of the document that is published to PDF [in]

Example

The following example publishes the current document to PDF with some of the settings changed from their defaults.

Sub Test()

With ActiveDocument.PDFSettings

.Author = "John Doe"

.ColorMode = pdfCMYK

.ComplexFillsAsBitmaps = True

.FountainSteps = 10

End With

ActiveDocument.PublishToPDF "C:\Temp\Document.pdf"

End Sub

 Related Topics


Document.Redo

Sub Redo()

Document

Description

The Redo method reverses the last undo operation performed in the active document.

Example

The following example reverses the last undo operation in the active document.

Sub Reverse()

ActiveDocument.Redo

End Sub

 Related Topics


Document.Repeat

Sub Repeat()

Document

Description

The Repeat method repeats the last operation performed in the active document.

Example

The following example repeats the last operation in the active document.

Sub OnRepeat()

ActiveDocument.Repeat

End Sub

 Related Topics


Document.ResetSettings

Sub ResetSettings()

Document

Description

The ResetSettings method resets the following properties to the following values.

Example

The following example creates an ellipse with a radius 50 mm in the middle of the page. It preserves and restores all document settings.

Sub Test()

With ActiveDocument

.SaveSettings

.ResetSettings

.Unit = cdrMillimeter

.DrawingOriginX = 0

.DrawingOriginY = 0

.ActiveLayer.CreateEllipse2 0, 0, 50

.RestoreSettings

End With

End Sub

 Related Topics


Document.ResolveAllBitmapsLinks

Sub ResolveAllBitmapsLinks()

Document

Description

The ResolveAllBitmapLinks method resolves all links to externally linked bitmaps in the document and embeds the bitmaps in the document.

Example

The following example embeds all the bitmaps into the active document.

Sub Test()

ActiveDocument.ResolveAllBitmapLinks

End Sub

 Related Topics


Document.RestoreSettings

Sub RestoreSettings([ByVal Tag As String])

Document

Description

The RestoreSettings method retrieves the properties saved in the internal stack using the SaveSettings method. If the Tag parameter is not specified, the last saved values are retrieved. If the tag is specified, all properties are removed from the stack until the properties with the tag is located. If a stack underflow occurs, the properties are reset to the default values in the following table.

Parameters	Description

Tag	Describes the control whose value you want to preserve. The user can change the tag description to suit their needs. [in]
Optional

Example

The following example restores the document units to feet. The settings saved by the second SaveSettings method are discarded.

Sub Test()

With ActiveDocument

.Unit = cdrFoot

.SaveSettings "Settings1"

.Unit = cdrMillimeter

.SaveSettings "Settings2"

.Unit = cdrAgate

.RestoreSettings "Settings1"

End With

End Sub

 Related Topics


Document.Save

Sub Save()

Document

Description

The Save method saves the document to file.

Example

The following example saves the document to the original file if the document has been modified. It then creates a copy of the document, saving it in the CorelDRAW 9 file format.

Sub Test()

Dim opt As New StructSaveAsOptions

If ActiveDocument.Dirty Then ActiveDocument.Save

opt.EmbedICCProfile = False

opt.EmbedVBAProject = True

opt.Filter = cdrCDR

opt.IncludeCMXData = False

opt.Overwrite = True

opt.Range = cdrAllPages

opt.ThumbnailSize = cdr10KColorThumbnail

opt.Version = cdrVersion9

ActiveDocument.SaveAs "C:\Image9.cdr", opt

End Sub

 Related Topics


Document.SaveAs

Sub SaveAs(ByVal FileName As String, [ByVal Options As StructSaveAsOptions = Nothing])

Document

Description

The SaveAs method allows you to save the document to a different file and specify additional options through the StructSaveAsOptions object.

Parameters	Description

FileName	Specifies the name the document you are saving [in]

Options	Specifies the save options of the document [in]
Optional
Default value = Nothing

Example

The following example saves the document to the original file if the document has been modified. It then creates a copy of the document, saving it in the CorelDRAW 9 file format.

Sub Test()

Dim opt As New StructSaveAsOptions

If ActiveDocument.Dirty Then ActiveDocument.Save

opt.EmbedICCProfile = False

opt.EmbedVBAProject = True

opt.Filter = cdrCDR

opt.IncludeCMXData = False

opt.Overwrite = True

opt.Range = cdrAllPages

opt.ThumbnailSize = cdr10KColorThumbnail

opt.Version = cdrVersion9

ActiveDocument.SaveAs "C:\Image9.cdr", opt

End Sub

 Related Topics


Document.SaveSettings

Sub SaveSettings([ByVal Tag As String])

Document

Description

The SaveSettings method saves the properties to the internal stack. You can specify a tag for the saved values. The tag can be used to retrieve specific settings saved earlier.

You can use the SaveSettings method to preserve current document settings such as the values of the following document properties: CurvePrecision, DrawingOriginX, DrawingOriginY, ReferencePoint, Unit, PreserveSelection , ShapeEnumDirection, and ApplyToDuplicate.

Parameters	Description

Tag	Describes the control whose value you want to preserve. The user can change the tag description to suit their needs. [in]
Optional

Example

The following example restores the document units to feet. The settings saved by the second SaveSettings method are discarded.

Sub Test()

With ActiveDocument

.Unit = cdrFoot

.SaveSettings "Settings1"

.Unit = cdrMillimeter

.SaveSettings "Settings2"

.Unit = cdrAgate

.RestoreSettings "Settings1"

End With

End Sub

 Related Topics


Document.Selection

Function Selection() As Shape

Document

Description

The Selection property returns a special Selection shape that represents all selected shapes in the document.

You can use the Shapes collection of the Selection shape to access each individual selected shape. You can work with the Selection shape in almost the same way as you would with a regular shape. You can move, delete, and apply a fill/outline to it.

Return value

Returns Shape

Example

The following example sets the selected objects to the lower left corner of the page and stretches them so they fit in a box that is 3" by 3".

Sub Test()

Dim s As Shape

Set s = ActiveDocument.Selection

If s.Shapes.Count = 0 Then

MsgBox "No Object Selected"

Exit Sub

End If

ActiveDocument.ReferencePoint = cdrBottomLeft

s.SetPosition 0, 0

s.SetSize 3, 3

End Sub

 Related Topics


Document.Undo

Sub Undo()

Document

Description

The Undo method reverses the last operation performed in the active document.

Example

The following example reverses the last operation in the active document of CorelDRAW:

Sub Reverse()

ActiveDocument.ActiveLayer.CreateArtisticText 0, 0, "Text"

ActiveDocument.Undo

End Sub

 Related Topics


Document.AfterPrint

Event AfterPrint()

Document

Description

The AfterPrint event is triggered after a document is printed.

 Related Topics


Document.AfterSave

Event AfterSave(ByVal FileName As String)

Document

Description

The AfterSave event is triggered after a document is saved.

Parameters	Description

FileName	The FileName parameter identifies the file being saved in CorelDRAW. Once this file is saved, the AfterSave event is triggered and executed. [in]

 Related Topics


Document.AfterSaveAs

Event AfterSaveAs(ByVal FileName As String)

Document

Description

The AfterSaveAs event is triggered after a document is saved with the Save As feature.

Parameters	Description

FileName	Identifies the file being saved. Once this file is saved, the AfterSaveAs event is triggered and executed. [in]

 Related Topics


Document.BeforeClose

Event BeforeClose()

Document

Description

The BeforeClose event is triggered before a document is closed.

 Related Topics


Document.BeforePrint

Event BeforePrint()

Document

Description

The BeforePrint event is triggered before a document is printed.

 Related Topics


Document.BeforeSave

Event BeforeSave()

Document

Description

The BeforeSave event is triggered before the Save dialog box appears when you are saving a document.

 Related Topics


Document.BeforeSaveAs

Event BeforeSaveAs()

Document

Description

The BeforeSaveAs event is triggered before a document is saved with the Save As feature.

 Related Topics


Document.LayerCreated

Event LayerCreated(ByRef Layer As Layer)

Document

Description

The LayerCreated event is triggered after a layer is created in a document.

Parameters	Description

Layer	Identifies the layer that activates the LayerCreated event [in]

 Related Topics


Document.LayerDeleted

Event LayerDeleted(ByRef Layer As Layer)

Document

Description

The LayerDeleted event is triggered after a layer is deleted in a document.

Parameters	Description

Layer	Identifies the layer that activates the LayerDeleted event [in]

 Related Topics


Document.LayerSelected

Event LayerSelected(ByRef Layer As Layer)

Document

Description

The LayerSelected event is triggered after a layer is selected in a document.

Parameters	Description

Layer	Identifies the layer that activates the LayerSelected event [in]

 Related Topics


Document.PageCreated

Event PageCreated(ByRef Page As Page)

Document

Description

The PageCreated event is triggered after a page is created in a document.

Parameters	Description

Page	Identifies the page that activates the PageCreated event [in]

 Related Topics


Document.PageDeleted

Event PageDeleted(ByRef Page As Page)

Document

Description

The PageDeleted event is triggered after a page is deleted in a document.

Parameters	Description

Page	Identifies the page that activates the PageDeleted event [in]

 Related Topics


Document.PageSelected

Event PageSelected(ByRef Page As Page)

Document

Description

The PageSelected event is triggered after a page is selected in a document.

Parameters	Description

Page	Identifies the page that activates the PageSelected event [in]

 Related Topics


Document.SelectionChanged

Event SelectionChanged(ByRef Shape As Shape)

Document

Description

The SelectionChanged event is triggered when another shape object is selected in a document.

Parameters	Description

Shape	Identifies the shape that activates the SelectionChanged event [in]

 Related Topics


Document.ShapeCreated

Event ShapeCreated(ByRef Shape As Shape)

Document

Description

The ShapeCreated event is triggered after a shape is selected in a document.

Parameters	Description

Shape	Identifies the shape that activates the ShapeCreated event [in]

 Related Topics


Document.ShapeDeleted

Event ShapeDeleted(ByRef Shape As Shape)

Document

Description

The ShapeDeleted event is triggered after a shape object is deleted in a document.

Parameters	Description

Shape	The Shape parameter identifies the shape that activates the ShapeDeleted event when it is deleted in a document. [in]

 Related Topics


Document.ShapeMoved

Event ShapeMoved(ByRef Shape As Shape)

Document

Description

The ShapeMoved event is triggered when a shape object is moved in a document

Parameters	Description

Shape	Identifies the shape that activates the ShapeCreated event [in]

 Related Topics


Documents properties

Documents     Legend

    Application
    Count
  Item
    Parent


Documents

Class Documents

Properties     Referenced By

The Documents class represents all open documents in CorelDRAW. The order of the documents in the collection represents the order in which the documents were created or opened.

 Related Topics


Documents.Application

Property Application As Application

Documents

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Documents.Count

Property Count As Long

Documents

Description

The Count property returns the number of open documents in CorelDRAW.

Read-Only

Example

The following example displays the number of documents currently open.

Sub Test()

Select Case Documents.Count

Case 0

MsgBox "There's no documents open"

Case 1

MsgBox "There's 1 document open"

Case Else

MsgBox "There are " & Documents.Count & " documents open"

End Select

End Sub

 Related Topics


Documents.Item

Property Item(ByVal Index As Long) As Document

Documents

Description

The Item property returns the specified document. The Item property is the default property and the reference to it may be omitted when referencing items in the collection. For example, Documents.Item(2) is the same as Documents(2) - they both reference the second document in the Documents collection.

The order of the documents in the collection represents the order in which the documents were created or opened.

Read-Only

Parameters	Description

Index	Index is a preset placeholder for each document in a Documents collection; it uniquely identifies each member of the collection. [in]

Examples

The following example shows the list of open documents and the number of pages in each of them.

Sub Test()

Dim i As Long

Dim s As String

s = ""

For i = 1 To Documents.Count

s = s & "Document #" & i & ": " & Documents(i).Pages.Count & " page(s)" & vbCr

Next i

MsgBox s

End Sub

The following example performs the same procedure as the previous example. However, instead of using a For Next command, it uses the For Each command in Visual Basic to iterate through all documents in the collection.

Sub Test()

Dim d As Document

Dim s As String

s = ""

For Each d In Documents

s = s & "Document #" & d.Index & ": " & d.Pages.Count & " page(s)" & vbCr

Next d

MsgBox s

End Sub

 Related Topics


Documents.Parent

Property Parent As Application

Documents

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Effect properties

Effect     Legend

    Application
    Blend
    CloneParent
    Clones
    Contour
    ControlPath
    Distortion
    DropShadow
    Envelope
    Extrude
    Lens
    Parent
    Perspective
    TextOnPath
    Type


Effect methods

Effect     Legend

   Clear
   Separate


Effect

Class Effect

Properties     Methods     Referenced By

The Effect class represents an effect in CorelDRAW.

 Related Topics


Effect.Application

Property Application As Application

Effect

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Effect.Blend

Property Blend As EffectBlend

Effect

Description

The Blend property returns the EffectBlend object for the blend effect.

Read-Only

Example

The following example determines if a blend effect has been applied to the selected shape. If so, it changes the number of blend steps to three.

Sub Test()

Dim e As Effect

For Each e In ActiveShape.Effects

If e.Type = cdrBlend Then

e.Blend.Steps = 3

Exit For

End If

Next e

End Sub

 Related Topics


Effect.CloneParent

Property CloneParent As Effect

Effect

Description

The CloneParent property points to the effect object from which the current effect is cloned. Any changes to the clone parent effect will be automatically reflected in the cloned effect(s).

In order for this property to be effective, there must be a clone-master relationship between objects in the active document and the cloned object must be the active object.

Read-Only

Example

Sub Test()

ActiveShape.Effects(1).CloneParent.Blend.Steps = 5

End Sub

 Related Topics


Effect.Clones

Property Clones As Effects

Effect

Description

The Clones property returns the collection of effect objects that are clones of the current effect.

Read-Only

Example

The following example shows the number of effects cloned from the current effect.

Sub Test()

MsgBox ActiveShape.Effects(1).Clones.Count

End Sub

 Related Topics


Effect.Contour

Property Contour As EffectContour

Effect

Description

The Contour property returns the EffectContour object for the contour effect.

Read-Only

Example

The following example determines if a contour effect is applied to the selected shape. If so, it changes the type of color blend and the direction of the contour.

Sub Test()

Dim e As Effect

For Each e In ActiveShape.Effects

If e.Type = cdrContour Then

e.Contour.Direction = cdrContourOutside

e.Contour.ColorBlendType = cdrRainbowCWFountainFillBlend

Exit For

End If

Next e

End Sub

 Related Topics


Effect.ControlPath

Property ControlPath As EffectControlPath

Effect

Description

The ControlPath property returns the EffectControlPath object.

Read-Only

Example

The following example checks if there are any blends or text attached to the currently selected path. All blends are changed so that the object's transition in color from yellow to blue, and all text objects become filled with red.

Sub Test()

Dim e1 As Effect, e2 As Effect

For Each e1 In ActiveShape.Effects

If e1.Type = cdrControlPath Then

MsgBox "There are " & e1.ControlPath.Effects.Count & " effect objects on this path"

For Each e2 In e1.ControlPath.Effects

Select Case e2.Type

Case cdrTextOnPath

e2.TextOnPath.Text.Fill.UniformColor.RGBAssign 255, 0, 0

Case cdrBlend

e2.Blend.StartShape.Fill.UniformColor.RGBAssign 255, 255, 0

e2.Blend.EndShape.Fill.UniformColor.RGBAssign 0, 0, 255

End Select

Next e2

Exit For

End If

Next e1

End Sub

 Related Topics


Effect.Distortion

Property Distortion As EffectDistortion

Effect

Description

The Distortion property returns the EffectDistortion object for the distortion effect.

Read-Only

Example

The following example changes properties of the distortion effect for the active shape.

Sub Test()

Dim e As Effect

For Each e In ActiveShape.Effects

If e.Type = cdrDistortion Then

Select Case e.Distortion.Type

Case cdrDistortionZipper

e.Distortion.Zipper.Amplitude = 50

Case cdrDistortionTwister

e.Distortion.Twister.Angle = 120

Case cdrDistortionPushPull

e.Distortion.PushPull.Amplitude = 70

End Select

End If

Next e

End Sub

 Related Topics


Effect.DropShadow

Property DropShadow As EffectDropShadow

Effect

Description

The DropShadow property returns EffectDropShadow for the drop shadow effect.

Read-Only

Example

The following example changes properties of the drop shadow applied to the active shape.

Sub Test()

Dim e As Effect

For Each e In ActiveShape.Effects

If e.Type = cdrDropShadow Then

e.DropShadow.Color.RGBAssign 255, 0, 0

e.DropShadow.Feather = 30

End If

Next e

End Sub

 Related Topics


Effect.Envelope

Property Envelope As EffectEnvelope

Effect

Description

The Envelope property returns the EffectEnvelope object for the envelope effect.

Read-Only

Example

The following example selects a preset envelope for the selected shape.

Sub Test()

Dim e As Effect

For Each e In ActiveShape.Effects

If e.Type = cdrEnvelope Then

e.Envelope.Select 5

End If

Next e

End Sub

 Related Topics


Effect.Extrude

Property Extrude As EffectExtrude

Effect

Description

The Extrude property returns EffectExtrude object for the extrude effect.

Read-Only

Example

The following example checks all extruded objects on a page to make sure that no extrudes have an extrusion depth greater than 10.

Sub Test()

Dim s As Shape

Dim e As Effect

For Each s In ActivePage.Shapes

For Each e In s.Effects

If e.Type = cdrExtrude Then

If e.Extrude.Depth > 10 Then e.Extrude.Depth = 10

End If

Next e

Next s

End Sub

 Related Topics


Effect.Lens

Property Lens As EffectLens

Effect

Description

The Lens property returns the EffectLens object for the lens effect.

Read-Only

Example

The following example creates an ellipse and applies a frozen fisheye lens to it.

Sub Test()

Dim s As Shape, e As Effect

Dim x As Double, y As Double

x = ActivePage.SizeWidth / 2

y = ActivePage.SizeHeight / 2

Set s = ActiveLayer.CreateEllipse2(x, y, 2)

Set e = s.CreateLens(cdrLensFishEye, 100)

e.Lens.Freeze

End Sub

 Related Topics


Effect.Parent

Property Parent As Effects

Effect

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Effect.Perspective

Property Perspective As EffectPerspective

Effect

Description

The Perspective property returns the EffectPerspective object for the perspective effect.

Read-Only

Example

The following example creates a rectangular grid in the lower left corner of a 8.5" x 11" page, and applies horizontal perspective with a vanishing point at the lower right corner of the page. It then modifies the perspective to add a vertical vanishing point at the upper left corner of the page.

Sub Test()

Dim s As Shape, e As Effect

Set s = ActiveLayer.CreateGridBoxes(0, 0, 3, 3, 7, 7)

Set e = s.CreatePerspective(8.5, 0)

e.Perspective.VertVanishingPointX = 0

e.Perspective.VertVanishingPointY = 11

End Sub

 Related Topics


Effect.TextOnPath

Property TextOnPath As EffectTextOnPath

Effect

Description

The TextOnPath property returns the EffectTextOnPath object for fitting text to a path.

Read-Only

Example

The following example sets the distance between the text and its path to 1" for each object with text fit to a path on the active page.

Sub Test()

Dim s As Shape

Dim e As Effect

For Each s In ActivePage.FindShapes(Type:=cdrTextShape)

For Each e In s.Effects

If e.Type = cdrTextOnPath Then e.TextOnPath.DistanceFromPath = 1

Next e

Next s

End Sub

 Related Topics


Effect.Type

Property Type As cdrEffectType

Effect

Description

The Type property returns the type of the current effect. Depending on the type of effect, an object of the effect's properties (for example, blend, contour, distortion, and so on) is accessible.

The Type property returns a value of cdrEffectType.

Read-Only

Example

The following example changes all blends attached to the selected shape so that they have only two steps.

Sub Test()

Dim s As Shape

Dim eff As Effect

Set s = ActiveShape

For Each eff In s.Effects

If eff.Type = cdrBlend Then

eff.Blend.Steps = 2

End If

Next eff

End Sub

 Related Topics


Effect.Clear

Sub Clear()

Effect

Description

The Clear method removes the current effect from an object.

Example

The following example clears all effects applied to the active shape.

Sub Test()

Dim e As Effect

For Each e In ActiveShape.Effects

e.Clear

Next e

End Sub

 Related Topics


Effect.Separate

Function Separate() As ShapeRange

Effect

Description

The Separate method separates effect-generated shapes from their control object(s).

Return value

Returns ShapeRange

Example

The following example creates two circles, builds a blend effect between them, then separates the blend, ungroups the blend steps, and scatters them randomly.

Sub Test()

Dim s1 As Shape, s2 As Shape

Dim s As Shape

Dim g As ShapeRange, stps As ShapeRange

Set s1 = ActiveLayer.CreateEllipse(0, 0, 2, 2)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

Set s2 = ActiveLayer.CreateEllipse(6, 6, 7, 7)

s2.Fill.UniformColor.RGBAssign 255, 255, 0

s1.CreateBlend s2

Set g = s1.Effects(1).Separate

Set stps = g(1).Shapes.All

g(1).Ungroup

For Each s In stps

s.Move (Rnd() - 0.5) * s.SizeWidth, (Rnd() - 0.5) * s.SizeHeight

Next s

End Sub

 Related Topics


EffectArtistic properties

EffectArtistic     Legend

    Application
    Parent


EffectArtistic

Class EffectArtistic

Properties     Referenced By

The EffectArtistic class represents the properties of Artistic Effect objects.

This class is reserved for future development.

 Related Topics


EffectArtistic.Application

Property Application As Application

EffectArtistic

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


EffectArtistic.Parent

Property Parent As Pages

EffectArtistic

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


EffectBlend properties

EffectBlend     Legend

      AccelerateSize
      Angle
    Application
    BlendGroup
      ColorAcceleration
      ColorBlendType
      EndPoint
      EndShape
      EndShapeOffset
      FullPath
      LinkAcceleration
      Loop
      MapNodes
      Mode
    Parent
      Path
      RotateShapes
      Spacing
      SpacingAcceleration
      StartPoint
      StartShape
      StartShapeOffset
      Steps


EffectBlend methods

EffectBlend     Legend

   CopyFrom
   FuseEnd
   FuseStart
   Split


EffectBlend

Class EffectBlend

Properties     Methods     Referenced By

The EffectBlend class represents properties of a blend Effect.

 Related Topics


EffectBlend.AccelerateSize

Property AccelerateSize As Boolean

EffectBlend

Description

The AccelerateSize property returns or sets whether the size of blend steps accelerates along the path for a blend.

Example

The following example creates a non-uniform blend between a rectangle and a circle.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateEllipse2(2, 2, 1)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

Set s2 = ActiveLayer.CreateRectangle2(4, 4, 1, 1)

s2.Fill.UniformColor.RGBAssign 255, 255, 0

With s2.CreateBlend(s1).Blend

.LinkAcceleration = False

.ColorAcceleration = 50

.SpacingAcceleration = -50

.AccelerateSize = True

End With

End Sub

 Related Topics


EffectBlend.Angle

Property Angle As Double

EffectBlend

Description

The Angle property returns or sets the rotation angle of intermediate blend steps.

Example

The following example creates a blend between two rectangles. The intermediate blend objects are rotated by 360 degrees during the progression.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateRectangle2(0, 0, 3, 1)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

Set s2 = ActiveLayer.CreateRectangle2(4, 4, 3, 1)

s2.Fill.UniformColor.RGBAssign 255, 255, 0

With s2.CreateBlend(s1).Blend

.Loop = False

.Angle = 360

End With

End Sub

 Related Topics


EffectBlend.Application

Property Application As Application

EffectBlend

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


EffectBlend.BlendGroup

Property BlendGroup As Shape

EffectBlend

Description

The BlendGroup property returns a Shape object that represents a blend group (all intermediate blend steps).

Blend objects in a group should be separated before working with an individual blend object.

Read-Only

Example

The following example creates a blend between two circles, separates the blend, and moves the blend steps up and to the right. In this example, the Effect.Separate method returns a ShapeRange object, the first element of which is the same blend group shape.

Sub Test()

Dim s1 As Shape, s2 As Shape, eff As Effect, s As Shape

Set s1 = ActiveLayer.CreateEllipse(0, 10, 2, 8)

Set s2 = s1.Duplicate(5, -7)

s1.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s2.Fill.UniformColor.CMYKAssign 0, 100, 100, 0

Set eff = s2.CreateBlend(s1)

Set s = eff.Blend.BlendGroup

eff.Separate

s.Move 1, 1

End Sub

 Related Topics


EffectBlend.ColorAcceleration

Property ColorAcceleration As Long

EffectBlend

Description

The ColorAcceleration property returns or sets the rate of color acceleration along a path for a blend. Higher numbers allow the colors to move more quickly through the spectrum as they approach the end shape.

Example

The following example creates a non-uniform blend between a rectangle and a circle.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateEllipse2(2, 2, 1)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

Set s2 = ActiveLayer.CreateRectangle2(4, 4, 1, 1)

s2.Fill.UniformColor.RGBAssign 255, 255, 0

With s2.CreateBlend(s1).Blend

.LinkAcceleration = False

.ColorAcceleration = 50

.SpacingAcceleration = -50

.AccelerateSize = True

End With

End Sub

 Related Topics


EffectBlend.ColorBlendType

Property ColorBlendType As cdrFountainFillBlendType

EffectBlend

Description

The ColorBlendType property returns or sets the color transition mode for a blend.

This property returns cdrFountainFillBlendType.

Example

The following example finds blends with a rainbow color transition and changes them to direct color blends.

Sub Test()

Dim s As Shape

Dim b As EffectBlend

For Each s In ActivePage.Shapes

If s.Type = cdrBlendGroupShape Then

Set b = s.Effect.Blend

If b.ColorBlendType <> cdrDirectFountainFillBlend And _

b.ColorBlendType <> cdrCustomFountainFillBlend Then

b.ColorBlendType = cdrDirectFountainFillBlend

End If

End If

Next s

End Sub

 Related Topics


EffectBlend.EndPoint

Property EndPoint As SnapPoint

EffectBlend

Description

The EndPoint property returns or sets the ending mapped node for a blend. The starting and ending mapped nodes determine how the intermediate objects are transformed from the start shape to become the end shape.

Example

The following example creates a blend between a circle and a polygon, and specifies the key nodes on the two shapes that the blend will use as starting points of the shapes.

Sub Test()

Dim s1 As Shape, s2 As Shape, eff As Effect

Set s1 = ActiveLayer.CreateEllipse2(2, 9, 1)

Set s2 = ActiveLayer.CreatePolygon(4, 3, 6, 5, 5)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

s2.Fill.UniformColor.RGBAssign 255, 255, 0

Set eff = s1.CreateBlend(s2)

With eff.Blend

.MapNodes = True

.StartPoint = s1.SnapPoints(2)

.EndPoint = s2.SnapPoints(4)

End With

End Sub

 Related Topics


EffectBlend.EndShape

Property EndShape As Shape

EffectBlend

Description

The EndShape property returns or sets the end shape for a blend effect.

Example

The following example changes all blends to progress from yellow to green by changing the control shapes' fills.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrBlendGroupShape Then

s.Effect.Blend.StartShape.Fill.UniformColor.RGBAssign 255, 255, 0

s.Effect.Blend.EndShape.Fill.UniformColor.RGBAssign 0, 128, 0

End If

Next s

End Sub

 Related Topics


EffectBlend.EndShapeOffset

Property EndShapeOffset As Double

EffectBlend

Description

The EndShapeOffset returns or sets the offset from the path for the start shape of a blend.

Example

The following example creates a blend and attaches it to a path.

Sub Test()

Dim sPath As Shape, s1 As Shape, s2 As Shape, eff As Effect

Set sPath = ActiveLayer.CreateCurveSegment(0.6, 4.5, 7.8, 8.5, 5.2, 62, 5.3, -96)

Set s1 = ActiveLayer.CreateEllipse2(0, 0, 1)

Set s2 = s1.Duplicate(8, 11)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

s2.Fill.UniformColor.RGBAssign 255, 255, 0

Set eff = s1.CreateBlend(s2)

eff.Blend.Path = sPath

eff.Blend.StartShapeOffset = 1

eff.Blend.EndShapeOffset = 2.5

End Sub

 Related Topics


EffectBlend.FullPath

Property FullPath As Boolean

EffectBlend

Description

The FullPath property returns or sets whether a blend follows a full path. A value of True causes the blend to spread along the whole path.

Example

The following example creates a blend, attaches it to a path, and stretches it so that it follows the complete length of the path.

Sub Test()

Dim sPath As Shape, s1 As Shape, s2 As Shape

Set sPath = ActiveLayer.CreateCurveSegment(0.6, 4.5, 7.8, 8.5, 5.2, 62, 5.3, -96)

Set s1 = ActiveLayer.CreateEllipse2(0, 0, 1)

Set s2 = s1.Duplicate(5, 5)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

s2.Fill.UniformColor.RGBAssign 255, 255, 0

With s1.CreateBlend(s2).Blend

.Path = sPath

.FullPath = True

.RotateShapes = True

End With

End Sub

 Related Topics


EffectBlend.LinkAcceleration

Property LinkAcceleration As Boolean

EffectBlend

Description

The LinkAcceleration property returns or sets a value that links color acceleration to object spacing acceleration for a blend.

Example

The following example creates a non-uniform blend between a rectangle and a circle.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateEllipse2(2, 2, 1)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

Set s2 = ActiveLayer.CreateRectangle2(4, 4, 1, 1)

s2.Fill.UniformColor.RGBAssign 255, 255, 0

With s2.CreateBlend(s1).Blend

.LinkAcceleration = False

.ColorAcceleration = 50

.SpacingAcceleration = -50

.AccelerateSize = True

End With

End Sub

 Related Topics


EffectBlend.Loop

Property Loop As Boolean

EffectBlend

Description

The Loop property returns or sets value that indicates whether the blend steps should be placed on a loop.

Example

The following example creates a blend between two rectangles. The intermediate blend objects are rotated by 360° during the progression.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateRectangle2(0, 0, 3, 1)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

Set s2 = ActiveLayer.CreateRectangle2(4, 4, 3, 1)

s2.Fill.UniformColor.RGBAssign 255, 255, 0

With s2.CreateBlend(s1).Blend

.Loop = False

.Angle = 360

End With

End Sub

 Related Topics


EffectBlend.MapNodes

Property MapNodes As Boolean

EffectBlend

Description

The MapNodes property returns or sets whether the nodes are mapped for a blend. The starting and ending mapped nodes determine how the intermediate objects are transformed from the start shape to become the end shape.

Example

The following example creates a blend between a circle and a polygon, and specifies the key nodes on the two shapes that the blend will use as starting points of the shapes.

Sub Test()

Dim s1 As Shape, s2 As Shape, eff As Effect

Set s1 = ActiveLayer.CreateEllipse2(2, 9, 1)

Set s2 = ActiveLayer.CreatePolygon(4, 3, 6, 5, 5)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

s2.Fill.UniformColor.RGBAssign 255, 255, 0

Set eff = s1.CreateBlend(s2)

With eff.Blend

.MapNodes = True

.StartPoint = s1.SnapPoints(2)

.EndPoint = s2.SnapPoints(4)

End With

End Sub

 Related Topics


EffectBlend.Mode

Property Mode As cdrBlendMode

EffectBlend

Description

The Mode property returns or sets how the distance between steps is calculated.

This property returns cdrBlendMode.

Example

The following example creates a blend, attaches it to a path, and specifies that the blend steps should be placed at a fixed distance of 0.5" from each other

Sub Test()

Dim sPath As Shape, s1 As Shape, s2 As Shape

Set sPath = ActiveLayer.CreateCurveSegment(0.6, 4.5, 7.8, 8.5, 5.2, 62, 5.3, -96)

Set s1 = ActiveLayer.CreateEllipse2(0.6, 4.5, 1)

Set s2 = s1.Duplicate(7.4, 4)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

s2.Fill.UniformColor.RGBAssign 255, 255, 0

With s1.CreateBlend(s2).Blend

.Path = sPath

.Mode = cdrBlendSpacing

.Spacing = 0.5

End With

End Sub

 Related Topics


EffectBlend.Parent

Property Parent As Effect

EffectBlend

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


EffectBlend.Path

Property Path As Shape

EffectBlend

Description

The Path property returns or sets the shape to which the blend is attached.

Example

The following example creates a blend, attaches it to a path, and stretches it so that it follows the complete length of the path.

Sub Test()

Dim sPath As Shape, s1 As Shape, s2 As Shape

Set sPath = ActiveLayer.CreateCurveSegment(0.6, 4.5, 7.8, 8.5, 5.2, 62, 5.3, -96)

Set s1 = ActiveLayer.CreateEllipse2(0, 0, 1)

Set s2 = s1.Duplicate(5, 5)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

s2.Fill.UniformColor.RGBAssign 255, 255, 0

With s1.CreateBlend(s2).Blend

.Path = sPath

.FullPath = True

.RotateShapes = True

End With

End Sub

 Related Topics


EffectBlend.RotateShapes

Property RotateShapes As Boolean

EffectBlend

Description

The RotateShapes property returns or sets whether a blend rotates the blend shapes to follow the direction of the path.

Example

The following example creates a blend, attaches it to a path, and stretches it so that it follows the complete length of the path.

Sub Test()

Dim sPath As Shape, s1 As Shape, s2 As Shape

Set sPath = ActiveLayer.CreateCurveSegment(0.6, 4.5, 7.8, 8.5, 5.2, 62, 5.3, -96)

Set s1 = ActiveLayer.CreateRectangle2(0, 0, 1, 1)

Set s2 = s1.Duplicate(5, 5)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

s2.Fill.UniformColor.RGBAssign 255, 255, 0

With s1.CreateBlend(s2).Blend

.Path = sPath

.FullPath = True

.RotateShapes = True

End With

End Sub

 Related Topics


EffectBlend.Spacing

Property Spacing As Double

EffectBlend

Description

The Spacing property returns or set the spacing for a blend.

Example

The following example creates a blend, attaches it to a path, and creates blend steps that are a fixed distance of 0.5" from each other.

Sub Test()

Dim sPath As Shape, s1 As Shape, s2 As Shape

Set sPath = ActiveLayer.CreateCurveSegment(0.6, 4.5, 7.8, 8.5, 5.2, 62, 5.3, -96)

Set s1 = ActiveLayer.CreateEllipse2(0.6, 4.5, 1)

Set s2 = s1.Duplicate(7.4, 4)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

s2.Fill.UniformColor.RGBAssign 255, 255, 0

With s1.CreateBlend(s2).Blend

.Path = sPath

.Mode = cdrBlendSpacing

.Spacing = 0.5

End With

End Sub

 Related Topics


EffectBlend.SpacingAcceleration

Property SpacingAcceleration As Long

EffectBlend

Description

The SpacingAcceleration property returns or sets the rate of spacing acceleration along a path for a blend.

Example

The following example creates a non-uniform blend between a rectangle and a circle.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateEllipse2(2, 2, 1)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

Set s2 = ActiveLayer.CreateRectangle2(4, 4, 1, 1)

s2.Fill.UniformColor.RGBAssign 255, 255, 0

With s2.CreateBlend(s1).Blend

.LinkAcceleration = False

.ColorAcceleration = 50

.SpacingAcceleration = -50

.AccelerateSize = True

End With

End Sub

 Related Topics


EffectBlend.StartPoint

Property StartPoint As SnapPoint

EffectBlend

Description

The StartPoint property returns or sets the starting mapped node for a blend. The starting and ending mapped nodes determine how the intermediate objects are transformed from the start shape to become the end shape.

Example

The following example creates a blend between a circle and a polygon, and specifies the key nodes on the two shapes that the blend will use as starting points of the shapes.

Sub Test()

Dim s1 As Shape, s2 As Shape, eff As Effect

Set s1 = ActiveLayer.CreateEllipse2(2, 9, 1)

Set s2 = ActiveLayer.CreatePolygon(4, 3, 6, 5, 5)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

s2.Fill.UniformColor.RGBAssign 255, 255, 0

Set eff = s1.CreateBlend(s2)

With eff.Blend

.MapNodes = True

.StartPoint = s1.SnapPoints(2)

.EndPoint = s2.SnapPoints(4)

End With

End Sub

 Related Topics


EffectBlend.StartShape

Property StartShape As Shape

EffectBlend

Description

The StartShape property returns or sets the start shape for a blend effect.

Example

The following example changes all blends to progress from yellow to green by changing the control shapes' fills.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrBlendGroupShape Then

s.Effect.Blend.StartShape.Fill.UniformColor.RGBAssign 255, 255, 0

s.Effect.Blend.EndShape.Fill.UniformColor.RGBAssign 0, 128, 0

End If

Next s

End Sub

 Related Topics


EffectBlend.StartShapeOffset

Property StartShapeOffset As Double

EffectBlend

Description

The StartShapeOffset returns or sets the offset from the path for the start shape of a blend.

Example

The following example creates a blend and attaches it to a path.

Sub Test()

Dim sPath As Shape, s1 As Shape, s2 As Shape, eff As Effect

Set sPath = ActiveLayer.CreateCurveSegment(0.6, 4.5, 7.8, 8.5, 5.2, 62, 5.3, -96)

Set s1 = ActiveLayer.CreateEllipse2(0, 0, 1)

Set s2 = s1.Duplicate(8, 11)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

s2.Fill.UniformColor.RGBAssign 255, 255, 0

Set eff = s1.CreateBlend(s2)

eff.Blend.Path = sPath

eff.Blend.StartShapeOffset = 1

eff.Blend.EndShapeOffset = 2.5

End Sub

 Related Topics


EffectBlend.Steps

Property Steps As Long

EffectBlend

Description

The Steps property returns or sets the number of steps in a blend.

Example

The following example creates a blend, attaches it to a path, and creates 15 blend steps.

Sub Test()

Dim sPath As Shape, s1 As Shape, s2 As Shape

Set sPath = ActiveLayer.CreateCurveSegment(0.6, 4.5, 7.8, 8.5, 5.2, 62, 5.3, -96)

Set s1 = ActiveLayer.CreateEllipse2(0.6, 4.5, 1)

Set s2 = s1.Duplicate(7.4, 4)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

s2.Fill.UniformColor.RGBAssign 255, 255, 0

With s1.CreateBlend(s2).Blend

.Path = sPath

.Mode = cdrBlendSteps

.Steps = 15

End With

End Sub

 Related Topics


EffectBlend.CopyFrom

Function CopyFrom(ByVal Source As EffectBlend) As Boolean

EffectBlend

Description

The CopyFrom method copies the properties from one blend to another.

Parameters	Description

Source	Specifies a blend and copies its effect properties to the active blend [in]

Return value

Returns Boolean

Example

The following example creates a blend between two circles. It then creates another blend and copies the properties from the first one.

Sub Test()

Dim s1 As Shape, s2 As Shape, s3 As Shape, s4 As Shape

Dim Blend As EffectBlend

Set s1 = ActiveLayer.CreateEllipse2(0.6, 4.5, 1)

Set s2 = s1.Duplicate(7.4, 4)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

s2.Fill.UniformColor.RGBAssign 255, 255, 0

Set Blend = s1.CreateBlend(s2, 30, cdrRainbowCWFountainFillBlend).Blend

Set s3 = ActiveLayer.CreateEllipse2(0, 10, 1)

Set s4 = s3.Duplicate(5, -3)

s3.Fill.UniformColor.RGBAssign 0, 128, 0

s4.Fill.UniformColor.RGBAssign 0, 0, 255

s3.CreateBlend(s4).Blend.CopyFrom Blend

End Sub

 Related Topics


EffectBlend.FuseEnd

Function FuseEnd() As Boolean

EffectBlend

Description

The FuseEnd method fuses the end components of two blends, attached to one shape, into one blend by removing the intermediate shape.

Return value

Returns Boolean

Example

The following example creates two blends between three circles, and then merges the blends by removing the middle circle.

Sub Test()

Dim s1 As Shape, s2 As Shape, s3 As Shape

Dim eff As Effect

Set s1 = ActiveLayer.CreateEllipse2(0, 0, 1)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

Set s2 = s1.Duplicate(4, 3)

Set s3 = s1.Duplicate(8, 0)

s3.OrderFrontOf s2

s2.Fill.UniformColor.RGBAssign 255, 255, 0

Set eff = s1.CreateBlend(s2)

s2.CreateBlend s3

eff.Blend.FuseEnd

End Sub

 Related Topics


EffectBlend.FuseStart

Function FuseStart() As Boolean

EffectBlend

Description

The FuseStart method fuses the start components of two blends, attached to one shape, into one blend by removing the intermediate shape.

Return value

Returns Boolean

 Related Topics


EffectBlend.Split

Function Split(ByVal StepNo As Long) As Shape

EffectBlend

Description

The Split method splits a blend at a specified step. You can split a blend to create a compound blend. The shape in the blend at which point you choose to split the blend becomes the end shape for one component in the blend and the start shape for the other. Thus, the original blend is split into two components.

Parameters	Description

StepNo	Specifies the step in the blend where the split occurs [in]

Return value

Returns Shape

Example

The following example creates a blend between two circles, splits the blend in the middle and moves the intermediate control shape upwards by 3".

Sub Test()

Dim s1 As Shape, s2 As Shape, s3 As Shape

Dim eff As Effect

Set s1 = ActiveLayer.CreateEllipse2(0, 0, 1)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

Set s2 = s1.Duplicate(4, 0)

s2.Fill.UniformColor.RGBAssign 255, 255, 0

Set eff = s1.CreateBlend(s2, 15)

Set s3 = eff.Blend.Split(8)

s3.Move 0, 3

End Sub

 Related Topics


EffectContour properties

EffectContour     Legend

    Application
      ColorAcceleration
      ColorBlendType
    ContourGroup
      Direction
      FillColor
      FillColorTo
      LinkAcceleration
      Offset
      OutlineColor
    Parent
      SpacingAcceleration
      Steps


EffectContour

Class EffectContour

Properties     Referenced By

The EffectContour class represents the properties of contour Effect objects.

 Related Topics


EffectContour.Application

Property Application As Application

EffectContour

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


EffectContour.ColorAcceleration

Property ColorAcceleration As Long

EffectContour

Description

The ColorAcceleration property returns or sets the rate of color aceleration in a contour effect. Higher numbers allow the colors to move quicker through the spectrum as they approach the end object. You can change the progression of the outline and fill colors.

Example

The following example creates a contour effect with non-uniform spacing and color transition.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(5.5, 4, 2)

s.Fill.UniformColor.RGBAssign 255, 0, 0

s.Outline.SetProperties 0.05, , CreateRGBColor(0, 255, 255)

With s.CreateContour(cdrContourOutside, 0.5, 5, , , CreateRGBColor(255, 255, 0)).Contour

.LinkAcceleration = False

.ColorAcceleration = 50

.SpacingAcceleration = -50

End With

End Sub

 Related Topics


EffectContour.ColorBlendType

Property ColorBlendType As cdrFountainFillBlendType

EffectContour

Description

The ColorBlendType property returns or set the mode of the color blend of a fountain fill in a contour effect.

This property returns cdrFountainFillBlendType.

Example

The following example changes all clockwise rainbow color transitions to counterclockwise in contour effects.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrContour Then

If eff.Contour.ColorBlendType = cdrRainbowCWFountainFillBlend Then

eff.Contour.ColorBlendType = cdrRainbowCCWFountainFillBlend

End If

End If

Next eff

Next s

End Sub

 Related Topics


EffectContour.ContourGroup

Property ContourGroup As Shape

EffectContour

Description

The ContourGroup property returns the contour group as a Shape object.

Read-Only

Example

The following example creates an ellipse and a rectangle, and applies a contour effect to each shape. It then applies a perspective to the contour group.

Sub Test()

Dim s As Shape, s2 As Shape

Dim e As Effect

Set s = ActiveLayer.CreateEllipse2(5, 4, 2)

s.Fill.UniformColor.RGBAssign 255, 0, 0

Set s2 = ActiveLayer.CreateRectangle(3, 3, 5, 5)

s2.Fill.UniformColor.RGBAssign 0, 0, 255

For Each s In ActiveLayer.Shapes.All

Set e = s.CreateContour(cdrContourInside, , 5)

e.Contour.ContourGroup.CreatePerspective 2, 2

Next s

End Sub

 Related Topics


EffectContour.Direction

Property Direction As cdrContourDirection

EffectContour

Description

The Direction property returns or sets the direction of a contour effect.

This property returns a value of cdrContourDirection.

Example

The following example checks all contours on the current page and changes them as follows: all outside contours are to have twice as many steps, and all inside contours are to have a step distance of half of the previous size. The contours to the center of the shape are left unchanged.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrContour Then

Select Case eff.Contour.Direction

Case cdrContourOutside

eff.Contour.Steps = eff.Contour.Steps * 2

Case cdrContourInside

eff.Contour.Offset = eff.Contour.Offset / 2

Case cdrContourToCenter

' Do nothing

End Select

End If

Next eff

Next s

End Sub

 Related Topics


EffectContour.FillColor

Property FillColor As Color

EffectContour

Description

The FillColor property returns or sets the starting color of a fountain fill for the last contour shape.

Example

The following example creates a contour with a color transition in the fountain fill.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(4.25, 5.5, 2)

s.Fill.ApplyFountainFill CreateCMYKColor(100, 0, 0, 0), CreateCMYKColor(0, 0, 100, 0)

s.Outline.SetProperties 0.02, , CreateCMYKColor(0, 0, 100, 0)

With s.CreateContour(cdrContourOutside, 0.1, 20).Contour

.FillColor.CMYKAssign 0, 0, 100, 0

.FillColorTo.CMYKAssign 0, 100, 100, 0

.OutlineColor.CMYKAssign 100, 0, 100, 0

End With

End Sub

 Related Topics


EffectContour.FillColorTo

Property FillColorTo As Color

EffectContour

Description

The FillColorTo property returns or sets the ending color of a fountain fill for the last contour shape.

Example

The following example creates a contour with a color transition in the fountain fill.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(4.25, 5.5, 2)

s.Fill.ApplyFountainFill CreateCMYKColor(100, 0, 0, 0), CreateCMYKColor(0, 0, 100, 0)

s.Outline.SetProperties 0.02, , CreateCMYKColor(0, 0, 100, 0)

With s.CreateContour(cdrContourOutside, 0.1, 20).Contour

.FillColor.CMYKAssign 0, 0, 100, 0

.FillColorTo.CMYKAssign 0, 100, 100, 0

.OutlineColor.CMYKAssign 100, 0, 100, 0

End With

End Sub

 Related Topics


EffectContour.LinkAcceleration

Property LinkAcceleration As Boolean

EffectContour

Description

The LinkAcceleration property returns or sets whether color acceleration is linked to object spacing acceleration in a contour effect.

Example

The following example creates a contour effect with non-uniform spacing and color transition.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(5.5, 4, 2)

s.Fill.UniformColor.RGBAssign 255, 0, 0

s.Outline.SetProperties 0.05, , CreateRGBColor(0, 255, 255)

With s.CreateContour(cdrContourOutside, 0.5, 5, , , CreateRGBColor(255, 255, 0)).Contour

.LinkAcceleration = False

.ColorAcceleration = 50

.SpacingAcceleration = -50

End With

End Sub

 Related Topics


EffectContour.Offset

Property Offset As Double

EffectContour

Description

The Offset property returns or sets the offset distance, in document units, between contour lines in a contour effect. This automatically adjusts the number of contour steps.

Example

The following example checks all contours on the current page and changes them as follows: all outside contours are to have twice as many steps, and all inside contours are to have a step distance of half of the previous size. The contours to the center of the shape are left unchanged.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrContour Then

Select Case eff.Contour.Direction

Case cdrContourOutside

eff.Contour.Steps = eff.Contour.Steps * 2

Case cdrContourInside

eff.Contour.Offset = eff.Contour.Offset / 2

Case cdrContourToCenter

' Do nothing

End Select

End If

Next eff

Next s

End Sub

 Related Topics


EffectContour.OutlineColor

Property OutlineColor As Color

EffectContour

Description

The OutlineColor property returns or sets the outline color of the last contour step.

Example

The following example creates a contour with a color transition in the fountain fill.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(4.25, 5.5, 2)

s.Fill.ApplyFountainFill CreateCMYKColor(100, 0, 0, 0), CreateCMYKColor(0, 0, 100, 0)

s.Outline.SetProperties 0.02, , CreateCMYKColor(0, 0, 100, 0)

With s.CreateContour(cdrContourOutside, 0.1, 20).Contour

.FillColor.CMYKAssign 0, 0, 100, 0

.FillColorTo.CMYKAssign 0, 100, 100, 0

.OutlineColor.CMYKAssign 100, 0, 100, 0

End With

End Sub

 Related Topics


EffectContour.Parent

Property Parent As Effect

EffectContour

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


EffectContour.SpacingAcceleration

Property SpacingAcceleration As Long

EffectContour

Description

The SpacingAcceleration property returns or sets the rate of object acceleration in a contour effect. You can change the progression of the size of intermediate objects.

Example

The following example creates a contour effect with non-uniform spacing and color transition.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(5.5, 4, 2)

s.Fill.UniformColor.RGBAssign 255, 0, 0

s.Outline.SetProperties 0.05, , CreateRGBColor(0, 255, 255)

With s.CreateContour(cdrContourOutside, 0.5, 5, , , CreateRGBColor(255, 255, 0)).Contour

.LinkAcceleration = False

.ColorAcceleration = 50

.SpacingAcceleration = -50

End With

End Sub

 Related Topics


EffectContour.Steps

Property Steps As Long

EffectContour

Description

The Steps property returns or sets the number of steps in a contour effect.

Example

The following example checks all contours on the current page and changes them as follows: all outside contours are to have twice as many steps, and all inside contours are to have a step distance of half of the previous size. The contours to the center of the shape are left unchanged.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrContour Then

Select Case eff.Contour.Direction

Case cdrContourOutside

eff.Contour.Steps = eff.Contour.Steps * 2

Case cdrContourInside

eff.Contour.Offset = eff.Contour.Offset / 2

Case cdrContourToCenter

' Do nothing

End Select

End If

Next eff

Next s

End Sub

 Related Topics


EffectControlPath properties

EffectControlPath     Legend

    Application
    Effects
    Parent


EffectControlPath

Class EffectControlPath

Properties     Referenced By

The EffectControlPath class provides access to all effects that are attached to a path.

A control path is a curve that determines the shape of an Artistic Media stroke. When you edit an Artistic Media stroke, you edit the control path of the stroke. The stroke itself is a closed path following the control path. When you shape the control path, the stroke shifts according to how you edit the control path. If you want to edit the closed path directly, you must first separate it from the control path.

 Related Topics


EffectControlPath.Application

Property Application As Application

EffectControlPath

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


EffectControlPath.Effects

Property Effects As Effects

EffectControlPath

Description

The Effects property returns a collection of Effects that are attached to a path.

Read-Only

 Related Topics


EffectControlPath.Parent

Property Parent As Effect

EffectControlPath

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


EffectDistortion properties

EffectDistortion     Legend

    Application
      OriginX
      OriginY
    Parent
      PushPull
      Twister
      Type
      Zipper


EffectDistortion methods

EffectDistortion     Legend

   CenterDistortion


EffectDistortion

Class EffectDistortion

Properties     Methods     Referenced By

The EffectDistortion class represents properties of distortion Effect objects.

 Related Topics


EffectDistortion.Application

Property Application As Application

EffectDistortion

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


EffectDistortion.OriginX

Property OriginX As Double

EffectDistortion

Description

The OriginX property returns or sets the horizonal coordinate of the point of origin of a distortion effect. The coordinate is relative to the center of the shape.

This property is measured in document units.

Example

The following example applies a Zipper distortion to an ellipse, and then moves the shape's center by 1" to the right.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(1, 1, 1)

With s.CreateZipperDistortion(0, 0, 10, 6).Distortion

.OriginX = 1

.OriginY = 0

End With

End Sub

 Related Topics


EffectDistortion.OriginY

Property OriginY As Double

EffectDistortion

Description

The OriginY property returns or sets the vertical coordinate of the point of origin of a distortion effect. The coordinate is relative to the center of the shape.

This property is measured in document units.

Example

The following example applies a Zipper distortion to an ellipse, and then moves the shape's center by 1" to the right.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(1, 1, 1)

With s.CreateZipperDistortion(0, 0, 10, 6).Distortion

.OriginX = 1

.OriginY = 0

End With

End Sub

 Related Topics


EffectDistortion.Parent

Property Parent As Effect

EffectDistortion

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


EffectDistortion.PushPull

Property PushPull As EffectPushPullDistortion

EffectDistortion

Description

The PushPull property represents the properties of a Push and pull distortion object.

Example

The following example looks through all shapes and distortion effects. Depending on the type of distortion effect, corresponding effect parameters are altered.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrDistortion Then

Select Case eff.Distortion.Type

Case cdrDistortionPushPull

eff.Distortion.PushPull.Amplitude = 50

Case cdrDistortionTwister

eff.Distortion.Twister.Angle = 400

Case cdrDistortionZipper

eff.Distortion.Zipper.Smooth = True

End Select

End If

Next eff

Next s

End Sub

 Related Topics


EffectDistortion.Twister

Property Twister As EffectTwisterDistortion

EffectDistortion

Description

The Twister property represents the properties of a Twister distortion object.

Example

The following example looks through all shapes and distortion effects. Depending on the type of distortion effect, corresponding effect parameters are altered.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrDistortion Then

Select Case eff.Distortion.Type

Case cdrDistortionPushPull

eff.Distortion.PushPull.Amplitude = 50

Case cdrDistortionTwister

eff.Distortion.Twister.Angle = 400

Case cdrDistortionZipper

eff.Distortion.Zipper.Smooth = True

End Select

End If

Next eff

Next s

End Sub

 Related Topics


EffectDistortion.Type

Property Type As cdrDistortionType

EffectDistortion

Description

The Type property returns or sets the type of distortion. Depending on the value of Type property, one of the effect objects (PushPull, Twister, or Zipper) is accessible.

The Type property returns a value of cdrDistortionType.

Example

The following example looks through all shapes and distortion effects. Depending on the type of distortion effect, corresponding effect parameters are altered.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrDistortion Then

Select Case eff.Distortion.Type

Case cdrDistortionPushPull

eff.Distortion.PushPull.Amplitude = 50

Case cdrDistortionTwister

eff.Distortion.Twister.Angle = 400

Case cdrDistortionZipper

eff.Distortion.Zipper.Smooth = True

End Select

End If

Next eff

Next s

End Sub

 Related Topics


EffectDistortion.Zipper

Property Zipper As EffectZipperDistortion

EffectDistortion

Description

The Zipper property represents the properties of a Zipper distortion object.

Example

The following example looks through all shapes and distortion effects. Depending on the type of distortion effect, corresponding effect parameters are altered.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrDistortion Then

Select Case eff.Distortion.Type

Case cdrDistortionPushPull

eff.Distortion.PushPull.Amplitude = 50

Case cdrDistortionTwister

eff.Distortion.Twister.Angle = 400

Case cdrDistortionZipper

eff.Distortion.Zipper.Smooth = True

End Select

End If

Next eff

Next s

End Sub

 Related Topics


EffectDistortion.CenterDistortion

Sub CenterDistortion()

EffectDistortion

Description

The CenterDistortion method centers a distortion effect in its shape.

Example

The following example centers all distortion effects on the page.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrDistortion Then

eff.Distortion.CenterDistortion

End If

Next eff

Next s

End Sub

 Related Topics


EffectDropShadow properties

EffectDropShadow     Legend

    Application
      Color
      Fade
      Feather
      FeatherEdge
      FeatherType
      OffsetX
      OffsetY
      Opacity
    Parent
      PerspectiveAngle
      PerspectiveStretch
      Type


EffectDropShadow methods

EffectDropShadow     Legend

   SetOffset


EffectDropShadow

Class EffectDropShadow

Properties     Methods     Referenced By

The EffectDropShadow class represents the properties of drop shadow Effect objects.

 Related Topics


EffectDropShadow.Application

Property Application As Application

EffectDropShadow

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


EffectDropShadow.Color

Property Color As Color

EffectDropShadow

Description

The Color property returns or sets the Color object that represents the color of the drop shadow.

Example

The following example changes the color of all drop shadows to red.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrDropShadow Then

eff.DropShadow.Color.RGBAssign 255, 0, 0

End If

Next eff

Next s

End Sub

 Related Topics


EffectDropShadow.Fade

Property Fade As Long

EffectDropShadow

Description

The Fade property returns or sets the fading of a perspective drop shadow. Values range from 0% to 100%.

Example

The following example sets the fading of every perspective shadow to 80%.

Sub Test()

Dim s As Shape, ds As EffectDropShadow

For Each s In ActivePage.Shapes

If s.Type = cdrDropShadowGroupShape Then

Set ds = s.Effect.DropShadow

If ds.Type <> cdrDropShadowFlat Then

ds.Opacity = 100

ds.Fade = 80

End If

End If

Next s

End Sub

 Related Topics


EffectDropShadow.Feather

Property Feather As Long

EffectDropShadow

Description

The Feather property returns or sets the feathering length of a drop shadow. Values range from 0% to 100%. Low values create a more subtle feathering effect, while high values create a more pronounced effect.

Example

The following example applies 50% outside feathering with inverse squared edges to all drop shadows on the active page.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrDropShadowGroupShape Then

With s.Effect.DropShadow

.FeatherType = cdrFeatherOutside

.FeatherEdge = cdrEdgeInverseSquared

.Feather = 50

End With

End If

Next s

End Sub

 Related Topics


EffectDropShadow.FeatherEdge

Property FeatherEdge As cdrEdgeType

EffectDropShadow

Description

The FeatherEdge property returns or sets the type of feathering edge for a drop shadow. Values range from 0% to 100%.

This property returns cdrEdgeType.

Example

The following example applies 50% outside feathering with inverse squared edges to all drop shadows on the active page.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrDropShadowGroupShape Then

With s.Effect.DropShadow

.FeatherType = cdrFeatherOutside

.FeatherEdge = cdrEdgeInverseSquared

.Feather = 50

End With

End If

Next s

End Sub

 Related Topics


EffectDropShadow.FeatherType

Property FeatherType As cdrFeatherType

EffectDropShadow

Description

The FeatherType property returns or sets the type of feather for a drop shadow.

This property returns cdrFeatherType.

Example

The following example applies 50% outside feathering with inverse squared edges to all drop shadows on the active page.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrDropShadowGroupShape Then

With s.Effect.DropShadow

.FeatherType = cdrFeatherOutside

.FeatherEdge = cdrEdgeInverseSquared

.Feather = 50

End With

End If

Next s

End Sub

 Related Topics


EffectDropShadow.OffsetX

Property OffsetX As Double

EffectDropShadow

Description

The OffsetX property returns or sets the horizontal offset of a flat drop shadow.

See also the SetOffset method.

Example

The following example moves all flat drop shadows, so that the offset distance is 0.5 inch, while preserving the original offset angle.

Sub Test()

Const Radius As Double = 0.5

Dim s As Shape, ds As EffectDropShadow

Dim dx As Double, dy As Double, r As Double

For Each s In ActivePage.Shapes

If s.Type = cdrDropShadowGroupShape Then

Set ds = s.Effect.DropShadow

If ds.Type = cdrDropShadowFlat Then

dx = ds.OffsetX

dy = ds.OffsetY

r = Sqr(dx * dx + dy * dy)

If r = 0 Then

dx = 1

r = 1

End If

ds.OffsetX = dx * Radius / r

ds.OffsetY = dy * Radius / r

End If

End If

Next s

End Sub

 Related Topics


EffectDropShadow.OffsetY

Property OffsetY As Double

EffectDropShadow

Description

The OffsetY property returns or sets the vertical offset of a flat drop shadow.

See also the SetOffset method.

Example

The following example moves all flat drop shadows, so that the offset distance is 0.5 inch, while preserving the original offset angle.

Sub Test()

Const Radius As Double = 0.5

Dim s As Shape, ds As EffectDropShadow

Dim dx As Double, dy As Double, r As Double

For Each s In ActivePage.Shapes

If s.Type = cdrDropShadowGroupShape Then

Set ds = s.Effect.DropShadow

If ds.Type = cdrDropShadowFlat Then

dx = ds.OffsetX

dy = ds.OffsetY

r = Sqr(dx * dx + dy * dy)

If r = 0 Then

dx = 1

r = 1

End If

ds.OffsetX = dx * Radius / r

ds.OffsetY = dy * Radius / r

End If

End If

Next s

End Sub

 Related Topics


EffectDropShadow.Opacity

Property Opacity As Long

EffectDropShadow

Description

The Opacity property returns or sets the opacity value of a drop shadow. Values range from 0% to 100%. Low values create a less opaque drop shadow, while high values create a more opaque drop shadow.

Example

The following example sets the opacity of the selected drop shadow to 80%.

Sub Test()

Dim eff As Effect

Dim bDone As Boolean

If ActiveShape Is Nothing Then

MsgBox "Nothing selected", vbCritical

Exit Sub

End If

bDone = False

If ActiveShape.Next.Type = cdrDropShadowGroupShape Then

Set eff = ActiveShape.Next.Effect

eff.DropShadow.Opacity = 80

bDone = True

End If

If Not bDone Then

MsgBox "The selected shape doesn't have a dropshadow", vbCritical

End If

End Sub

 Related Topics


EffectDropShadow.Parent

Property Parent As Effect

EffectDropShadow

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


EffectDropShadow.PerspectiveAngle

Property PerspectiveAngle As Double

EffectDropShadow

Description

The PersectiveAngle returns or sets the angle of a perspective drop shadow.

Example

The following example converts all flat drop shadows to perspective drop shadows.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrDropShadowGroupShape Then

With s.Effect.DropShadow

If .Type = cdrDropShadowFlat Then

.Type = cdrDropShadowBottom

.PerspectiveAngle = 45

.PerspectiveStretch = -0.5

End If

End With

End If

Next s

End Sub

 Related Topics


EffectDropShadow.PerspectiveStretch

Property PerspectiveStretch As Double

EffectDropShadow

Description

The PerspectiveStretch returns or sets the stretch parameters of a perspective drop shadow.

Example

The following example converts all flat drop shadows to perspective drop shadows.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrDropShadowGroupShape Then

With s.Effect.DropShadow

If .Type = cdrDropShadowFlat Then

.Type = cdrDropShadowBottom

.PerspectiveAngle = 45

.PerspectiveStretch = -0.5

End If

End With

End If

Next s

End Sub

 Related Topics


EffectDropShadow.Type

Property Type As cdrDropShadowType

EffectDropShadow

Description

The Type property returns or sets the type of the drop shadow.

This property returns cdrDropShadowType.

Example

The following example selects all shapes with flat drop shadows on the page.

Sub Test()

Dim s As Shape

Dim sr As New ShapeRange

For Each s In ActivePage.Shapes

If s.Type = cdrDropShadowGroupShape Then

If s.Effect.DropShadow.Type = cdrDropShadowFlat Then

sr.Add s.Previous ' To select the control shape

sr.Add s ' To select the shadow bitmap itself

End If

End If

Next s

sr.CreateSelection

End Sub

 Related Topics


EffectDropShadow.SetOffset

Sub SetOffset(ByVal OffsetX As Double, ByVal OffsetY As Double)

EffectDropShadow

Description

The Offset property sets the horizontal and vertical offset of a flat drop shadow from its control object.

See also the OffsetX and OffsetY properties.

Parameters	Description

OffsetX	Sets the horizontal offset [in]

OffsetY	Sets the vertical offset [in]

Example

The following example moves all drop shadows by two document units to the right (along the x-axis) and one document unit down (along the y-axis).

Sub Test()

Dim s As Shape, ds As EffectDropShadow

For Each s In ActivePage.Shapes

If s.Type = cdrDropShadowGroupShape Then

Set ds = s.Effect.DropShadow

ds.SetOffset 2,-1

End If

Next s

End Sub

 Related Topics


EffectEnvelope properties

EffectEnvelope     Legend

    Application
      Container
      KeepLines
      Mode
    Parent


EffectEnvelope methods

EffectEnvelope     Legend

   CopyFrom
   CreateFrom
   Select


EffectEnvelope

Class EffectEnvelope

Properties     Methods     Referenced By

The EffectEnvelope class represents the properties of an envelope Effect. An envelope effect is a feature that allows you to distort the shape of an object. The distortion is created by changing the shape of an imaginary box, the envelope.

 Related Topics


EffectEnvelope.Application

Property Application As Application

EffectEnvelope

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


EffectEnvelope.Container

Property Container As Curve

EffectEnvelope

Description

The Container property represents a curve that defines the envelope's borders.

This property is reserved for future development.

 Related Topics


EffectEnvelope.KeepLines

Property KeepLines As Boolean

EffectEnvelope

Description

The KeepLines property returns or sets whether straight line segments are warped in the envelope. If the KeepLines property is True, the envelope effect keeps its lines straight.

Example

The following example creates a text object, applies an envelope effect to it, and then specifies that straight lines are to be preserved in the distorted text object.

Sub Test()

Dim s As Shape, eff As Effect

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

Set eff = s.CreateEnvelope(3)

eff.Envelope.KeepLines = True

End Sub

 Related Topics


EffectEnvelope.Mode

Property Mode As cdrEnvelopeMode

EffectEnvelope

Description

The Mode property returns or sets the mapping mode by which an object is fitted to an envelope.

The Mode property returns a value of cdrEnvelopeMode. There are four mapping modes: Horizontal, Original, Putty, and Vertical.

Example

The following code example selects all shapes to which envelopes with the Original mode have been applied.

Sub Test()

Dim s As Shape, eff As Effect

Dim sr As New ShapeRange

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrEnvelope Then

If eff.Envelope.Mode = cdrEnvelopeOriginal Then sr.Add s

Exit For

End If

Next eff

Next s

sr.CreateSelection

End Sub

 Related Topics


EffectEnvelope.Parent

Property Parent As Effect

EffectEnvelope

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


EffectEnvelope.CopyFrom

Sub CopyFrom(ByVal Source As EffectEnvelope)

EffectEnvelope

Description

The CopyFrom method copies the properties from one envelope effect to another.

If you've applied an effect to the object since you applied the envelope, you won't be able to copy the envelope.

Parameters	Description

Source	Specifies an envelope effect from which to copy its properties [in]

Example

The following example creates a text object and applies an envelope effect to it. It then creates a group of rectangles and applies an envelope to them, using the same parameters as the text's envelope.

Sub Test()

Dim s1 As Shape, s2 As Shape, eff As Effect

Set s1 = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s1.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

Set eff = s1.CreateEnvelope(3, cdrEnvelopePutty, True)

Set s2 = ActiveLayer.CreateGridBoxes(0, 0, 3, 3, 8, 8)

s2.CreateEnvelope(1).Envelope.CopyFrom eff.Envelope

End Sub

 Related Topics


EffectEnvelope.CreateFrom

Function CreateFrom(ByVal Shape As Shape) As Boolean

EffectEnvelope

Description

The CreateFrom method creates an envelope effect using a shape as a container.

Parameters	Description

Shape	Specifies the shape object with which to create a new envelope effect [in]

Return value

Returns Boolean

Example

The following example creates a text shape and places it in an star-shapaed envelope.

Sub Test()

Dim s1 As Shape, s2 As Shape, eff As Effect

Set s1 = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s1.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

Set eff = s1.CreateEnvelope(1)

Set s2 = ActiveLayer.CreatePolygon(0, 0, 3, 3, 5, , , True)

eff.Envelope.CreateFrom s2

End Sub

 Related Topics


EffectEnvelope.Select

Sub Select(ByVal PresetIndex As Long)

EffectEnvelope

Description

The Select method chooses a given envelope preset.

Parameters	Description

PresetIndex	Identifies an index number that uniquely identifies a preset envelope effect [in]

Example

The following example places a text object in a heart-shaped envelope.

Sub Test()

Dim s As Shape, eff As Effect

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

Set eff = s.CreateEnvelope(1)

eff.Envelope.Select 12

End Sub

 Related Topics


EffectExtrude properties

EffectExtrude     Legend

      AngleX
      AngleY
      AngleZ
    Application
      BaseColor
      BevelAngle
      BevelColor
      BevelDepth
    BevelGroup
      Depth
    ExtrudeGroup
    FaceShape
    FaceVisible
      LightIntensity
      LightPosition
      LightPresent
    Parent
      Shading
      ShadingColor
      ShowBevelOnly
      Type
      UseBevel
      UseExtrudeColorForBevel
      UseFullColorRange
      VanishingPoint


EffectExtrude methods

EffectExtrude     Legend

   CopyFrom
   Rotate
   SetBevel
   SetLight


EffectExtrude

Class EffectExtrude

Properties     Methods     Referenced By

The EffectExtrude class represents the properties of an extrude Effect.

 Related Topics


EffectExtrude.AngleX

Property AngleX As Double

EffectExtrude

Description

The AngleX property returns or sets the x-axis extrusion angle for an extruded object.

This property is a percentage that rotates the extrusion along the x-axis.

Example

The following example selects all objects with extrusions that were rotated in 3D space.

Sub Test()

Dim s As Shape, eff As Effect

Dim sr As New ShapeRange

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrExtrude Then

With eff.Extrude

If .AngleX <> 0 Or .AngleY <> 0 Or .AngleZ <> 0 Then sr.Add s

End With

Exit For

End If

Next eff

Next s

sr.CreateSelection

End Sub

 Related Topics


EffectExtrude.AngleY

Property AngleY As Double

EffectExtrude

Description

The AngleY property returns or sets the y-axis extrusion angle for an extruded object.

This property is a percentage that rotates the extrusion along the y-axis.

Example

The following example selects all objects with extrusions that were rotated in 3D space.

Sub Test()

Dim s As Shape, eff As Effect

Dim sr As New ShapeRange

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrExtrude Then

With eff.Extrude

If .AngleX <> 0 Or .AngleY <> 0 Or .AngleZ <> 0 Then sr.Add s

End With

Exit For

End If

Next eff

Next s

sr.CreateSelection

End Sub

 Related Topics


EffectExtrude.AngleZ

Property AngleZ As Double

EffectExtrude

Description

The AngleZ property returns or sets the z-axis extrusion angle for an extruded object.

This property is a percentage that rotates the extrusion along the z-axis.

Example

The following example selects all objects with extrusions that were rotated in 3D space.

Sub Test()

Dim s As Shape, eff As Effect

Dim sr As New ShapeRange

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrExtrude Then

With eff.Extrude

If .AngleX <> 0 Or .AngleY <> 0 Or .AngleZ <> 0 Then sr.Add s

End With

Exit For

End If

Next eff

Next s

sr.CreateSelection

End Sub

 Related Topics


EffectExtrude.Application

Property Application As Application

EffectExtrude

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


EffectExtrude.BaseColor

Property BaseColor As Color

EffectExtrude

Description

The BaseColor property returns or sets the solid fill or starting shading color for an extrusion.

Example

The following example creates an extruded text shape and shades the extrusion with a fountain color transition from red to yellow.

Sub Test()

Dim s As Shape, eff As Effect

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

Set eff = s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, 8)

With eff.Extrude

.Shading = cdrExtrudeColorShading

.BaseColor.RGBAssign 255, 0, 0

.ShadingColor.RGBAssign 255, 255, 0

End With

End Sub

 Related Topics


EffectExtrude.BevelAngle

Property BevelAngle As Double

EffectExtrude

Description

The BevelAngle returns or sets the bevel angle for an extrusion.

See also the SetBevel method.

Example

The following example creates an extruded text shape. The extrude is created with a yellow bevel that is 0.1 inch wide and has a slope of 45 degrees.

Sub Test()

Dim s As Shape, eff As Effect

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

Set eff = s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, _

8, , cdrExtrudeColorShading, CreateRGBColor(0, 0, 0), CreateRGBColor(255, 255, 255))

With eff.Extrude

.UseBevel = True

.BevelAngle = 45

.BevelDepth = 0.1

.UseExtrudeColorForBevel = False

.BevelColor.RGBAssign 255, 255, 0

End With

End Sub

 Related Topics


EffectExtrude.BevelColor

Property BevelColor As Color

EffectExtrude

Description

The BevelColor property returns or sets the bevel color for an extrusion.

See also the SetBevel method.

Example

The following example creates an extruded text shape. The extrude is created with a yellow bevel that is 0.1" wide and has a 45° slope.

Sub Test()

Dim s As Shape, eff As Effect

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

Set eff = s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, _

8, , cdrExtrudeColorShading, CreateRGBColor(0, 0, 0), CreateRGBColor(255, 255, 255))

With eff.Extrude

.UseBevel = True

.BevelAngle = 45

.BevelDepth = 0.1

.UseExtrudeColorForBevel = False

.BevelColor.RGBAssign 255, 255, 0

End With

End Sub

 Related Topics


EffectExtrude.BevelDepth

Property BevelDepth As Double

EffectExtrude

Description

The BevelDepth property returns or sets the bevel depth for an extrusion.

See also the SetBevel method.

Example

The following example creates an extruded text shape. The extrude is created with a yellow bevel that is 0.1" wide and has a 45° slope.

Sub Test()

Dim s As Shape, eff As Effect

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

Set eff = s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, _

8, , cdrExtrudeColorShading, CreateRGBColor(0, 0, 0), CreateRGBColor(255, 255, 255))

With eff.Extrude

.UseBevel = True

.BevelAngle = 45

.BevelDepth = 0.1

.UseExtrudeColorForBevel = False

.BevelColor.RGBAssign 255, 255, 0

End With

End Sub

 Related Topics


EffectExtrude.BevelGroup

Property BevelGroup As Shape

EffectExtrude

Description

The BevelGroup property returns a Shape object representing the bevel group.

You must separate the extrusion from its control shape before using the Shape object.

Read-Only

Example

The following example creates an extruded text shape with a bevel, separates the extrude, and moves the bevel group up by 3".

Sub Test()

Dim s As Shape, eff As Effect, sBevel As Shape

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

Set eff = s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, _

8, , cdrExtrudeColorShading, CreateRGBColor(0, 0, 0), CreateRGBColor(255, 255, 255), _

0.1, 45, CreateRGBColor(255, 0, 0))

Set sBevel = eff.Extrude.BevelGroup

' Effect.Separate doesn't work well on beveled extrudes

' So, let's use ActiveSelection.Separate instead

s.CreateSelection ' Select the control text object

eff.Extrude.ExtrudeGroup.Selected = True ' Add the extrude to the selection

sBevel.Selected = True ' Add the bevel group to the selection

ActiveSelection.Separate ' Separate the selection

sBevel.Move 0, 3

End Sub

 Related Topics


EffectExtrude.Depth

Property Depth As Long

EffectExtrude

Description

The Depth property returns or sets the extrude depth. This parameter cannot be used with a parallel extrusion..

Example

The following example selects all the extruded shapes whose extrusion depth is more than 20 units.

Sub Test()

Dim s As Shape, eff As Effect

Dim sr As New ShapeRange

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrExtrude Then

With eff.Extrude

If .Type <> cdrExtrudeFrontParallel And .Type <> cdrExtrudeFrontParallel Then

If .Depth > 20 Then

sr.Add s

If Not .ShowBevelOnly Then sr.Add .ExtrudeGroup

If .UseBevel Then sr.Add .BevelGroup

End If

End If

End With

Exit For

End If

Next eff

Next s

sr.CreateSelection

End Sub

 Related Topics


EffectExtrude.ExtrudeGroup

Property ExtrudeGroup As Shape

EffectExtrude

Description

The ExtrudeGroup property returns a Shape object which represents the extrude group.

You must separate the extrusion from its control shape before using the Shape object.

Read-Only

Example

The following example creates an extruded text shape with a bevel, separates the extrude, and moves the bevel group up by 3".

Sub Test()

Dim s As Shape, eff As Effect, sBevel As Shape

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

Set eff = s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, _

8, , cdrExtrudeColorShading, CreateRGBColor(0, 0, 0), CreateRGBColor(255, 255, 255), _

0.1, 45, CreateRGBColor(255, 0, 0))

Set sBevel = eff.Extrude.BevelGroup

' Effect.Separate doesn't work well on beveled extrudes

' So, let's use ActiveSelection.Separate instead

s.CreateSelection ' Select the control text object

eff.Extrude.ExtrudeGroup.Selected = True ' Add the extrude to the selection

sBevel.Selected = True ' Add the bevel group to the selection

ActiveSelection.Separate ' Separate the selection

sBevel.Move 0, 3

 Related Topics


EffectExtrude.FaceShape

Property FaceShape As Shape

EffectExtrude

Description

The FaceShape property returns a Shape object representing the control shape of the extrusion.

Read-Only

Example

The following example finds all extruded shapes on a page, fills the control shapes with yellow, and changes the extrude color to a two-color fountain fill that progresses from red to white.

Sub Test()

Dim s As Shape, ext As EffectExtrude

For Each s In ActivePage.Shapes

If s.Type = cdrExtrudeGroupShape Then

Set ext = s.Effect.Extrude

ext.FaceShape.Fill.UniformColor.RGBAssign 255, 255, 0

ext.Shading = cdrExtrudeColorShading

ext.BaseColor.RGBAssign 255, 0, 0

ext.ShadingColor.RGBAssign 255, 255, 255

End If

Next s

End Sub

 Related Topics


EffectExtrude.FaceVisible

Property FaceVisible As Boolean

EffectExtrude

Description

The FaceVisible property returns whether the control face is visible for an extrusion. It returns True if the extrude control shape is visible.

The face may not be visible if the extrude was rotated in 3D space or if one of the following extrusion type was used: Front Parallel, Small Front, or Big Front.

Read-Only

Example

The following example selects all extruded shapes whose faces are not visible.

Sub Test()

Dim s As Shape, ext As EffectExtrude

Dim sr As New ShapeRange

For Each s In ActivePage.Shapes

If s.Type = cdrExtrudeGroupShape Then

Set ext = s.Effect.Extrude

If ext.FaceVisible = False Then

sr.Add ext.FaceShape

If Not ext.ShowBevelOnly Then sr.Add s

If ext.UseBevel Then sr.Add ext.BevelGroup

End If

End If

Next s

sr.CreateSelection

End Sub

 Related Topics


EffectExtrude.LightIntensity

Property LightIntensity(ByVal Index As Long) As Long

EffectExtrude

Description

The LightIntensity property returns or sets the light intensity at a given index for an extrusion.

See also the SetLight method.

Parameters	Description

Index	Specifies the light source used for an extrusion.You can apply as many as three light sources. You can also remove applied light sources. [in]

Example

The following example creates an extrusion and adds two light sources to it.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

s.Fill.UniformColor.RGBAssign 0, 0, 255

With s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, _

8, , cdrExtrudeSolidFill, CreateRGBColor(255, 0, 0)).Extrude

.LightPresent(1) = True

.LightPosition(1) = cdrLightBackTopRight

.LightIntensity(1) = 100

.LightPresent(2) = True

.LightPosition(2) = cdrLightFrontCenter

.LightIntensity(2) = 50

.LightPresent(3) = False

.UseFullColorRange = True

End With

End Sub

 Related Topics


EffectExtrude.LightPosition

Property LightPosition(ByVal Index As Long) As cdrExtrudeLightPosition

EffectExtrude

Description

The LightPosition property returns or sets the light position at a given index for an extrusion.

This property returns cdrExtrudeLightPosition.

See also the SetLight method.

Parameters	Description

Index	Specifies the light source used for an extrusion.You can apply as many as three light sources. You can also remove applied light sources. [in]

Example

The following example creates an extrusion and adds two light sources to it.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

s.Fill.UniformColor.RGBAssign 0, 0, 255

With s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, _

8, , cdrExtrudeSolidFill, CreateRGBColor(255, 0, 0)).Extrude

.LightPresent(1) = True

.LightPosition(1) = cdrLightBackTopRight

.LightIntensity(1) = 100

.LightPresent(2) = True

.LightPosition(2) = cdrLightFrontCenter

.LightIntensity(2) = 50

.LightPresent(3) = False

.UseFullColorRange = True

End With

End Sub

 Related Topics


EffectExtrude.LightPresent

Property LightPresent(ByVal Index As Long) As Boolean

EffectExtrude

Description

The LightPresent property returns or sets whether light is present at a given index for an extrusion. You can specify up to three light sources.

See also the SetLight method.

Parameters	Description

Index	Specifies the light source used. You can apply as many as three light sources. You can also remove applied light sources. [in]

Example

The following example creates an extrusion and adds two light sources to it.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

s.Fill.UniformColor.RGBAssign 0, 0, 255

With s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, _

8, , cdrExtrudeSolidFill, CreateRGBColor(255, 0, 0)).Extrude

.LightPresent(1) = True

.LightPosition(1) = cdrLightBackTopRight

.LightIntensity(1) = 100

.LightPresent(2) = True

.LightPosition(2) = cdrLightFrontCenter

.LightIntensity(2) = 50

.LightPresent(3) = False

.UseFullColorRange = True

End With

End Sub

 Related Topics


EffectExtrude.Parent

Property Parent As Effect

EffectExtrude

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


EffectExtrude.Shading

Property Shading As cdrExtrudeShading

EffectExtrude

Description

The Shading property returns or sets the shading type for an extrusion.

This property returns cdrExtrudeShading.

Example

The following example creates an extruded text shape and shades the extrusion with a fountain color transition from red to yellow.

Sub Test()

Dim s As Shape, eff As Effect

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

Set eff = s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, 8)

With eff.Extrude

.Shading = cdrExtrudeColorShading

.BaseColor.RGBAssign 255, 0, 0

.ShadingColor.RGBAssign 255, 255, 0

End With

End Sub

 Related Topics


EffectExtrude.ShadingColor

Property ShadingColor As Color

EffectExtrude

Description

The ShadingColor property returns or sets the ending shading color for an extrusion.

Example

The following example creates an extruded text shape and shades the extrusion with a fountain color transition from red to yellow.

Sub Test()

Dim s As Shape, eff As Effect

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

Set eff = s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, 8)

With eff.Extrude

.Shading = cdrExtrudeColorShading

.BaseColor.RGBAssign 255, 0, 0

.ShadingColor.RGBAssign 255, 255, 0

End With

End Sub

 Related Topics


EffectExtrude.ShowBevelOnly

Property ShowBevelOnly As Boolean

EffectExtrude

Description

The ShowBevelOnly property returns or sets whether to show only the bevel of an extrusion. When set to True, only the extrude bevel is visible.

Example

The following example finds extruded text shapes. It adds a bevel to extrusions and makes only the bevel visible.

Sub Test()

Dim s As Shape, ext As EffectExtrude

For Each s In ActivePage.Shapes

If s.Type = cdrExtrudeGroupShape Then

Set ext = s.Effect.Extrude

If ext.FaceShape.Type = cdrTextShape And Not ext.UseBevel Then

ext.UseBevel = True

ext.BevelAngle = 45

ext.BevelDepth = 0.1

ext.UseExtrudeColorForBevel = True

ext.ShowBevelOnly = True

End If

End If

Next s

End Sub

 Related Topics


EffectExtrude.Type

Property Type As cdrExtrudeType

EffectExtrude

Description

The Type property returns or sets the extrude type for an extrusion.

This property returns cdrExtrudeType.

Example

The following example changes the type of all extrusions from "Back Parallel" to "Small Back."

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrExtrudeGroupShape Then

If s.Effect.Extrude.Type = cdrExtrudeBackParallel Then

s.Effect.Extrude.Type = cdrExtrudeSmallBack

End If

End If

Next s

End Sub

 Related Topics


EffectExtrude.UseBevel

Property UseBevel As Boolean

EffectExtrude

Description

The UseBevel property returns or sets whether to use a bevel for an extrusion. It also allows you to set options for a bevel.

See also the SetBevel method.

Example

The following example creates an extruded text shape. The extrude is created with a yellow bevel that is 0.1" wide and has a 45° slope.

Sub Test()

Dim s As Shape, eff As Effect

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

Set eff = s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, _

8, , cdrExtrudeColorShading, CreateRGBColor(0, 0, 0), CreateRGBColor(255, 255, 255))

With eff.Extrude

.UseBevel = True

.BevelAngle = 45

.BevelDepth = 0.1

.UseExtrudeColorForBevel = False

.BevelColor.RGBAssign 255, 255, 0

End With

End Sub

 Related Topics


EffectExtrude.UseExtrudeColorForBevel

Property UseExtrudeColorForBevel As Boolean

EffectExtrude

Description

The UseExtrudeColorForBevel property returns or sets whether to use the same color for the bevel and the rest of the extrusion.

See also the SetBevel method.

Example

The following example creates an extruded text shape. The extrude is created with a yellow bevel that is 0.1" wide and has a 45° slope.

Sub Test()

Dim s As Shape, eff As Effect

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

Set eff = s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, _

8, , cdrExtrudeColorShading, CreateRGBColor(0, 0, 0), CreateRGBColor(255, 255, 255))

With eff.Extrude

.UseBevel = True

.BevelAngle = 45

.BevelDepth = 0.1

.UseExtrudeColorForBevel = False

.BevelColor.RGBAssign 255, 255, 0

End With

End Sub

 Related Topics


EffectExtrude.UseFullColorRange

Property UseFullColorRange As Boolean

EffectExtrude

Description

The UseFullColorRange property returns or sets whether to combine light and dark shades (brightness and saturation) of a light source precisely for an extrusion.

See also the SetLight method.

Example

The following example creates an extrusion and adds two light sources to it.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

s.Fill.UniformColor.RGBAssign 0, 0, 255

With s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, _

8, , cdrExtrudeSolidFill, CreateRGBColor(255, 0, 0)).Extrude

.LightPresent(1) = True

.LightPosition(1) = cdrLightBackTopRight

.LightIntensity(1) = 100

.LightPresent(2) = True

.LightPosition(2) = cdrLightFrontCenter

.LightIntensity(2) = 50

.LightPresent(3) = False

.UseFullColorRange = True

End With

End Sub

 Related Topics


EffectExtrude.VanishingPoint

Property VanishingPoint As ExtrudeVanishingPoint

EffectExtrude

Description

The VanishingPoint property returns or sets an ExtrudeVanishingPoint object that allows you to change the coordinates of an extrude's vanishing point.

Example

The following example sets the vanishing point to the center of the control shape.

Sub Test()

Dim s As Shape, ext As EffectExtrude

ActiveDocument.ReferencePoint = cdrCenter

For Each s In ActivePage.Shapes

If s.Type = cdrExtrudeGroupShape Then

Set ext = s.Effect.Extrude

With ext.VanishingPoint

.Type = cdrVPLockedToShape

.PositionX = 0

.PositionY = 0

End With

End If

Next s

End Sub

 Related Topics


EffectExtrude.CopyFrom

Sub CopyFrom(ByVal Source As EffectExtrude)

EffectExtrude

Description

The CopyFrom method copies the extrusion properties from one extrusion to another.

Parameters	Description

Source	Identifies the extrusion whose properties are copied to another [in]

Example

The following example creates an extruded text shape and copies extrusion properties from the selected extruded shape.

Sub Test()

Dim s As Shape, ext As EffectExtrude

If ActiveShape Is Nothing Then

MsgBox "Nothing selected", vbCritical

Exit Sub

End If

Select Case ActiveShape.Type

Case cdrExtrudeGroupShape

Set s = ActiveShape

Case cdrBevelGroupShape

Set s = ActiveShape.Next.Next

Case Else

If ActiveShape.Next.Type = cdrExtrudeGroupShape Then

Set s = ActiveShape.Next

Else

MsgBox "An extruded shape must be selected"

Exit Sub

End If

End Select

Set ext = s.Effect.Extrude

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

s.Fill.UniformColor.RGBAssign 0, 0, 255

With s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, 8).Extrude

.CopyFrom ext

End With

End Sub

 Related Topics


EffectExtrude.Rotate

Sub Rotate(ByVal AngleX As Double, ByVal AngleY As Double, ByVal AngleZ As Double)

EffectExtrude

Description

The Rotate method rotates an extrusion in 3D space.

See also the AngleX, AngleY, and AngleZ properties.

Parameters	Description

AngleX	Sets the degree of the rotation along the x-axis [in]

AngleY	Sets the degree of the rotation along the y-axis [in]

AngleZ	Sets the degree of the rotation along the z-axis [in]

Example

The following example creates a rotated and extruded text shape.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

s.Fill.UniformColor.RGBAssign 0, 0, 255

s.Outline.SetProperties 0.01, , CreateRGBColor(0, 0, 0)

With s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, 8, , cdrExtrudeSolidFill, CreateRGBColor(0, 128, 0)).Extrude

.Rotate 10, 20, 30

End With

End Sub

 Related Topics


EffectExtrude.SetBevel

Sub SetBevel(ByVal Depth As Double, ByVal Angle As Double, ByVal ShowBevelOnly As Boolean)

EffectExtrude

Description

The SetBevel method sets the all the properties for the bevel in an extrusion.

Parameters	Description

Depth	Sets the depth percentage of the bevel [in]

Angle	Sets the degree of the bevel [in]

ShowBevelOnly	Sets avalue that indicates whether to show only the bevel in the extrude effect [in]

Example

The following example creates an extruded text shape with a bevel.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

s.Fill.UniformColor.RGBAssign 0, 0, 255

s.Outline.SetProperties 0.01, , CreateRGBColor(0, 0, 0)

With s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, 8, , cdrExtrudeSolidFill, CreateRGBColor(0, 128, 0)).Extrude

.SetBevel 0.05, 45, False

.UseExtrudeColorForBevel = False

.BevelColor.RGBAssign 255, 255, 0

End With

End Sub

 Related Topics


EffectExtrude.SetLight

Sub SetLight(ByVal Index As Long, ByVal Position As cdrExtrudeLightPosition, ByVal LightIntensity As Long)

EffectExtrude

Description

The SetLight method enables the given light source and specifies its properties for an extrusion.

See also LightPresent, LightPosition, and LightIntensity properties.

Parameters	Description

Index	Specifies the index where the light property is set [in]

Position	Specifies the position of the light property in the extrude effect. This value returns cdrExtrudeLightPosition. [in]

LightIntensity	Sets the light intensity [in]

Example

The following example creates an extrusion with two light sources.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(2.75, 5, "Text")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

s.Fill.UniformColor.RGBAssign 0, 0, 255

With s.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4, _

8, , cdrExtrudeSolidFill, CreateRGBColor(255, 0, 0)).Extrude

.SetLight 1, cdrLightBackTopRight, 100

.SetLight 2, cdrLightFrontCenter, 50

.LightPresent(3) = False

End With

End Sub

 Related Topics


EffectLens properties

EffectLens     Legend

    Application
      Color
      ColorMapPalette
      FillColor
      FromColor
    Frozen
      Magnification
      OutlineColor
      PaletteRotation
    Parent
      Rate
      RemoveFace
    Shapes
      ToColor
      Type
      UseFillColor
      UseOutlineColor
      UseViewPoint
      ViewPointX
      ViewPointY


EffectLens methods

EffectLens     Legend

   Freeze
   Unfreeze
   Ungroup


EffectLens

Class EffectLens

Properties     Methods     Referenced By

The EffectLens class represents the properties of lens Effect objects.

 Related Topics


EffectLens.Application

Property Application As Application

EffectLens

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


EffectLens.Color

Property Color As Color

EffectLens

Description

The Color property returns or sets the color of a lens.

This property is available for the following types of lenses: Color add, Color limit, Tinted grayscale, and Transparency.

The following lens types do not accept any color parameters: Brighten, Fish eye, Heat map, Invert, and Magnify.

Example

The following example changes the color of all lenses on the page to red. For the Custom color map and Wireframe lenses, yellow is also used.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrLens Then

Select Case eff.Lens.Type

Case cdrLensColorAdd, cdrLensColorLimit, _

cdrLensTintedGrayscale, cdrLensTransparency

eff.Lens.Color.RGBAssign 255, 0, 0

Case cdrLensCustomColorMap

eff.Lens.FromColor.RGBAssign 255, 0, 0

eff.Lens.ToColor.RGBAssign 255, 255, 0

Case cdrLensWireframe

With eff.Lens

.UseFillColor = True

.UseOutlineColor = True

.FillColor.RGBAssign 255, 0, 0

.OutlineColor.RGBAssign 255, 255, 0

End With

End Select

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectLens.ColorMapPalette

Property ColorMapPalette As cdrFountainFillBlendType

EffectLens

Description

The ColorMapPalette property returns or sets the color blending mode to use for a Custom color map lens.

This property returns cdrFountainFillBlendType.

Example

The following example creates a Custom color map lens with a Forward rainbow color blend.

Sub Test()

Dim s As Shape, eff As Effect

Set s = ActiveLayer.CreateRectangle(0, 0, 5, 5)

s.Fill.ApplyFountainFill

Set s = ActiveLayer.CreateEllipse(1, 1, 6, 6)

Set eff = s.CreateLens(cdrLensCustomColorMap, , CreateRGBColor(255, 0, 0), CreateRGBColor(255, 255, 0))

eff.Lens.ColorMapPalette = cdrRainbowCWFountainFillBlend

End Sub

 Related Topics


EffectLens.FillColor

Property FillColor As Color

EffectLens

Description

The FillColor property returns or sets the fill color for a Wireframe lens.

The following lens types do not accept any color parameters: Brighten, Fish eye, Heat map, Invert, and Magnify.

Example

The following example changes the color of all lenses on the page to red. For the Custom color map and Wireframe lenses, yellow is also used.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrLens Then

Select Case eff.Lens.Type

Case cdrLensColorAdd, cdrLensColorLimit, _

cdrLensTintedGrayscale, cdrLensTransparency

eff.Lens.Color.RGBAssign 255, 0, 0

Case cdrLensCustomColorMap

eff.Lens.FromColor.RGBAssign 255, 0, 0

eff.Lens.ToColor.RGBAssign 255, 255, 0

Case cdrLensWireframe

With eff.Lens

.UseFillColor = True

.UseOutlineColor = True

.FillColor.RGBAssign 255, 0, 0

.OutlineColor.RGBAssign 255, 255, 0

End With

End Select

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectLens.FromColor

Property FromColor As Color

EffectLens

Description

The FromColor property returns or sets the starting color for the Custom Color Map lens.

The following lens types do not accept any color parameters: Brighten, Fish eye, Heat map, Invert, and Magnify.

Example

The following example changes the color of all lenses on the page to red. For the Custom color map and Wireframe lenses, yellow is also used.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrLens Then

Select Case eff.Lens.Type

Case cdrLensColorAdd, cdrLensColorLimit, _

cdrLensTintedGrayscale, cdrLensTransparency

eff.Lens.Color.RGBAssign 255, 0, 0

Case cdrLensCustomColorMap

eff.Lens.FromColor.RGBAssign 255, 0, 0

eff.Lens.ToColor.RGBAssign 255, 255, 0

Case cdrLensWireframe

With eff.Lens

.UseFillColor = True

.UseOutlineColor = True

.FillColor.RGBAssign 255, 0, 0

.OutlineColor.RGBAssign 255, 255, 0

End With

End Select

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectLens.Frozen

Property Frozen As Boolean

EffectLens

Description

The Frozen property returns True if the lens is frozen.

Read-Only

 Related Topics


EffectLens.Magnification

Property Magnification As Double

EffectLens

Description

The Magnification property returns or set the magnification level of a Magnify lens.

Example

The following example makes sure that no Magnify lens uses magnification level greater than 3.0x.

Sub Test1()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrLens Then

If eff.Lens.Type = cdrLensMagnify Then

If eff.Lens.Magnification > 3 Then

eff.Lens.Magnification = 3

End If

End If

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectLens.OutlineColor

Property OutlineColor As Color

EffectLens

Description

The OutlineColor property returns or sets the outline color for a Wireframe lens.

The following lens types do not accept any color parameters: Brighten, Fish eye, Heat map, Invert, and Magnify.

Example

The following example changes the color of all lenses on the page to red. For the Custom color map and Wireframe lenses, yellow is also used.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrLens Then

Select Case eff.Lens.Type

Case cdrLensColorAdd, cdrLensColorLimit, _

cdrLensTintedGrayscale, cdrLensTransparency

eff.Lens.Color.RGBAssign 255, 0, 0

Case cdrLensCustomColorMap

eff.Lens.FromColor.RGBAssign 255, 0, 0

eff.Lens.ToColor.RGBAssign 255, 255, 0

Case cdrLensWireframe

With eff.Lens

.UseFillColor = True

.UseOutlineColor = True

.FillColor.RGBAssign 255, 0, 0

.OutlineColor.RGBAssign 255, 255, 0

End With

End Select

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectLens.PaletteRotation

Property PaletteRotation As Long

EffectLens

Description

The PaletteRotation property returns or set the palette rotation for a Heat map lens.

Example

The following example creates a heat map lens with a palette rotation of 50%. (In this example, the palette rotation value can be specified directly in the CreateLens method as its second parameter. The current approach is used for illustration only).

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateRectangle(0, 0, 5, 5)

s1.Fill.ApplyFountainFill

Set s2 = ActiveLayer.CreateEllipse(1, 1, 6, 6)

With s2.CreateLens(cdrLensHeatMap).Lens

.PaletteRotation = 50

End With

End Sub

 Related Topics


EffectLens.Parent

Property Parent As Effect

EffectLens

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


EffectLens.Rate

Property Rate As Long

EffectLens

Description

The Rate property returns or sets the strength of the lens effect. Values range from 0% to 100%.

This property is available only for the following types of lenses: Brighten, Color add, Color limit, Fish eye, and Transparency.

Example

The following example selects all shapes with a Transparency lens and whose transparency level is greater than 80%.

Sub Test()

Dim s As Shape, eff As Effect

Dim sr As New ShapeRange

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrLens Then

If eff.Lens.Type = cdrLensTransparency Then

If eff.Lens.Rate > 80 Then sr.Add s

End If

Exit For

End If

Next eff

Next s

sr.CreateSelection

End Sub

 Related Topics


EffectLens.RemoveFace

Property RemoveFace As Boolean

EffectLens

Description

The RemoveFace property returns or sets whether to show the lens face or the effect of a lens. If set to True, it makes the lens display the effects of the lens only where it covers the object.

The Remove Face option is available for color-altering lenses only and isn't available for Fish eye and Magnify lenses.

Example

The following example creates two heat map lenses, one with and one without RemoveFace option.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateRectangle2(0, 2, 3, 2)

s1.Fill.ApplyFountainFill

Set s2 = ActiveLayer.CreateEllipse2(1.5, 4.5, 1.5)

s2.CreateLens(cdrLensHeatMap, 20).Lens.RemoveFace = True

Set s2 = ActiveLayer.CreateEllipse2(1.5, 1.5, 1.5)

s2.CreateLens(cdrLensHeatMap, 20).Lens.RemoveFace = False

End Sub

 Related Topics


EffectLens.Shapes

Property Shapes As Shapes

EffectLens

Description

The Shapes property returns the Shapes collection which contains all intermediate shapes generated by a frozen lens.

Read-Only

Example

The following example creates a Fish eye lens and freezes it, and then ungroups and moves the resulting objects by 4" to the right.

Sub Test()

Dim s1 As Shape, s2 As Shape, sr As ShapeRange

Set s1 = ActiveLayer.CreateRectangle(0, 0, 5, 5)

s1.Fill.ApplyFountainFill

Set s2 = ActiveLayer.CreateEllipse(1, 1, 6, 6)

With s2.CreateLens(cdrLensFishEye, 100).Lens

.Freeze

Set sr = .Ungroup

End With

sr.Move 4, 0

End Sub

 Related Topics


EffectLens.ToColor

Property ToColor As Color

EffectLens

Description

The ToColor property returns or sets the ending color for the Custom Color Map lens.

The following lens types do not accept any color parameters: Brighten, Fish eye, Heat map, Invert, and Magnify.

Example

The following example changes the color of all lenses on the page to red. For the Custom color map and Wireframe lenses, yellow is also used.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrLens Then

Select Case eff.Lens.Type

Case cdrLensColorAdd, cdrLensColorLimit, _

cdrLensTintedGrayscale, cdrLensTransparency

eff.Lens.Color.RGBAssign 255, 0, 0

Case cdrLensCustomColorMap

eff.Lens.FromColor.RGBAssign 255, 0, 0

eff.Lens.ToColor.RGBAssign 255, 255, 0

Case cdrLensWireframe

With eff.Lens

.UseFillColor = True

.UseOutlineColor = True

.FillColor.RGBAssign 255, 0, 0

.OutlineColor.RGBAssign 255, 255, 0

End With

End Select

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectLens.Type

Property Type As cdrLensType

EffectLens

Description

The Type property returns or sets the type of lens.

This property returns cdrLensType.

Example

The following example selects all Transparency lenses on the page.

Sub Test1()

Dim s As Shape, eff As Effect

Dim sr As New ShapeRange

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrLens Then

If eff.Lens.Type = cdrLensTransparency Then sr.Add s

Exit For

End If

Next eff

Next s

sr.CreateSelection

End Sub

 Related Topics


EffectLens.UseFillColor

Property UseFillColor As Boolean

EffectLens

Description

The UseFillColor property returns or sets whether the fill color is for a Wireframe lens.

The following lens types do not accept any color parameters: Brighten, Fish eye, Heat map, Invert, and Magnify.

Example

The following example changes the color of all lenses on the page to red. For the Custom color map and Wireframe lenses, yellow is also used.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrLens Then

Select Case eff.Lens.Type

Case cdrLensColorAdd, cdrLensColorLimit, _

cdrLensTintedGrayscale, cdrLensTransparency

eff.Lens.Color.RGBAssign 255, 0, 0

Case cdrLensCustomColorMap

eff.Lens.FromColor.RGBAssign 255, 0, 0

eff.Lens.ToColor.RGBAssign 255, 255, 0

Case cdrLensWireframe

With eff.Lens

.UseFillColor = True

.UseOutlineColor = True

.FillColor.RGBAssign 255, 0, 0

.OutlineColor.RGBAssign 255, 255, 0

End With

End Select

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectLens.UseOutlineColor

Property UseOutlineColor As Boolean

EffectLens

Description

The UseOutlineColor property returns or sets whether the outline color is used for a Wireframe lens.

The following lens types do not accept any color parameters: Brighten, Fish eye, Heat map, Invert, and Magnify.

Example

The following example changes the color of all lenses on the page to red. For the Custom eolor map and Wireframe lenses, yellow is also used.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrLens Then

Select Case eff.Lens.Type

Case cdrLensColorAdd, cdrLensColorLimit, _

cdrLensTintedGrayscale, cdrLensTransparency

eff.Lens.Color.RGBAssign 255, 0, 0

Case cdrLensCustomColorMap

eff.Lens.FromColor.RGBAssign 255, 0, 0

eff.Lens.ToColor.RGBAssign 255, 255, 0

Case cdrLensWireframe

With eff.Lens

.UseFillColor = True

.UseOutlineColor = True

.FillColor.RGBAssign 255, 0, 0

.OutlineColor.RGBAssign 255, 255, 0

End With

End Select

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectLens.UseViewPoint

Property UseViewPoint As Boolean

EffectLens

Description

The UseViewPoint property returns or sets whether a viewpoint is used in a lens.

Example

The following example creates a magnified view of a certain region of the drawing.

Sub Test()

Dim sText As Shape, sLens As Shape

Set sText = ActiveLayer.CreateArtisticText(0, 0, "Some Text")

sText.Fill.UniformColor.RGBAssign 255, 0, 0

Set sLens = ActiveLayer.CreateEllipse2(1.5, 1.5, 0.7)

With sLens.CreateLens(cdrLensMagnify, 3).Lens

.UseViewPoint = True

.ViewPointX = 0.6

.ViewPointY = 0.08

End With

ActiveLayer.CreateEllipse2 0.6, 0.08, 0.23

ActiveLayer.CreateLineSegment 0.74, -0.1, 2.02, 1.02

ActiveLayer.CreateLineSegment 0.39, 0.15, 0.85, 1.76

End Sub

 Related Topics


EffectLens.ViewPointX

Property ViewPointX As Double

EffectLens

Description

The ViewPointX property returns or sets the horizontal coordinate of a viewpoint in a lens.

Example

The following example creates a magnified view of a certain region of the drawing.

Sub Test()

Dim sText As Shape, sLens As Shape

Set sText = ActiveLayer.CreateArtisticText(0, 0, "Some Text")

sText.Fill.UniformColor.RGBAssign 255, 0, 0

Set sLens = ActiveLayer.CreateEllipse2(1.5, 1.5, 0.7)

With sLens.CreateLens(cdrLensMagnify, 3).Lens

.UseViewPoint = True

.ViewPointX = 0.6

.ViewPointY = 0.08

End With

ActiveLayer.CreateEllipse2 0.6, 0.08, 0.23

ActiveLayer.CreateLineSegment 0.74, -0.1, 2.02, 1.02

ActiveLayer.CreateLineSegment 0.39, 0.15, 0.85, 1.76

End Sub

 Related Topics


EffectLens.ViewPointY

Property ViewPointY As Double

EffectLens

Description

The ViewPointY property returns or sets the vertical coordinate of a viewpoint in a lens.

Example

The following example creates a magnified view of a certain region of the drawing.

Sub Test()

Dim sText As Shape, sLens As Shape

Set sText = ActiveLayer.CreateArtisticText(0, 0, "Some Text")

sText.Fill.UniformColor.RGBAssign 255, 0, 0

Set sLens = ActiveLayer.CreateEllipse2(1.5, 1.5, 0.7)

With sLens.CreateLens(cdrLensMagnify, 3).Lens

.UseViewPoint = True

.ViewPointX = 0.6

.ViewPointY = 0.08

End With

ActiveLayer.CreateEllipse2 0.6, 0.08, 0.23

ActiveLayer.CreateLineSegment 0.74, -0.1, 2.02, 1.02

ActiveLayer.CreateLineSegment 0.39, 0.15, 0.85, 1.76

End Sub

 Related Topics


EffectLens.Freeze

Sub Freeze()

EffectLens

Description

The Freeze method freezes a lens.

Frozen lenses redraw more quickly than non-frozen lenses. Once frozen, the contents of the object no longer interact with other objects on the screen.

Example

The following example creates a Fish eye lens and freezes it, and then ungroups and moves the resulting objects by 4" to the right.

Sub Test()

Dim s1 As Shape, s2 As Shape, sr As ShapeRange

Set s1 = ActiveLayer.CreateRectangle(0, 0, 5, 5)

s1.Fill.ApplyFountainFill

Set s2 = ActiveLayer.CreateEllipse(1, 1, 6, 6)

With s2.CreateLens(cdrLensFishEye, 100).Lens

.Freeze

Set sr = .Ungroup

End With

sr.Move 4, 0

End Sub

 Related Topics


EffectLens.Unfreeze

Sub Unfreeze()

EffectLens

Description

The Unfreeze method removes the freeze on a lens.

Frozen lenses redraw more quickly than non-frozen lenses. Once frozen, the contents of the object no longer interact with other objects on the screen.

Example

The following example creates a Fish eye lens and freezes it, and then ungroups and moves the resulting objects by 4" to the right.

Sub Test()

Dim s1 As Shape, s2 As Shape, sr As ShapeRange

Set s1 = ActiveLayer.CreateRectangle(0, 0, 5, 5)

s1.Fill.ApplyFountainFill

Set s2 = ActiveLayer.CreateEllipse(1, 1, 6, 6)

With s2.CreateLens(cdrLensFishEye, 100).Lens

.Freeze

Set sr = .Ungroup

End With

sr.Move 4, 0

End Sub

 Related Topics


EffectLens.Ungroup

Function Ungroup() As ShapeRange

EffectLens

Description

The Ungroup method breaks up the group of contents in a frozen lens, resulting in a number of individual shapes generated by the lens. The shapes are returned from the method as a ShapeRange collection.

Return value

Returns ShapeRange

Example

The following example creates a Fish eye lens and freezes it, and then ungroups and moves the resulting objects by 4" to the right.

Sub Test()

Dim s1 As Shape, s2 As Shape, sr As ShapeRange

Set s1 = ActiveLayer.CreateRectangle(0, 0, 5, 5)

s1.Fill.ApplyFountainFill

Set s2 = ActiveLayer.CreateEllipse(1, 1, 6, 6)

With s2.CreateLens(cdrLensFishEye, 100).Lens

.Freeze

Set sr = .Ungroup

End With

sr.Move 4, 0

End Sub

 Related Topics


EffectPerspective properties

EffectPerspective     Legend

    Application
      HorizVanishingPointX
      HorizVanishingPointY
    Parent
      UseHorizVanishingPoint
      UseVertVanishingPoint
      VertVanishingPointX
      VertVanishingPointY


EffectPerspective

Class EffectPerspective

Properties     Referenced By

The EffectPerspective represents the properties of perspective Effect objects.

 Related Topics


EffectPerspective.Application

Property Application As Application

EffectPerspective

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


EffectPerspective.HorizVanishingPointX

Property HorizVanishingPointX As Double

EffectPerspective

Description

The HorizVanishingPointX property returns or sets the X coordinate of the horizontal vanishing point in a perspective effect.

Example

The following example changes the position of vanishing points for all perspective effects so that the horizontal vanishing point is placed in the middle of the left edge of the page, while the vertical vanishing point is placed in the middle of the top edge of the page.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrPerspective Then

With eff.Perspective

If .UseHorizVanishingPoint Then

.HorizVanishingPointX = 0

.HorizVanishingPointY = ActivePage.SizeHeight / 2

End If

If .UseVertVanishingPoint Then

.VertVanishingPointX = ActivePage.SizeWidth / 2

.VertVanishingPointY = ActivePage.SizeHeight

End If

End With

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectPerspective.HorizVanishingPointY

Property HorizVanishingPointY As Double

EffectPerspective

Description

The HorizVanishingPointY property returns or sets the Y coordinate of the horizontal vanishing point in a perspective effect.

Example

The following example changes the position of vanishing points for all perspective effects so that the horizontal vanishing point is placed in the middle of the left edge of the page, while the vertical vanishing point is placed in the middle of the top edge of the page.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrPerspective Then

With eff.Perspective

If .UseHorizVanishingPoint Then

.HorizVanishingPointX = 0

.HorizVanishingPointY = ActivePage.SizeHeight / 2

End If

If .UseVertVanishingPoint Then

.VertVanishingPointX = ActivePage.SizeWidth / 2

.VertVanishingPointY = ActivePage.SizeHeight

End If

End With

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectPerspective.Parent

Property Parent As Effect

EffectPerspective

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


EffectPerspective.UseHorizVanishingPoint

Property UseHorizVanishingPoint As Boolean

EffectPerspective

Description

The UseHorizVanishingPoint property returns or sets whether to use a horizontal vanishing point in a perspective effect.

If UseHorizVanishingPoint is set to False, the corresponding vanishing point is set to infinity.

Example

The following example changes the position of vanishing points for all perspective effects so that the horizontal vanishing point is placed in the middle of the left edge of the page, while the vertical vanishing point is placed in the middle of the top edge of the page.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrPerspective Then

With eff.Perspective

If .UseHorizVanishingPoint Then

.HorizVanishingPointX = 0

.HorizVanishingPointY = ActivePage.SizeHeight / 2

End If

If .UseVertVanishingPoint Then

.VertVanishingPointX = ActivePage.SizeWidth / 2

.VertVanishingPointY = ActivePage.SizeHeight

End If

End With

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectPerspective.UseVertVanishingPoint

Property UseVertVanishingPoint As Boolean

EffectPerspective

Description

The UseVertVanishingPoint property returns or sets whether to use a vertical vanishing point in a perspective effect.

If UseVertVanishingPoint is set to False, the corresponding vanishing point is set to infinity.

Example

The following example changes the position of vanishing points for all perspective effects so that the horizontal vanishing point is placed in the middle of the left edge of the page, while the vertical vanishing point is placed in the middle of the top edge of the page.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrPerspective Then

With eff.Perspective

If .UseHorizVanishingPoint Then

.HorizVanishingPointX = 0

.HorizVanishingPointY = ActivePage.SizeHeight / 2

End If

If .UseVertVanishingPoint Then

.VertVanishingPointX = ActivePage.SizeWidth / 2

.VertVanishingPointY = ActivePage.SizeHeight

End If

End With

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectPerspective.VertVanishingPointX

Property VertVanishingPointX As Double

EffectPerspective

Description

The VertVanishingPointX property returns or sets the x-coordinate of the vertical vanishing point in a perspective effect.

Example

The following example changes the position of vanishing points for all perspective effects so that the horizontal vanishing point is placed in the middle of the left edge of the page, while the vertical vanishing point is placed in the middle of the top edge of the page.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrPerspective Then

With eff.Perspective

If .UseHorizVanishingPoint Then

.HorizVanishingPointX = 0

.HorizVanishingPointY = ActivePage.SizeHeight / 2

End If

If .UseVertVanishingPoint Then

.VertVanishingPointX = ActivePage.SizeWidth / 2

.VertVanishingPointY = ActivePage.SizeHeight

End If

End With

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectPerspective.VertVanishingPointY

Property VertVanishingPointY As Double

EffectPerspective

Description

The VertVanishingPointY property returns or sets the y-coordinate of the vertical vanishing point in a perspective effect.

Example

The following example changes the position of vanishing points for all perspective effects so that the horizontal vanishing point is placed in the middle of the left edge of the page, while the vertical vanishing point is placed in the middle of the top edge of the page.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrPerspective Then

With eff.Perspective

If .UseHorizVanishingPoint Then

.HorizVanishingPointX = 0

.HorizVanishingPointY = ActivePage.SizeHeight / 2

End If

If .UseVertVanishingPoint Then

.VertVanishingPointX = ActivePage.SizeWidth / 2

.VertVanishingPointY = ActivePage.SizeHeight

End If

End With

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectPushPullDistortion properties

EffectPushPullDistortion     Legend

      Amplitude
    Application
    Parent


EffectPushPullDistortion

Class EffectPushPullDistortion

Properties     Referenced By

The EffectPushPullIDistortion class represents the properties of Push and pull Distortion Effect objects.

 Related Topics


EffectPushPullDistortion.Amplitude

Property Amplitude As Long

EffectPushPullDistortion

Description

The Amplitude property returns or sets the strength of the effect in a Push and Pull distortion effect.

The range of the distortion value is 1 to 200.

Example

The following example sets the amplitude of all Push and Pull distortion effects to 30.

Sub Test()

Dim s As Shape, eff As Effect

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrDistortion Then

If eff.Distortion.Type = cdrDistortionPushPull Then

eff.Distortion.PushPull.Amplitude = 30

End If

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectPushPullDistortion.Application

Property Application As Application

EffectPushPullDistortion

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


EffectPushPullDistortion.Parent

Property Parent As EffectDistortion

EffectPushPullDistortion

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Effects properties

Effects     Legend

    Application
    Count
  Item
    Parent


Effects

Class Effects

Properties     Referenced By

The Effects class represents the collection of all effects applied to a shape.

 Related Topics


Effects.Application

Property Application As Application

Effects

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Effects.Count

Property Count As Long

Effects

Description

The Count property returns the number of effects in the Effects collection.

Read-Only

Example

The following example selects the first shape to which an effect is applied.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Effects.Count <> 0 Then

s.CreateSelection

Exit For

End If

Next s

End Sub

 Related Topics


Effects.Item

Property Item(ByVal Index As Long) As Effect

Effects

Description

The Item property returns a specific Effect object representing the effect applied.

The Item property is the default property and its reference may be omitted when referencing items in the collection. For example, Effects.Item(2) is the same as Effects(2) - they both reference the second effect in the Effects collection.

Read-Only

Parameters	Description

Index	Represents a preset placeholder for each effect in an Effects collection; it uniquely identifies each member of the collection. [in]

Example

The following example places text on a path.

Sub Test()

Dim sText As Shape, sEllipse As Shape

Set sText = ActiveLayer.CreateArtisticText(0, 0, "Text On Path")

Set sEllipse = ActiveLayer.CreateEllipse2(4, 5, 2)

sText.Text.FitToPath sEllipse

sText.Effects(1).TextOnPath.Quadrant = cdrBottomQuadrant

End Sub

 Related Topics


Effects.Parent

Property Parent As Shape

Effects

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


EffectTextOnPath properties

EffectTextOnPath     Legend

    Application
      DistanceFromPath
      Offset
      Orientation
    Parent
      Path
      Placement
      PlaceOnOtherSide
      Quadrant
      Text
      VertPlacement


EffectTextOnPath

Class EffectTextOnPath

Properties     Referenced By

The EffectTextOnPath class represents the properties of text-on-path Effect objects.

 Related Topics


EffectTextOnPath.Application

Property Application As Application

EffectTextOnPath

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


EffectTextOnPath.DistanceFromPath

Property DistanceFromPath As Double

EffectTextOnPath

Description

The DistanceFromPath property returns or sets the vertical distance (offset) between the text and its path. The distance is specified in document units of measurements.

Example

The following example creates text fitted to a circle, and specifies a distance of 0.5" between the text and the circle.

Sub Test()

Dim sText As Shape, sEllipse As Shape

Set sText = ActiveLayer.CreateArtisticText(0, 0, "Text On Path")

Set sEllipse = ActiveLayer.CreateEllipse2(4, 5, 2)

sText.Text.FitToPath sEllipse

sText.Effects(1).TextOnPath.DistanceFromPath = 0.5

End Sub

 Related Topics


EffectTextOnPath.Offset

Property Offset As Double

EffectTextOnPath

Description

The Offset property returns or sets the horizontal text offset from the beginning of the path.

Example

The following example attaches a text shape to a path and places it 2" from the beginning of the path.

Sub Test()

Dim sText As Shape, sPath As Shape

Set sText = ActiveLayer.CreateArtisticText(0, 0, "Text On Path")

Set sPath = ActiveLayer.CreateCurveSegment(0.6, 4.5, 7.8, 8.5, 5.2, 62, 5.3, -96)

sText.Text.FitToPath sPath

sText.Effects(1).TextOnPath.Offset = 2

End Sub

 Related Topics


EffectTextOnPath.Orientation

Property Orientation As cdrFittedOrientation

EffectTextOnPath

Description

The Orientation property returns or sets the character orientation as the text follows the control path.

This value returns cdrFittedOrientation.

Example

The following example creates a text shape fitted to a path, and makes the text to remain upright by skewing characters vertically.

Sub Test()

Dim sText As Shape, sPath As Shape

Set sText = ActiveLayer.CreateArtisticText(0, 0, "Some Long Text Line")

Set sPath = ActiveLayer.CreateCurveSegment(0.6, 4.5, 5, 5.5, 3, 80, 3, -100)

sText.Text.FontProperties.Size = 48

sText.Text.FitToPath sPath

sText.Effects(1).TextOnPath.Orientation = cdrVerticalSkewOrientation

End Sub

 Related Topics


EffectTextOnPath.Parent

Property Parent As Effect

EffectTextOnPath

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


EffectTextOnPath.Path

Property Path As Shape

EffectTextOnPath

Description

The Path property returns or sets the path Shape object to which the text is attached.

Example

The following example applies a red outline to all paths with text attached.

Sub Test1()

Dim s As Shape, eff As Effect

For Each s In ActivePage.FindShapes(, cdrTextShape)

For Each eff In s.Effects

If eff.Type = cdrTextOnPath Then

eff.TextOnPath.Path.Outline.Color.RGBAssign 255, 0, 0

End If

Next eff

Next s

End Sub

 Related Topics


EffectTextOnPath.Placement

Property Placement As cdrFittedPlacement

EffectTextOnPath

Description

The Placement property returns or sets the placement of text on an open curve.

This property returns a value of cdrFittedPlacement.

See also the Quadrant property.

Example

The following example places the text in the middle of a curve.

Sub Test()

Dim sText As Shape, sPath As Shape

Set sText = ActiveLayer.CreateArtisticText(0, 0, "Some Text")

Set sPath = ActiveLayer.CreateCurveSegment(0.6, 4.5, 5, 5.5, 3, 80, 3, -100)

sText.Text.FitToPath sPath

sText.Effects(1).TextOnPath.Placement = cdrCenterPlacement

End Sub

 Related Topics


EffectTextOnPath.PlaceOnOtherSide

Property PlaceOnOtherSide As Boolean

EffectTextOnPath

Description

The PlaceOnOtherSide property returns whether text is placed on the opposite side of the path in a text on path effect. A value of True places the text on the opposite side of the path object.

Example

The following example places the text inside an ellipse.

Sub Test()

Dim sText As Shape, sPath As Shape

Set sText = ActiveLayer.CreateArtisticText(0, 0, "Some Text")

Set sPath = ActiveLayer.CreateEllipse2(4.25, 5.5, 2, 3)

sText.Text.FitToPath sPath

With sText.Effects(1).TextOnPath

.Quadrant = cdrBottomQuadrant

.PlaceOnOtherSide = True

.DistanceFromPath = 0.1

End With

End Sub

 Related Topics


EffectTextOnPath.Quadrant

Property Quadrant As cdrFittedQuadrant

EffectTextOnPath

Description

The Quadrant property returns or sets the placement of text on a closed curve.

This property returns cdrFittedQuadrant.

See also the Placement property.

Example

The following example places the text on the right side of a circle.

Sub Test()

Dim sText As Shape, sPath As Shape

Set sText = ActiveLayer.CreateArtisticText(0, 0, "Some Text")

Set sPath = ActiveLayer.CreateEllipse2(4.25, 5.5, 2)

sText.Text.FitToPath sPath

sText.Effects(1).TextOnPath.Quadrant = cdrRightQuadrant

End Sub

 Related Topics


EffectTextOnPath.Text

Property Text As Shape

EffectTextOnPath

Description

The Text property returns or sets the text Shape which is fitted to a path.

This property is reserved for future development.

 Related Topics


EffectTextOnPath.VertPlacement

Property VertPlacement As cdrFittedVertPlacement

EffectTextOnPath

Description

The VertPlacement property returns or sets the mode of the vertical placement of text for a text-on-path effect.

This property returns cdrFittedVertPlacement.

Example

The following example places the text on a circle, so it appears centered vertically relative to the circle

Sub Test()

Dim sText As Shape, sPath As Shape

Set sText = ActiveLayer.CreateArtisticText(0, 0, "Some Text")

Set sPath = ActiveLayer.CreateEllipse2(4.25, 5.5, 2)

sText.Text.FitToPath sPath

sText.Effects(1).TextOnPath.VertPlacement = cdrCenterVertPlacement

End Sub

 Related Topics


EffectTwisterDistortion properties

EffectTwisterDistortion     Legend

      Angle
    Application
    Parent


EffectTwisterDistortion

Class EffectTwisterDistortion

Properties     Referenced By

The EffectTwisterDistortion class represents the properties of Twister Distortion Effect objects.

 Related Topics


EffectTwisterDistortion.Angle

Property Angle As Double

EffectTwisterDistortion

Description

The Angle property returns or sets the twist angle in a Twister distortion effect.

Positive values denote a counterclockwise rotation, while negative values represent a clockwise rotation. To achieve several full rotations, multiply the number of rotations by 360 for the resultant rotation angle.

Example

The following example creates a text shape and applies a Twister distortion effect to it. The twisting angle specified is 450 degrees counterclockwise, resulting in one complete rotation and an additional rotation of 90 degrees. Alternatively, you can specify the angle in the call to the CreateTwisterDistortion method, resulting in a procedure which works faster.

Sub Test()

Dim sText As Shape, eff As Effect

Set sText = ActiveLayer.CreateArtisticText(1.5, 5, "Twister")

sText.Text.FontProperties.Size = 150

Set eff = sText.CreateTwisterDistortion(0, 0, 0)

eff.Distortion.Twister.Angle = -450

End Sub

 Related Topics


EffectTwisterDistortion.Application

Property Application As Application

EffectTwisterDistortion

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


EffectTwisterDistortion.Parent

Property Parent As EffectDistortion

EffectTwisterDistortion

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


EffectZipperDistortion properties

EffectZipperDistortion     Legend

      Amplitude
    Application
      Frequency
      Local
    Parent
      Random
      Smooth


EffectZipperDistortion

Class EffectZipperDistortion

Properties     Referenced By

The EffectZipperDistortion class represents the properties of Zipper Distortion Effect objects.

 Related Topics


EffectZipperDistortion.Amplitude

Property Amplitude As Long

EffectZipperDistortion

Description

The Amplitude property returns or sets the amplitude or strength of a Zipper distortion effect.

Values range from 0% to 100%. Higher values produce a more pronounced Zipper distortion effect.

Example

The following example specifies a wave amplitude of 20% for each Zipper distortion effect with a frequency greater than 10.

Sub Test()

Dim s As Shape, eff As Effect, zip As EffectZipperDistortion

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrDistortion Then

If eff.Distortion.Type = cdrDistortionZipper Then

Set zip = eff.Distortion.Zipper

If zip.Frequency > 10 Then zip.Amplitude = 20

End If

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectZipperDistortion.Application

Property Application As Application

EffectZipperDistortion

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


EffectZipperDistortion.Frequency

Property Frequency As Long

EffectZipperDistortion

Description

The Frequency property returns or sets the frequency of a Zipper distortion effect.

Values range from 0 to 100. A higher frequency value creates more zipper points in the distortion effect.

Example

The following example specifies a wave amplitude of 20% for each Zipper distortion effect with a frequency greater than 10.

Sub Test()

Dim s As Shape, eff As Effect, zip As EffectZipperDistortion

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrDistortion Then

If eff.Distortion.Type = cdrDistortionZipper Then

Set zip = eff.Distortion.Zipper

If zip.Frequency > 10 Then zip.Amplitude = 20

End If

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


EffectZipperDistortion.Local

Property Local As Boolean

EffectZipperDistortion

Description

The Local property returns or sets whether the zipper distortion effect is emphasized in an area of the object.

When Local is set to True, the transformation amplitude becomes dependent on the distance from the center of distortion.

Example

The following example selects all shapes to which a Zipper distortion effect (that is smooth, random, and not local) is applied.

Sub Test()

Dim s As Shape, eff As Effect, zip As EffectZipperDistortion

Dim sr As New ShapeRange

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrDistortion Then

If eff.Distortion.Type = cdrDistortionZipper Then

Set zip = eff.Distortion.Zipper

If zip.Smooth And zip.Random And Not zip.Local Then sr.Add s

End If

Exit For

End If

Next eff

Next s

sr.CreateSelection

End Sub

 Related Topics


EffectZipperDistortion.Parent

Property Parent As EffectDistortion

EffectZipperDistortion

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


EffectZipperDistortion.Random

Property Random As Boolean

EffectZipperDistortion

Description

The Random property returns or sets whether the distorting waves in a Zipper distortion effect should be generated with random amplitudes.

Example

The following example selects all shapes to which a Zipper distortion effect (that is smooth, random, and not local) is applied.

Sub Test()

Dim s As Shape, eff As Effect, zip As EffectZipperDistortion

Dim sr As New ShapeRange

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrDistortion Then

If eff.Distortion.Type = cdrDistortionZipper Then

Set zip = eff.Distortion.Zipper

If zip.Smooth And zip.Random And Not zip.Local Then sr.Add s

End If

Exit For

End If

Next eff

Next s

sr.CreateSelection

End Sub

 Related Topics


EffectZipperDistortion.Smooth

Property Smooth As Boolean

EffectZipperDistortion

Description

The Smooth property returns or sets whether the wave peaks are smooth in a Zipper distortion effect.

Example

The following example selects all shapes to which a Zipper distortion effect (that is smooth, random, and not local) is applied.

Sub Test()

Dim s As Shape, eff As Effect, zip As EffectZipperDistortion

Dim sr As New ShapeRange

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrDistortion Then

If eff.Distortion.Type = cdrDistortionZipper Then

Set zip = eff.Distortion.Zipper

If zip.Smooth And zip.Random And Not zip.Local Then sr.Add s

End If

Exit For

End If

Next eff

Next s

sr.CreateSelection

End Sub

 Related Topics


Ellipse properties

Ellipse     Legend

      CenterX
      CenterY
      Clockwise
      EndAngle
      HRadius
      StartAngle
      Type
      VRadius


Ellipse methods

Ellipse     Legend

   GetCenterPosition
   GetRadius
   SetCenterPosition
   SetRadius


Ellipse

Class Ellipse

Properties     Methods     Referenced By

The Ellipse class represents the ellipse-specific properties of the Shape object

 Related Topics


Ellipse.CenterX

Property CenterX As Double

Ellipse

Description

The CenterX property returns or sets the position of the horizontal coordinate, for the center of an ellipse, arc, or pie. This is not the same as the geometrical center of the shape for an arc or a pie.

Example

The following example moves the ellipse so that its center appears at the left side of the current page.

Sub Test()

ActiveShape.Ellipse.CenterX = 0

End Sub

 Related Topics


Ellipse.CenterY

Property CenterY As Double

Ellipse

Description

The CenterY property returns or sets the position of the vertical coordinate for the center of an ellipse, arc, or pie. This is not the same as the geometrical center of the shape for an arc or a pie.

Example

The following example moves the ellipse so that its center appears at the bottom side of the current page.

Sub Test()

ActiveShape.Ellipse.CenterY = 0

End Sub

 Related Topics


Ellipse.Clockwise

Property Clockwise As Boolean

Ellipse

Description

The Clockwise property returns or sets a value indicating whether the ellipse, arc, or pie goes from the start angle to the end angle in a clockwise or counterclockwise direction. If the value returned is True, the ellipse has a clockwise rotation.

Example

The following code example converts the selected ellipse to a pie with a start angle of 0 degrees, an end angle of 90 degrees, and a clockwise rotation.

Sub Test()

Dim s As Shape

Set s = ActiveSelection.Shapes(1)

If s.Type = cdrEllipseShape Then

With s.Ellipse

.StartAngle = 0

.EndAngle = 90

.Clockwise = True

.Type = cdrPie

End With

End If

End Sub

 Related Topics


Ellipse.EndAngle

Property EndAngle As Double

Ellipse

Description

The EndAngle property returns or sets returns or sets the end angle of an arc or pie.

Example

The following code example sets the start angle of the pie or arc to be 90 degrees greater than its end angle (making sure the angle does not exceed the limit of 360 degrees).

Sub Test()

Dim s As Shape

Dim a As Double

Set s = ActiveShape

If s.Type = cdrEllipseShape Then

a = s.Ellipse.EndAngle + 90

If a >= 360 Then a = a - 360 * Fix(a / 360)

s.Ellipse.StartAngle = a

End If

End Sub

 Related Topics


Ellipse.HRadius

Property HRadius As Double

Ellipse

Description

The HRadius property returns or sets the horizontal radius of an ellipse.

This property does not take object rotation into account; thus an ellipse that is rotated 90 degrees will return the same horizontal radius as the ellipse before the rotation.

Example

The following example sets the horizontal radius of the selected ellipse to 1".

Sub Test()

ActiveShape.Ellipse.HRadius = 1

End Sub

 Related Topics


Ellipse.StartAngle

Property StartAngle As Double

Ellipse

Description

The StartAngle property returns or sets the start angle of an arc or pie.

Example

The following code example sets the start angle of the pie or arc to be 90 degrees greater than its end angle (making sure the angle does not exceed the limit of 360 degrees).

Sub Test()

Dim s As Shape

Dim a As Double

Set s = ActiveShape

If s.Type = cdrEllipseShape Then

a = s.Ellipse.EndAngle + 90

If a >= 360 Then a = a - 360 * Fix(a / 360)

s.Ellipse.StartAngle = a

End If

End Sub

 Related Topics


Ellipse.Type

Property Type As cdrEllipseType

Ellipse

Description

The Type property returns or sets a value indicating whether the ellipse shape is a full ellipse, a pie, or an arc.

The Type property returns a value of cdrEllipseType.

Example

The following code example loops through all the shapes on the active page of the active document, fills all ellipses with red, and changes arcs to pies.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrEllipseShape Then

If s.Ellipse.Type = cdrArc Then s.Ellipse.Type = cdrPie

s.Fill.UniformColor.RGBAssign 255, 0, 0

End If

Next s

End Sub

 Related Topics


Ellipse.VRadius

Property VRadius As Double

Ellipse

Description

The VRadius property returns or sets the vertical radius of an ellipse.

This property does not take object rotation into account; thus an ellipse that is rotated 90 degrees will return the same vertical radius as the ellipse before the rotation.

Example

The following example sets the vertical radius of the selected ellipse to 1".

Sub Test()

ActiveShape.Ellipse.VRadius = 1

End Sub

 Related Topics


Ellipse.GetCenterPosition

Sub GetCenterPosition(ByRef PositionX As Double, ByRef PositionY As Double)

Ellipse

Description

The GetCenterPosition method retrieves the coordinates of the center of an ellipse. Using GetCenterPosition is equivalent to getting the values of both CenterX and CenterY properties at the same time.

Parameters	Description

PositionX	Gets the x coordinate for the center or an ellipse, measured in document units [out]

PositionY	Gets the y coordinate for the center or an ellipse, measured in document units [out]

Example

The following example increases the radius of the ellipse both horizontally and vertically by 2". Changing the radius of an ellipse causes its center to move. In order to preserve the center position of the ellipse, GetCenterPosition and SetCenterPosition are used.

Sub Test()

Dim x As Double, y As Double

Dim rx As Double, ry As Double

With ActiveShape.Ellipse

.GetCenterPosition x, y

.GetRadius rx, ry

.SetRadius rx + 2, ry + 2

.SetCenterPosition x, y

End With

End Sub

 Related Topics


Ellipse.GetRadius

Sub GetRadius(ByRef HRadius As Double, ByRef VRadius As Double)

Ellipse

Description

The GetRadius method retrieves the horizontal and vertical radii of an ellipse.

Using GetRadius is equivalent to getting the values of both the HRadius and VRadius properties at the same time.

Parameters	Description

HRadius	Gets the horizontal radius of an ellipse, measured in document units [out]

VRadius	Gets the vertical radius of an ellipse, measured in document units [out]

Example

The following example increases the radius of the ellipse both horizontally and vertically by 2". Changing the radius of an ellipse causes its center to move. In order to preserve the center position of the ellipse, GetCenterPosition and SetCenterPosition are used.

Sub Test()

Dim x As Double, y As Double

Dim rx As Double, ry As Double

With ActiveShape.Ellipse

.GetCenterPosition x, y

.GetRadius rx, ry

.SetRadius rx + 2, ry + 2

.SetCenterPosition x, y

End With

End Sub

 Related Topics


Ellipse.SetCenterPosition

Sub SetCenterPosition(ByVal PositionX As Double, ByVal PositionY As Double)

Ellipse

Description

The SetCenterPosition method moves the ellipse so that its center is located at given coordinates. Using SetCenterPosition is equivalent to setting the values of both CenterX and CenterY properties at the same time.

Parameters	Description

PositionX	Sets the x coordinate for the center or an ellipse, measured in document units [in]

PositionY	Sets the y coordinate for the center or an ellipse, measured in document units [in]

Example

The following example increases the radius of the ellipse both horizontally and vertically by 2". Changing the radius of an ellipse causes its center to move. In order to preserve the center position of the ellipse, GetCenterPosition and SetCenterPosition are used.

Sub Test()

Dim x As Double, y As Double

Dim rx As Double, ry As Double

With ActiveShape.Ellipse

.GetCenterPosition x, y

.GetRadius rx, ry

.SetRadius rx + 2, ry + 2

.SetCenterPosition x, y

End With

End Sub

 Related Topics


Ellipse.SetRadius

Sub SetRadius(ByVal HRadius As Double, [ByVal VRadius As Double = 0])

Ellipse

Description

The SetRadius method specifies both the horizontal and the vertical radii of an ellipse.

Using SetRadius is equivalent to setting the values of both the HRadius and VRadius properties at the same time.

Parameters	Description

HRadius	Sets the horizontal radius of an ellipse and is measured in document units [in]

VRadius	Sets the vertical radius of an ellipse and is measured in document units. If this value is not specified, it is assigned the same value as the HRadius parameter. [in]
Optional
Default value = 0

Example

The following example increases the radius of the ellipse both horizontally and vertically by 2". Changing the radius of an ellipse causes its center to move. In order to preserve the center position of the ellipse, GetCenterPosition and SetCenterPosition are used.

Sub Test()

Dim x As Double, y As Double

Dim rx As Double, ry As Double

With ActiveShape.Ellipse

.GetCenterPosition x, y

.GetRadius rx, ry

.SetRadius rx + 2, ry + 2

.SetCenterPosition x, y

End With

End Sub

 Related Topics


ExportFilter properties

ExportFilter     Legend

    HasDialog


ExportFilter methods

ExportFilter     Legend

   Finish
   Reset
   ShowDialog


ExportFilter

Class ExportFilter

Properties     Methods     Referenced By

The ExportFilter class represents an export filter and allows access to the export filter's settings.

 Related Topics


ExportFilter.HasDialog

Property HasDialog As Boolean

ExportFilter

Description

The HasDialog property determines whether the filter has a filter-specific dialog box. It returns True if the filter has a filter-specific dialog box.

Read-Only

Example

The following example creates a document and an ellipse. When exporting the document to JPEG, the filter's dialog box is displayed, if it has one, and the export process is completed.

Sub Test()

Dim ex As ExportFilter

Dim d As Document

Set d = CreateDocument

d.ActiveLayer.CreateEllipse2 4, 4, 1

Set ex = d.ExportEx("c:\test.jpg", cdrJPEG)

With ex

If .HasDialog Then

.ShowDialog

End If

.Finish

End With

End Sub

 Related Topics


ExportFilter.Finish

Sub Finish()

ExportFilter

Description

The Finish method completes the export process.

Example

The following example creates a document and an ellipse, and exports the document to JPEG.

Sub Test()

Dim ex As ExportFilter

Dim d As Document

Set d = CreateDocument

d.ActiveLayer.CreateEllipse2 4, 4, 1

Set ex = d.ExportEx("c:\test.jpg", cdrJPEG)

ex.Finish

End Sub

 Related Topics


ExportFilter.Reset

Sub Reset()

ExportFilter

Description

The Reset method sets the filter's settings to the default settings.

Example

The following example creates a document and an ellipse. When exporting the document to JPEG, the filter's dialog box is displayed, if it has one. If the user clicks Cancel, the filter's settings are reset to the default settings.

Sub Test()

Dim ex As ExportFilter

Dim d As Document

Set d = CreateDocument

d.ActiveLayer.CreateEllipse2 4, 4, 1

Set ex = d.ExportEx("c:\test.jpg", cdrJPEG)

With ex

If .HasDialog Then

If Not .ShowDialog Then .Reset

.Finish

End If

End With

End Sub

 Related Topics


ExportFilter.ShowDialog

Function ShowDialog([ByVal hWnd As Long = 0]) As Boolean

ExportFilter

Description

The ShowDialog method displays the export filter's dialog box.

Parameters	Description

hWnd	[in]
Optional
Default value = 0

Return value

Returns Boolean

Example

The following example creates a document and an ellipse. When exporting the document to JPEG, the filter's dialog box is displayed, if it has one, and the export process is completed.

Sub Test()

Dim ex As ExportFilter

Dim d As Document

Set d = CreateDocument

d.ActiveLayer.CreateEllipse2 4, 4, 1

Set ex = d.ExportEx("c:\test.jpg", cdrJPEG)

With ex

If .HasDialog Then

.ShowDialog

End If

.Finish

End With

End Sub

 Related Topics


ExtrudeVanishingPoint properties

ExtrudeVanishingPoint     Legend

    Application
    Effects
    Parent
      PositionX
      PositionY
      Type


ExtrudeVanishingPoint methods

ExtrudeVanishingPoint     Legend

   Share


ExtrudeVanishingPoint

Class ExtrudeVanishingPoint

Properties     Methods     Referenced By

The ExtrudeVanishingPoint class represents vanishing points for an extrusion.

 Related Topics


ExtrudeVanishingPoint.Application

Property Application As Application

ExtrudeVanishingPoint

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


ExtrudeVanishingPoint.Effects

Property Effects As Effects

ExtrudeVanishingPoint

Description

The Effects property returns a collection of extrude Effect objects containing references to extrusions that share the same vanishing point.

This property is reserved for future development.

Read-Only

 Related Topics


ExtrudeVanishingPoint.Parent

Property Parent As EffectExtrude

ExtrudeVanishingPoint

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


ExtrudeVanishingPoint.PositionX

Property PositionX As Double

ExtrudeVanishingPoint

Description

The PositionX property returns or sets the horizontal coordinate of a vanishing point for an extrusion.

Example

The following example locks, to the page, all vanishing points for all extrusions on the page, and moves the vanishing points to the lower left corner of the page.

Sub Test1()

Dim s As Shape, eff As Effect, zip As EffectZipperDistortion

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrExtrude Then

With eff.Extrude.VanishingPoint

.Type = cdrVPLockedToPage

.PositionX = 0

.PositionY = 0

End With

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


ExtrudeVanishingPoint.PositionY

Property PositionY As Double

ExtrudeVanishingPoint

Description

The PositionY property returns or sets the vertical coordinate of a vanishing point for an extrusion.

Example

The following example locks, to the page, all vanishing points for all extrusions on the page, and moves the vanishing points to the lower left corner of the page.

Sub Test1()

Dim s As Shape, eff As Effect, zip As EffectZipperDistortion

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrExtrude Then

With eff.Extrude.VanishingPoint

.Type = cdrVPLockedToPage

.PositionX = 0

.PositionY = 0

End With

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


ExtrudeVanishingPoint.Type

Property Type As cdrExtrudeVPType

ExtrudeVanishingPoint

Description

The Type property returns or set the type of vanishing point for an extrusion.

This property returns a value of cdrExtrudeVPType.

Example

The following example locks, to the page, all vanishing points for all extrusions on the page, and moves the vanishing points to the lower left corner of the page.

Sub Test1()

Dim s As Shape, eff As Effect, zip As EffectZipperDistortion

For Each s In ActivePage.Shapes

For Each eff In s.Effects

If eff.Type = cdrExtrude Then

With eff.Extrude.VanishingPoint

.Type = cdrVPLockedToPage

.PositionX = 0

.PositionY = 0

End With

Exit For

End If

Next eff

Next s

End Sub

 Related Topics


ExtrudeVanishingPoint.Share

Function Share(ByVal Source As EffectExtrude) As Boolean

ExtrudeVanishingPoint

Description

The Share property shares a vanishing point with another extrusion.

You can copy a vanishing point to another object or have multiple vector extrusions share the same vanishing point.

Parameters	Description

Source	Identifies the extrusion that has the vanishing point that you want shared [in]

Return value

Returns Boolean

Example

The following example creates an extruded text object and a circle. It then shares the same vanishing point between the two.

Sub Test()

Dim sText As Shape, eff1 As Effect, eff2 As Effect

Dim sEllipse As Shape

Set sText = ActiveLayer.CreateArtisticText(1.5, 5, "3D Text")

sText.Text.FontProperties.Size = 150

sText.Fill.UniformColor.RGBAssign 0, 0, 255

Set eff1 = sText.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToPage, 7, 7)

Set sEllipse = ActiveLayer.CreateEllipse2(4, 9, 2)

sEllipse.Fill.UniformColor.RGBAssign 255, 255, 0

Set eff2 = sEllipse.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToPage, 5, 10)

eff2.Extrude.VanishingPoint.Share eff1.Extrude

End Sub

 Related Topics


Fill properties

Fill     Legend

      Fountain
      Pattern
      PostScript
      Texture
    Type
      UniformColor


Fill methods

Fill     Legend

   ApplyFountainFill
   ApplyNoFill
   ApplyPatternFill
   ApplyPostscriptFill
   ApplyTextureFill
   ApplyUniformFill


Fill

Class Fill

Properties     Methods     Referenced By

The Fill class represents the fill of a shape.

 Related Topics


Fill.Fountain

Property Fountain As FountainFill

Fill

Description

The Fountain property returns a FountainFill object which represents the properties of a fountain fill.

Example

The following example unlocks the fountain steps for all shapes on the page.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrFountainFill Then

If s.Fill.Fountain.Steps <> 0 Then

s.Fill.Fountain.Steps = 0

End If

End If

Next s

End Sub

 Related Topics


Fill.Pattern

Property Pattern As PatternFill

Fill

Description

The Pattern property returns a PatternFill object which represents the properties of a pattern fill.

Example

The following example creates a rectangle and applies a skewed two-color pattern fill to it.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s.Fill.ApplyPatternFill cdrTwoColorPattern, , 4, CreateRGBColor(255, 0, 0), CreateRGBColor(255, 255, 0)

s.Fill.Pattern.SkewAngle = 20

End Sub

 Related Topics


Fill.PostScript

Property PostScript As PostScriptFill

Fill

Description

The PostScript property returns a PostScriptFill object which represents the properties of a PostScript fill.

Example

The following example creates a rectangle and applies a PostScript fill to it. The bar width parameter is then changed to 40.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s.Fill.ApplyPostscriptFill "Bars"

s.Fill.PostScript.Properties(1) = 40

End Sub

 Related Topics


Fill.Texture

Property Texture As TextureFill

Fill

Description

The Texture property returns a TextureFill object which represents the properties of a texture fill.

Example

The following example creates a rectangle and applies a texture fill to it. The background color of the fill is then changed to red.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s.Fill.ApplyTextureFill "Patches 2C"

s.Fill.Texture.Properties("Background:").Value = CreateRGBColor(255, 0, 0)

End Sub

 Related Topics


Fill.Type

Property Type As cdrFillType

Fill

Description

The Type property returns the type of the fill. Depending on the current type of the fill, one of the following fill sub-objects is available: Fountain, Pattern, PostScript, Texture, UniformColor.

Note that in order to change the type of fill, you should use the corresponding "Apply" method of the Fill object. The exception is applying a uniform fill. Assigning a color to the UniformColor property will automatically set the fill type to cdrUniformFill.

Read-Only

Example

The following example lists the number of shapes with different fills in the document.

Sub Test()

Dim d As Document

Dim p As Page

Dim s As Shape

Dim msg As String

Dim num As Long

Dim NoFill As Long, Uniform As Long

Dim Fountain As Long, Pattern As Long

Dim Texture As Long, PostScript As Long

NoFill = 0

Uniform = 0

Fountain = 0

Pattern = 0

Texture = 0

PostScript = 0

num = 0

Set d = ActiveDocument

For Each p In d.Pages

For Each s In p.Shapes

Select Case s.Fill.Type

Case cdrNoFill

NoFill = NoFill + 1

Case cdrUniformFill

Uniform = Uniform + 1

Case cdrFountainFill

Fountain = Fountain + 1

Case cdrPatternFill

Pattern = Pattern + 1

Case cdrTextureFill

Texture = Texture + 1

Case cdrPostscriptFill

PostScript = PostScript + 1

End Select

num = num + 1

Next s

Next p

msg = "The document contains " & num & " shapes with:" & vbCr

msg = msg & "No fill: " & NoFill & vbCr

msg = msg & "Uniform fill: " & Uniform & vbCr

msg = msg & "Fountain fill: " & Fountain & vbCr

msg = msg & "Pattern fill: " & Pattern & vbCr

msg = msg & "Texture fill: " & Texture & vbCr

msg = msg & "PostScript fill: " & PostScript

MsgBox msg, vbInformation, "Statistics"

End Sub

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrPostscriptFill Then

s.Fill.PostScript.Select "Bricks"

End If

Next s

End Sub

Sub Test()

Dim s As Shape

Dim cc As FountainColor

For Each s In ActivePage.Shapes

Select Case s.Fill.Type

Case cdrUniformFill

s.Fill.UniformColor.ConvertToGray

Case cdrFountainFill

s.Fill.Fountain.StartColor.ConvertToGray

s.Fill.Fountain.EndColor.ConvertToGray

For Each cc In s.Fill.Fountain.Colors

cc.Color.ConvertToGray

Next cc

End Select

Next s

End Sub

 Related Topics


Fill.UniformColor

Property UniformColor As Color

Fill

Description

The UniformColor property returns a Color object which represents the uniform fill of a shape.

Assigning a color to UniformColor property will automatically set the fill type to cdrUniformFill.

Example

The following example creates a yellow rectangle.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s.Fill.UniformColor.RGBAssign 255, 255, 0

End Sub

 Related Topics


Fill.ApplyFountainFill

Function ApplyFountainFill([ByVal StartColor As Color = Nothing], [ByVal EndColor As Color = Nothing], [ByVal Type As cdrFountainFillType = cdrLinearFountainFill (1)], [ByVal Angle As Double = 0], [ByVal Steps As Long = 0], [ByVal EdgePad As Long = 0], [ByVal MidPoint As Long = 50], [ByVal BlendType As cdrFountainFillBlendType = cdrDirectFountainFillBlend (0)]) As FountainFill

Fill

Description

The ApplyFountainFill method applies a fountain fill to an object.

Parameters	Description

StartColor	Specifies the starting color of a fountain fill [in]
Optional
Default value = Nothing

EndColor	Specifies the ending color of a fountain fill effect [in]
Optional
Default value = Nothing

Type	Specifies the type of the fountain fill. The Type parameter has a value of cdrFountainFillType. [in]
Optional
Default value = cdrLinearFountainFill (1)

Angle	Specifies the angle in linear, conical or square fountain fills. Positive values rotate the fill counterclockwise; negative values rotate it clockwise. [in]
Optional
Default value = 0

Steps	Specifies the number of steps in a fountain fill [in]
Optional
Default value = 0

EdgePad	Specifies the length of the edge pad of linear, radial, and square fountain fills [in]
Optional
Default value = 0

MidPoint	Specifies the point at which two colors in a fountain fill converge. This value is expressed as a percentage. [in]
Optional
Default value = 50

BlendType	Specifies the type of fountain fill blend [in]
Optional
Default value = cdrDirectFountainFillBlend (0)

Return value

Returns FountainFill

Example

The following example creates a rectangle and applies a fountain fill that blends from red to yellow.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 5, 5)

s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(255, 255, 0)

End Sub

 Related Topics


Fill.ApplyNoFill

Sub ApplyNoFill()

Fill

Description

The ApplyNoFill method removes the fill from an object, leaving it unfilled.

Example

The following example removes the fill from the currently selected objects.

Sub Test()

ActiveSelection.Fill.ApplyNoFill

End Sub

 Related Topics


Fill.ApplyPatternFill

Function ApplyPatternFill(ByVal Type As cdrPatternFillType, [ByVal FileName As String], [ByVal PatternCanvasIndex As Long = 1], [ByVal FrontColor As Color = Nothing], [ByVal EndColor As Color = Nothing], [ByVal TransformWithShape As Boolean = False]) As PatternFill

Fill

Description

The ApplyPatternFill method applies a pattern fill to a shape. There are three types of pattern fills: two-color, full-color vector, and bitmapped.

Parameters	Description

Type	Specifies the type of the pattern fill and returns a value of cdrPatternFillType [in]

FileName	Specifies the full path and filename of the graphic that is imported as a pattern fill [in]
Optional

PatternCanvasIndex	Specifies the pattern canvas by its index number [in]
Optional
Default value = 1

FrontColor	Specifies the foreground color in a pattern fill [in]
Optional
Default value = Nothing

EndColor	Specifies the background color in a pattern fill [in]
Optional
Default value = Nothing

TransformWithShape	Determines whether the pattern fill changes according to transformations in the shape object [in]
Optional
Default value = False

Return value

Returns PatternFill

Example

The following example creates a rectangle and applies a bitmap pattern fill to it.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 5, 5)

s.Fill.ApplyPatternFill cdrBitmapPattern, Application.Path + "Custom\Canvas\breadc.pcx"

End Sub

 Related Topics


Fill.ApplyPostscriptFill

Function ApplyPostscriptFill(ByVal IndexOrName As Variant) As PostScriptFill

Fill

Description

The ApplyPostscriptFill method applies a PostScript fill to a shape.

Parameters	Description

IndexOrName	Specifies the PostScript fill by its name (for example, "Bubbles") or by its number in the list of available PostScript fills [in]

Return value

Returns PostScriptFill

Example

The following example creates a rectangle and applies the "Bubbles" PostScript fill to it.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 5, 5)

s.Fill.ApplyPostscriptFill "Bubbles"

End Sub

 Related Topics


Fill.ApplyTextureFill

Function ApplyTextureFill(ByVal TextureName As String, [ByVal LibraryName As String]) As TextureFill

Fill

Description

The ApplyTextureFill method applies a texture fill to a shape.

Parameters	Description

TextureName	Specifies the name of a texture fill pattern [in]

LibraryName	Specifies the name of the texture library. If this value is omitted, the main styles are used. [in]
Optional

Return value

Returns TextureFill

Example

The following example applies the "Blend Edges" texture from the Styles library

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 5, 5)

s.Fill.ApplyTextureFill "Blend Edges"

End Sub

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 5, 5)

s.Fill.ApplyTextureFill "Alien Eyes", "Samples 9"

End Sub

 Related Topics


Fill.ApplyUniformFill

Sub ApplyUniformFill(ByVal Color As Color)

Fill

Description

The ApplyUniformFill method applies a uniform fill to a shape using a Color object.

Alternatively you can assign a uniform fill by modifying the UniformColor property.

Parameters	Description

Color	Specifies the color of the fill. It uses an existing color component in a palette or a CreateColor method (for example, CreateCMYKColor or CreateRGBColor) to specify a color.  [in]

Example

The following examples creates swatches for each color in the default color palette that is open. A rectangle is created for each color in the palette and is then filled with the color. New pages are added if the swatches cannot fit on a single page.

Sub Test()

Dim d As Document

Dim p As Page

Dim c As Color

Dim s As Shape

Const sx As Double = 0.5

Const sy As Double = 0.5

Dim x As Double, y As Double

Dim MaxX As Long, nx As Long

Dim MaxY As Long, ny As Long

x = 0

y = 0

nx = 0

Set d = CreateDocument

d.Unit = cdrInch

Set p = d.ActivePage

MaxX = CLng(p.SizeWidth / sx)

MaxY = CLng(p.SizeHeight / sy)

For Each c In ActivePalette.Colors

Set s = p.ActiveLayer.CreateRectangle(x, y, x + sx, y + sy)

s.Fill.ApplyUniformFill c

x = x + sx

nx = nx + 1

If nx = MaxX Then

nx = 0

x = 0

y = y + sy

ny = ny + 1

If ny = MaxY Then

ny = 0

y = 0

Set p = d.AddPages(1)

End If

End If

Next c

End Sub

 Related Topics


FontList properties

FontList     Legend

    Application
    Count
  Item
    Parent


FontList

Class FontList

Properties     Referenced By

The FontList class represents the list of all fonts installed on the system.

 Related Topics


FontList.Application

Property Application As Object

FontList

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


FontList.Count

Property Count As Long

FontList

Description

The Count property returns the total number of fonts that are installed on the system.

Read-Only

Example

The following example displays the number of fonts currently installed on the system.

Sub Test()

MsgBox "Total number of fonts currently installed: " & FontList.Count

End Sub

 Related Topics


FontList.Item

Property Item(ByVal Index As Long) As String

FontList

Description

The Item property returns the name of the specified font.

The Item property is the default property and its reference may be omitted when accessing items in the collection. For example, FontList.Item(2) is the same as FontList(2) - they both reference the second font object in the FontList collection.

Read-Only

Parameters	Description

Index	Specifies the font by its index number [in]

Example

The following example checks if font "Arial" is installed on the system.

Sub Test()

If Not FontInstalled("Arial") Then

MsgBox "Font 'Arial' is not installed on your system"

End If

End Sub

'---- The following function determines if the given font is installed

Private Function FontInstalled(Name As String) As Boolean

Dim b As Boolean, n As Long

b = False

For n = 1 To FontList.Count

If UCase$(FontList(n)) = UCase$(Name) Then

b = True

Exit For

End If

Next n

FontInstalled = b

End Function

 Related Topics


FontList.Parent

Property Parent As Object

FontList

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


FountainColor properties

FountainColor     Legend

      Color
    Position


FountainColor methods

FountainColor     Legend

   Delete
   Move


FountainColor

Class FountainColor

Properties     Methods     Referenced By

The FountainColor class represents a single color point in a fountain fill.

 Related Topics


FountainColor.Color

Property Color As Color

FountainColor

Description

The Color property returns a Color object which represents color information about the color point in the fountain fill.

For a fountain transparency, the color is always grayscale.

Example

The following example converts all colors in the fountain fill to grayscale.

Sub Test()

Dim cl As FountainColor

If ActiveShape.Fill.Type <> cdrFountainFill Then

MsgBox "The selected shape must have a fountain fill."

Exit Sub

End If

For Each cl In ActiveShape.Fill.Fountain.Colors

cl.Color.ConvertToGray

Next cl

ActiveShape.Fill.Fountain.StartColor.ConvertToGray

ActiveShape.Fill.Fountain.EndColor.ConvertToGray

End Sub

 Related Topics


FountainColor.Position

Property Position As Long

FountainColor

Description

The Position property returns the position of a color point in the fountain fill. Valid positions range from 1 to 99.

Read-Only

Example

The following example deletes any color point with a position located at a distance greater than 50%.

Sub Test()

Dim cl As FountainColor

If ActiveShape.Fill.Type <> cdrFountainFill Then

MsgBox "The selected shape must have a fountain fill."

Exit Sub

End If

For Each cl In ActiveShape.Fill.Fountain.Colors

If cl.Position > 50 Then cl.Delete

Next cl

End Sub

 Related Topics


FountainColor.Delete

Sub Delete()

FountainColor

Description

The Delete method removes a color point from a fountain fill.

It is important to note that you cannot delete starting and ending color points.

Example

The following example removes any intermediate color points in a fountain fill, leaving only the starting and ending points.

Sub Test()

Dim cl As FountainColor

If ActiveShape.Fill.Type <> cdrFountainFill Then

MsgBox "The selected shape must have a fountain fill."

Exit Sub

End If

For Each cl In ActiveShape.Fill.Fountain.Colors

cl.Delete

Next cl

End Sub

 Related Topics


FountainColor.Move

Sub Move(ByVal NewPosition As Long)

FountainColor

Description

The Move method moves a color point to a specified position. If there is a color point at the specified position, it is replaced by the moved color point.

Parameters	Description

NewPosition	Specifies the new location of a color point. Valid positions range from 1 to 99. [in]

Example

The following example redistributes color points evenly within the selected fountain fill.

Sub Test()

Dim n As Long, i As Long

If ActiveShape.Fill.Type <> cdrFountainFill Then

MsgBox "The selected shape must have a fountain fill."

Exit Sub

End If

n = ActiveShape.Fill.Fountain.Colors.Count

If n > 0 Then

For i = 1 To n

ActiveShape.Fill.Fountain.Colors(i).Move i * 100 / (n + 1)

Next i

End If

End Sub

 Related Topics


FountainColors properties

FountainColors     Legend

    Count
      GrayLevel
    Item


FountainColors methods

FountainColors     Legend

   Add
   AddGrayLevel


FountainColors

Class FountainColors

Properties     Methods     Referenced By

The FountainColors class represents a collection of color points in a fountain fill or a fountain transparency.

 Related Topics


FountainColors.Count

Property Count As Long

FountainColors

Description

The Count property returns the number of color points in the FountainColors collection.

It is important to note that the starting and ending color points are not included in the count of color points in the collection. Only the color points between the start and end points are included with the Count property.

Read-Only

Example

The following example displays the number of color points in the fountain fill of the selected object. The selected object must have fountain fill before executing this code.

Sub Test()

MsgBox "Fountain fill contains " & ActiveShape.Fill.Fountain.Colors.Count & _

" intermediate color points."

End Sub

 Related Topics


FountainColors.GrayLevel

Property GrayLevel(ByVal Index As Long) As Long

FountainColors

Description

The GrayLevel property returns or sets the gray level of the specified color point. It is also useful for specifying the transparency level for a fountain transparency.

The index can range from 0 to (Count+1), where GrayLevel(0) represents the starting point and GrayLevel(Count+1) represents the ending color point of the fountain fill or transparency.

Parameters	Description

Index	Specifies the color point by its index number [in]

Example

The following example displays the number of points in the fountain transparency of the active shape. The points that are counted must have a transparency level of at least 50%.

Sub Test()

Dim ff As FountainFill

Dim t As Transparency

Dim n As Long, i As Long

Set t = ActiveShape.Transparency

If t.Type = cdrFountainTransparency Then

Set ff = t.Fountain

n = 0

For i = 1 To ff.Colors.Count

If ff.Colors.GrayLevel(i) < 128 Then n = n + 1

Next i

MsgBox "The current shape has " & n & " transparency points with 50% or greater transparency level."

Else

MsgBox "The shape doesn't have a fountain transparency."

End If

End Sub

 Related Topics


FountainColors.Item

Property Item(ByVal Index As Long) As FountainColor

FountainColors

Description

The Item property returns a FountainColor object for the specified color point.

The index can range from 0 to (Count+1), where Item(0) represents the starting point and Item(Count+1) represents the ending color point of the fountain fill or transparency.

The Item property is the default property and its reference may be omitted when referencing items in the collection. For example, Fountain.Colors.Item(2) is the same as Fountain.Colors(2) - they both reference the second color in the collection.

Parameters	Description

Index	Specifies the color point by its index number [in]

Example

The following example converts all colors in the fountain fill to grayscale.

Sub Test()

Dim ff As FountainFill

Dim i As Long

Set ff = ActiveShape.Fill.Fountain

For i = 0 To ff.Colors.Count + 1

ff.Colors(i).Color.ConvertToGray

Next i

End Sub

 Related Topics


FountainColors.Add

Sub Add(ByVal Color As Color, ByVal Position As Long)

FountainColors

Description

The Add method places a new color point at the specified position. If there is a color point at the specified position, the new color point replaces the existing color point. Valid positions range from 1 to 99.

Parameters	Description

Color	Specifies the color of the new color point. You can use an existing color name or a CreateColor method (for example, CreateCMYKColor, CreateRGBColor). [in]

Position	Specifies the location of the new color point. Valid positions range from 1 to 99 and are expressed as a percentage from the starting position. [in]

Example

The following example creates a rectangle and applies a linear fountain fill to it. It then adds two color points to the fill, yellow at 30%, and cyan at 60%.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(1, 1, 4, 3)

With s.Fill.ApplyFountainFill(CreateRGBColor(0, 0, 0), CreateRGBColor(255, 0, 0))

.Colors.Add CreateRGBColor(255, 255, 0), 30

.Colors.Add CreateRGBColor(0, 255, 255), 60

End With

End Sub

 Related Topics


FountainColors.AddGrayLevel

Sub AddGrayLevel(ByVal GrayLevel As Long, ByVal Position As Long)

FountainColors

Description

The AddGrayLevel method adds a new grayscale color point at a specified position. If there is a color point at the specified position, the new color point replaces the existing color point. Valid positions range from 1 to 99.

Parameters	Description

GrayLevel	The gray level is used to specify the transparency level for the fountain transparency. The Index value can range from 0 to Count+1, where 0 is the starting color point and Count+1 is the ending color point in the fountain or transparency. [in]

Position	The Position parameter defines the location of gray level in the FountainColors collection. If a color is given the position of 2, it is actually the third color point in the fountain effect, since the starting point holds an index of 0 and is not included as a collection point. Valid positions range from 1 to 99. [in]

Example

The following example creates an ellipse containing a fountain fill with a fountain transparency containing five interleaving transparency points.

Sub Test()

Dim s As Shape

Dim ff As FountainFill

Dim n As Long

Set s = ActiveLayer.CreateEllipse2(4, 5.5, 4)

s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(255, 255, 0), , 90

Set ff = s.Transparency.ApplyFountainTransparency(100, 100)

For n = 1 To 5

ff.Colors.AddGrayLevel (n Mod 2) * 255, n * 100 / 6

Next n

End Sub

 Related Topics


FountainFill properties

FountainFill     Legend

    Angle
      BlendType
      Colors
    EdgePad
      EndColor
      EndX
      EndY
      MidPoint
      StartColor
      StartX
      StartY
      Steps
      Type


FountainFill methods

FountainFill     Legend

   SetAngle
   SetEdgePad
   Translate


FountainFill

Class FountainFill

Properties     Methods     Referenced By

The FountainFill class represents a fountain fill or a fountain transparency.

 Related Topics


FountainFill.Angle

Property Angle As Double

FountainFill

Description

The Angle property returns the angle of the fountain fill. Positive values rotate the fill counterclockwise; negative values rotate it clockwise.

You can use the SetAngle method to change the angle of fountain fill.

Read-Only

Example

The following example displays the angle of the fountain fill of the selected shape.

Sub Test()

MsgBox ActiveShape.Fill.Fountain.Angle

End Sub

 Related Topics


FountainFill.BlendType

Property BlendType As cdrFountainFillBlendType

FountainFill

Description

The BlendType property returns or sets the type of color blending in a fountain fill.

This value returns cdrFountainFillBlendType.

Example

The following example counts the total number of shapes with fountain fills in the active document, as well as lists the number of shapes of each different type of fountain color blend.

Sub Test()

Dim s As Shape

Dim nDirect As Long, nCW As Long, nCCW As Long, nCustom As Long

Dim nCount As Long

nDirect = 0: nCW = 0: nCCW = 0: nCustom = 0

nCount = 0

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrFountainFill Then

Select Case s.Fill.Fountain.BlendType

Case cdrRainbowCWFountainFillBlend

nCW = nCW + 1

Case cdrRainbowCCWFountainFillBlend

nCCW = nCCW + 1

Case cdrDirectFountainFillBlend

nDirect = nDirect + 1

Case cdrCustomFountainFillBlend

nCustom = nCustom + 1

End Select

nCount = nCount + 1

End If

Next s

MsgBox "The document contains " & nCount & " shape(s) with fountain fill including:" & vbCr & _

nCustom & " with custom color blend" & vbCr & _

nDirect & " with direct color blend" & vbCr & _

nCW & " with clockwise color blend" & vbCr & _

nCCW & " with counterclockwise color blend"

End Sub

 Related Topics


FountainFill.Colors

Property Colors As FountainColors

FountainFill

Description

The Colors property returns the FountainColors collection which represents all color points of a fountain fill.

The element with an index value of zero represents the starting color point of the fountain fill. The last element (Count+1) is the last color point of the fill.

Example

The following example converts all colors of fountain fills in shapes to grayscale.

Sub Test()

Dim s As Shape

Dim ff As FountainFill

Dim i As Long

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrFountainFill Then

Set ff = s.Fill.Fountain

For i = 0 To ff.Colors.Count + 1

ff.Colors(i).Color.ConvertToGray

Next i

End If

Next s

End Sub

 Related Topics


FountainFill.EdgePad

Property EdgePad As Long

FountainFill

Description

The EdgePad parameter returns the percentage value of the edge pad of a fountain fill.

You can use the SetEdgePad method to change the value of the edge pad.

Read-Only

Example

The following example displays the percentage value of the edge pad of the fountain fill in the active shape.

Sub Test()

MsgBox ActiveShape.Fill.Fountain.EdgePad

End Sub

 Related Topics


FountainFill.EndColor

Property EndColor As Color

FountainFill

Description

The EndColor property returns or sets the ending color a fountain fill.

You can also access the ending color point of the fill by using the .Colors(.Colors.Count+1) property of the FountainColors collection.

Example

The following example displays the names of the colors of the starting and ending color points of the fountain fill.

Sub Test()

Dim ff As FountainFill

If ActiveShape.Fill.Type = cdrFountainFill Then

Set ff = ActiveShape.Fill.Fountain

MsgBox "The fountain fill is from " & ff.StartColor.Name & _

" to " & ff.EndColor.Name

Else

MsgBox "The selected shape doesn't have a fountain fill"

End If

End Sub

 Related Topics


FountainFill.EndX

Property EndX As Double

FountainFill

Description

The EndX property returns or sets the horizontal ending coordinate of a fountain fill vector. For radial, rectangular, and conical fills, the starting point is the center point of the fill.

The EndX property is measured in document units.

Example

The following example draws circles around the starting and ending points of the fountain fill vector.

Sub Test()

With ActiveShape.Fill.Fountain

ActiveLayer.CreateEllipse2 .StartX, .StartY, 0.2

ActiveLayer.CreateEllipse2 .EndX, .EndY, 0.2

End With

End Sub

 Related Topics


FountainFill.EndY

Property EndY As Double

FountainFill

Description

The EndY property returns or sets the horizontal ending coordinate of a fountain fill vector. For radial, rectangular, and conical fills, the starting point is the center point of the fill.

The EndY property is measured in document units.

Example

The following example draws circles around the starting and ending points of the fountain fill vector.

Sub Test()

With ActiveShape.Fill.Fountain

ActiveLayer.CreateEllipse2 .StartX, .StartY, 0.2

ActiveLayer.CreateEllipse2 .EndX, .EndY, 0.2

End With

End Sub

 Related Topics


FountainFill.MidPoint

Property MidPoint As Long

FountainFill

Description

The MidPoint property returns or sets the position of the midpoint of a simple fountain fill with no more than two colors.

Example

The following example sets the midpoint of all two-color fountain fills on the active page to 80%.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrFountainFill Then

If s.Fill.Fountain.BlendType <> cdrCustomFountainFillBlend Then

s.Fill.Fountain.MidPoint = 80

End If

End If

Next s

End Sub

 Related Topics


FountainFill.StartColor

Property StartColor As Color

FountainFill

Description

The StartColor property returns or sets the starting color a fountain fill.

You can also access the starting color point of the fill by using the .Colors(0) property of the FountainColors collection.

Example

The following example displays the names of the colors of the starting and ending color points of the fountain fill.

Sub Test()

Dim ff As FountainFill

If ActiveShape.Fill.Type = cdrFountainFill Then

Set ff = ActiveShape.Fill.Fountain

MsgBox "The fountain fill is from " & ff.StartColor.Name & _

" to " & ff.EndColor.Name

Else

MsgBox "The selected shape doesn't have a fountain fill"

End If

End Sub

 Related Topics


FountainFill.StartX

Property StartX As Double

FountainFill

Description

The StartX property returns or sets the horizontal starting coordinate of a fountain fill vector. For radial, rectangular, and conical fills, the starting point is the center point of the fill.

The StartX property is measured in document units.

Example

The following example draws circles around the starting and ending points of the fountain fill vector.

Sub Test()

With ActiveShape.Fill.Fountain

ActiveLayer.CreateEllipse2 .StartX, .StartY, 0.2

ActiveLayer.CreateEllipse2 .EndX, .EndY, 0.2

End With

End Sub

 Related Topics


FountainFill.StartY

Property StartY As Double

FountainFill

Description

The StartY property returns or sets the vertical starting coordinate of a fountain fill vector. For radial, rectangular, and conical fills, the starting point is the center point of the fill.

The StartY property is measured in document units.

Example

The following example draws circles around the starting and ending points of the fountain fill vector.

Sub Test()

With ActiveShape.Fill.Fountain

ActiveLayer.CreateEllipse2 .StartX, .StartY, 0.2

ActiveLayer.CreateEllipse2 .EndX, .EndY, 0.2

End With

End Sub

 Related Topics


FountainFill.Steps

Property Steps As Long

FountainFill

Description

The Steps property returns or sets the number of steps in a fountain fill. The value can range from 2 to 999. If the value is equal to zero, the default number of steps of the document is used.

Example

The following example looks through all shapes on the current page for a fountain fill with a specified number of fountain steps (that is, where the value of the Steps property is not zero). If a shape was selected before this macro was played, it will look for next shape with a fixed number of steps (continue search).

Sub FindFixedSteps()

Dim s As Shape, id As Long

Dim bLoop As Boolean

Set s = ActiveShape

If s Is Nothing Then

' Nothing selected. Get the first shape on the page.

Set s = ActivePage.Shapes(1)

If TestShape(s) Then

s.CreateSelection

Exit Sub ' Shape Found

End If

End If

id = s.StaticID ' Remember the ID of the selected shape.

Do

Set s = s.Next(cdrLevelPage, True, True) ' Get the next shape.

If TestShape(s) Then

s.CreateSelection

Exit Sub ' Shape Found

End If

Loop While id <> s.StaticID ' Loop until we find the selected shape again.

MsgBox "Shape not found", vbCritical

End Sub

' The following function is used to see if the current shape is the one

' we are looking for.

Private Function TestShape(s As Shape) As Boolean

Dim b As Boolean

b = False

If s.Fill.Type = cdrFountainFill Then

If s.Fill.Fountain.Steps <> 0 Then b = True

End If

TestShape = b

End Function

 Related Topics


FountainFill.Type

Property Type As cdrFountainFillType

FountainFill

Description

The Type property returns or sets the type of the fountain fill. A fountain fill can be linear, conical, radial, or square. The Type parameter returns cdrFountainFillType.

Example

The following example changes all linear fountain fills on the active page to conical fountain fills.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrFountainFill Then

If s.Fill.Fountain.Type = cdrLinearFountainFill Then

s.Fill.Fountain.Type = cdrConicalFountainFill

End If

End If

Next s

End Sub

 Related Topics


FountainFill.SetAngle

Sub SetAngle(ByVal Angle As Double)

FountainFill

Description

The Angle property rotates the fountain fill vector. Positive values rotate the fill counterclockwise; negative values rotate it clockwise.

Parameters	Description

Angle	Specifies the rotation in degrees. This value can range from 0 to 360. [in]

Example

The following example sets the rotation angle of the fountain fill to 30 degrees.

Sub Test()

ActiveShape.Fill.Fountain.SetAngle 30

End Sub

 Related Topics


FountainFill.SetEdgePad

Sub SetEdgePad(ByVal EdgePad As Long)

FountainFill

Description

The SetEdgePad method sets the value of the edge pad value of a fountain fill. Changing the edge pad of the fill may change the position of the fountain fill vector.

Parameters	Description

EdgePad	Specifies the length of solid colors at the beginning and end of the fountain fill before they start blending with the next color in the fountain fill. The EdgePad parameter is a percentage value, and values range from 0 to 49. [in]

Example

The following example sets the value of the edge pad in the fountain fill of the active shape to 40%.

Sub Test()

ActiveShape.Fill.Fountain.SetEdgePad 40

End Sub

 Related Topics


FountainFill.Translate

Sub Translate(ByVal X As Double, ByVal Y As Double)

FountainFill

Description

The Translate method repositions the fountain fill vector. Both the starting and ending points of the fountain fill vector are moved by the specified offset.

Parameters	Description

X	Specifies the horizontal offset measured in document units [in]

Y	Specifies the vertical offset measured in document units [in]

Example

The following example centers a fountain fill in the active shape (by placing the center of the fill in the center of the shape).

Sub Test()

Dim ff As FountainFill

Dim cx As Double, cy As Double ' Current position of fill center

Dim sx As Double, sy As Double ' Shape's center

If ActiveShape.Fill.Type = cdrFountainFill Then

Set ff = ActiveShape.Fill.Fountain

Select Case ff.Type

Case cdrSquareFountainFill, cdrRadialFountainFill, cdrConicalFountainFill

cx = ff.StartX

cy = ff.StartY

Case cdrLinearFountainFill

cx = (ff.StartX + ff.EndX) / 2

cy = (ff.StartY + ff.EndY) / 2

End Select

ActiveDocument.ReferencePoint = cdrCenter

ActiveShape.GetPosition sx, sy

ff.Translate sx - cx, sy - cy

End If

End Sub

 Related Topics


FrameWork properties

FrameWork     Legend

    CommandBars
    MainMenu
  Name
    StatusBar


FrameWork methods

FrameWork     Legend

   ImportWorkspace


FrameWork

Class FrameWork

Properties     Methods     Referenced By

The FrameWork class defines the characteristics of CorelDRAW tool objects. The FrameWork object in CorelDRAW acts as a container for the tools that you use to construct and view your CorelDRAW objects.

There are several features contained within the framework of CorelDRAW. The Command Bars, Menus, Status Bar, Toolbars, Main Menu, and Key Tables are primary components of any CorelDRAW document.

 Related Topics


FrameWork.CommandBars

Property CommandBars As CommandBars

FrameWork

Description

The CommandBars property returns the CommandBars collection. A command bar can be a toolbar, menu bar, status bar, pop-up menu bar, or a property bar.

Read-Only

Example

The following example displays the number of command bars in the Framework.

Sub FrameCommand()

With FrameWork

MsgBox .CommandBars.Count

End With

End Sub

 Related Topics


FrameWork.MainMenu

Property MainMenu As CommandBar

FrameWork

Description

The MainMenu property returns a CommandBar object which represents the properties of the menu bar.

Read-Only

Example

The following example counts the number of control located in the menu bar.

Sub MenuHide()

With FrameWork

.MainMenu.Enabled = False

End With

End Sub

 Related Topics


FrameWork.Name

Property Name As String

FrameWork

Description

The Name property returns the name of the FrameWork object.

Read-Only

Example

The following example displays the name of the framework object.

Sub Frame()

With FrameWork

MsgBox .Name

End With

End Sub

 Related Topics


FrameWork.StatusBar

Property StatusBar As CommandBar

FrameWork

Description

The StatusBar property returns CommandBar object which the properties of the status bar.

Read-Only

Example

The following example displays the number of status bar controls in the Framework.

Sub FrameCommand()

With FrameWork

MsgBox .StatusBar.Controls.Count

End With

End Sub

 Related Topics


FrameWork.ImportWorkspace

Sub ImportWorkspace(ByVal FileName As String)

FrameWork

Description

The ImportWorkspace method imports a workspace into the framework.

Parameters	Description

FileName	Specifies the full path and filename of the workspace to import [in]

 Related Topics


GlobalDocument events

GlobalDocument

AfterPrint
AfterSave
AfterSaveAs
BeforeClose
BeforePrint
BeforeSave
BeforeSaveAs
CorelScriptStartPlaying
CorelScriptStartRecording
CorelScriptStopPlaying
CorelScriptStopRecording
LayerCreated
LayerDeleted
LayerSelected
NewDocument
OpenDocument
PageCreated
PageDeleted
PageSelected
Quit
SelectionChanged
ShapeCreated
ShapeDeleted
ShapeMoved
Start


GlobalDocument

Class GlobalDocument

Events     Referenced By

The GlobalDocument class represents events that are triggered by a specific action made in the application or document.

 Related Topics


GlobalDocument.AfterPrint

Event AfterPrint()

GlobalDocument

Description

The AfterPrint event is triggered after the Print dialog box closes.

 Related Topics


GlobalDocument.AfterSave

Event AfterSave(ByVal FileName As String)

GlobalDocument

Description

The AfterSave event is triggered after the document has been saved using the Save command.

Parameters	Description

FileName	Specifies the filename of the saved document [in]

 Related Topics


GlobalDocument.AfterSaveAs

Event AfterSaveAs(ByVal FileName As String)

GlobalDocument

Description

The AfterSaveAs event is triggered after the document has been saved using the Save As command.

Parameters	Description

FileName	Specifies the filename of the saved document [in]

 Related Topics


GlobalDocument.BeforeClose

Event BeforeClose()

GlobalDocument

Description

The BeforeClose event is triggered before the document closes.

 Related Topics


GlobalDocument.BeforePrint

Event BeforePrint()

GlobalDocument

Description

The BeforePrint event is triggered after the Print dialog box displays and after the Print button has been pressed, but before printing beings.

 Related Topics


GlobalDocument.BeforeSave

Event BeforeSave()

GlobalDocument

Description

The BeforeSave event is triggered before the Save dialog box displays.

 Related Topics


GlobalDocument.BeforeSaveAs

Event BeforeSaveAs()

GlobalDocument

Description

The BeforeSaveAs event is triggered before the Save dialog box displays.

 Related Topics


GlobalDocument.CorelScriptStartPlaying

Event CorelScriptStartPlaying()

GlobalDocument

Description

The CorelScriptstartPlaying event is triggered after a Corel SCRIPT macro is run.

 Related Topics


GlobalDocument.CorelScriptStartRecording

Event CorelScriptStartRecording()

GlobalDocument

Description

The CorelScripStartRecording event is triggered after you start recording a Corel SCRIPT macro.

 Related Topics


GlobalDocument.CorelScriptStopPlaying

Event CorelScriptStopPlaying()

GlobalDocument

Description

The CorelScriptStopPlaying event is triggered after a Corel SCRIPT macro has finished running.

 Related Topics


GlobalDocument.CorelScriptStopRecording

Event CorelScriptStopRecording(ByVal FileName As String)

GlobalDocument

Description

The CorelScriptStopRecording event is triggered after a Corel SCRIPT macro is finished recording.

Parameters	Description

FileName	Specifies the filename [in]

 Related Topics


GlobalDocument.LayerCreated

Event LayerCreated(ByRef Layer As Layer)

GlobalDocument

Description

The LayerCreated event is triggered after a layer is created.

Parameters	Description

Layer	Specifies the name of the new layer [in]

 Related Topics


GlobalDocument.LayerDeleted

Event LayerDeleted(ByRef Layer As Layer)

GlobalDocument

Description

The LayerDeleted event is triggered after a layer is deleted.

Parameters	Description

Layer	Specifies the name of the deleted layer [in]

 Related Topics


GlobalDocument.LayerSelected

Event LayerSelected(ByRef Layer As Layer)

GlobalDocument

Description

The LayerSelected event is triggered after a specified layer is selected.

Parameters	Description

Layer	Specifies the name of the selected layer [in]

 Related Topics


GlobalDocument.NewDocument

Event NewDocument(ByVal Document As Document)

GlobalDocument

Description

The NewDocument event is triggered after a new document is created.

Parameters	Description

Document	Specifies the name of the new document [in]

 Related Topics


GlobalDocument.OpenDocument

Event OpenDocument(ByVal Document As Document)

GlobalDocument

Description

The OpenDocument event is triggered after a specified document is opened.

Parameters	Description

Document	Specifies the name of the document [in]

 Related Topics


GlobalDocument.PageCreated

Event PageCreated(ByRef Page As Page)

GlobalDocument

Description

The PageCreated event is triggered after a page is created.

Parameters	Description

Page	Specifies the name of the page [in]

 Related Topics


GlobalDocument.PageDeleted

Event PageDeleted(ByRef Page As Page)

GlobalDocument

Description

The PageDeleted event is triggered after a page is deleted.

Parameters	Description

Page	Specifies the name of the page [in]

 Related Topics


GlobalDocument.PageSelected

Event PageSelected(ByRef Page As Page)

GlobalDocument

Description

The PageSelected event is triggered after a page is selected.

Parameters	Description

Page	[in]

 Related Topics


GlobalDocument.Quit

Event Quit()

GlobalDocument

Description

The Quit event is triggered after the application is closed.

 Related Topics


GlobalDocument.SelectionChanged

Event SelectionChanged(ByRef Shape As Shape)

GlobalDocument

Description

The SelectionChanged event is triggered after the selection is changed.

Parameters	Description

Shape	[in]

 Related Topics


GlobalDocument.ShapeCreated

Event ShapeCreated(ByRef Shape As Shape)

GlobalDocument

Description

The ShapeCreated event is triggered after a shape is created.

Parameters	Description

Shape	[in]

 Related Topics


GlobalDocument.ShapeDeleted

Event ShapeDeleted(ByRef Shape As Shape)

GlobalDocument

Description

The ShapeDeleted event is triggered after a shape is deleted.

Parameters	Description

Shape	[in]

 Related Topics


GlobalDocument.ShapeMoved

Event ShapeMoved(ByRef Shape As Shape)

GlobalDocument

Description

The ShapeMoved event is triggered after a shape is moved.

Parameters	Description

Shape	[in]

 Related Topics


GlobalDocument.Start

Event Start()

GlobalDocument

Description

The Start event is triggered after the application is started.

 Related Topics


GMSManager properties

GMSManager     Legend

    GMSPath
    UserGMSPath


GMSManager methods

GMSManager     Legend

   RunMacro


GMSManager

Class GMSManager

Properties     Methods     Referenced By

The GMSManager class allows you to work with GMS (Global Macro Storage) modules and run VBA macros from other programs.

 Related Topics


GMSManager.GMSPath

Property GMSPath As String

GMSManager

Description

The GMSPath property returns the path to the folder where all GMS modules are installed.

The path always ends with the backslash character (\).

Read-Only

Example

The following example displays the path to the GMS folder in the current CorelDRAW installation.

Sub Test()

MsgBox GMSManager.GMSPath

End Sub

 Related Topics


GMSManager.UserGMSPath

Property UserGMSPath As String

GMSManager

Description

The UserGMSPath returns a path to the folder where all GMS modules are stored in the user's system profile.

Read-Only

 Related Topics


GMSManager.RunMacro

Function RunMacro(ByVal ModuleName As String, ByVal MacroName As String, ByRef Parameters() As Variant) As Variant

GMSManager

Description

The RunMacro method runs a function or a subroutine located in another GMS module. This method returns a variant.

Parameters	Description

ModuleName	Specifies the name of the module [in]

MacroName	Specifies the name of the macro to run [in]

Parameters	Represents values that are passed to the function or subroutine that is called. The types and the number of parameters must match those of the function or subroutine that is called. If you call a function, its return value is returned by the RunMacro method.

Return value

Returns Variant

Example

The following subroutine is contained in the module "MyModule" which is part of the GMS file "GlobalMacros."

Sub MyTestSub()

MsgBox "Hello world!"

End Sub

Sub Test()

GMSManager.RunMacro "GlobalMacros", "MyModule.MyTestSub"

End Sub

The following function is contained in the module "MyModule" which is part of the GMS file "GlobalMacros."

Function Multiply(x As Double, y As Double) As Double

Multiply = x * y

End Function

Sub Test()

Dim v As Double

v = GMSManager.RunMacro("GlobalMacros", "MyModule.Multiply", 4, 7)

MsgBox "4 * 7 = " & v

End Sub

 Related Topics


Grid properties

Grid     Legend

    Application
    Parent
      Snap
      SpacingX
      SpacingY
      Type
      Visible


Grid methods

Grid     Legend

   SetFrequency


Grid

Class Grid

Properties     Methods     Referenced By

The Grid class represents document grid settings.

 Related Topics


Grid.Application

Property Application As Application

Grid

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Grid.Parent

Property Parent As Document

Grid

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Grid.Snap

Property Snap As Boolean

Grid

Description

The Snap property determines whether the Snap To Grid feature is enabled. If the Snap property is set to True, the Snap to Grid feature is enabled.

Example

The following example enables snapping to a grid.

Sub Test()

ActiveDocument.Grid.Snap = True

End Sub

 Related Topics


Grid.SpacingX

Property SpacingX As Double

Grid

Description

The SpacingX property returns or sets the horizontal distance between grid lines or dots.

The minimum value is 0.005 inch.

You can use the SetFrequency method to specify the frequency of the lines or dots per unit length.

Example

The following example sets the spacing within the grid so that vertical and horizontal grid lines appear every .5 inches from each other.

Sub Test()

With ActiveDocument.Grid

.SpacingX = 0.5

.SpacingY = 0.5

End With

End Sub

 Related Topics


Grid.SpacingY

Property SpacingY As Double

Grid

Description

The SpacingY property returns or sets the vertical spacing between grid lines or dots.

The minimum value is 0.005 inch.

You can use the SetFrequency method to specify the frequency of the lines or dots per unit length.

Example

The following example sets the spacing within the grid so that vertical and horizontal grid lines appear every .5 inches from each other.

Sub Test()

With ActiveDocument.Grid

.SpacingX = 0.5

.SpacingY = 0.5

End With

End Sub

 Related Topics


Grid.Type

Property Type As cdrGridType

Grid

Description

The Type property returns or sets whether the grid is visible as dots or as lines.

The Type property returns a value of cdrGridType.

Example

The following example creates a grid with intersecting lines

Sub Test()

ActiveDocument.Grid.Type = cdrGridLine

End Sub

 Related Topics


Grid.Visible

Property Visible As Boolean

Grid

Description

The Visible property shows or hides the grid. If the Visible property is True, the grid appears in the drawing window.

Example

The following example hides the grid.

Sub Test()

ActiveDocument.Grid.Visible = False

End Sub

 Related Topics


Grid.SetFrequency

Sub SetFrequency(ByVal GridX As Double, ByVal GridY As Double)

Grid

Description

The SetFrequency method specifies grid spacing as frequency, the number of grid lines (or dots) per unit of length.

Parameters	Description

GridX	Specifies the number of horizontal grid lines or dots appear per unit of length. The minimum value is 0.005 inch. [in]

GridY	Specifies the number of vertical grid lines or dots appear per unit of length. The minimum value is 0.005 inch. [in]

Example

The following example sets five lines per inch horizontally and three lines per inch vertically in the grid.

Sub Test()

ActiveDocument.Unit = cdrInch

ActiveDocument.Grid.SetFrequency 5, 3

End Sub

 Related Topics


Guide properties

Guide     Legend

    Preset
    Type


Guide methods

Guide     Legend

   MakeEditable


Guide

Class Guide

Properties     Methods     Referenced By

The Guide class represents the guideline-specific information of a Shape object.

 Related Topics


Guide.Preset

Property Preset As Boolean

Guide

Description

The Preset property determines whether a guideline is a preset guideline. If a guideline is a preset guideline, the Preset property will return a value of True. If it is not a preset guideline, a value of False is returned.

Read-Only

Example

The following example removes all guidelines that are not preset guidelines on the master page.

Sub Test()

Dim s As Shape

For Each s In ActiveDocument.Pages(0).Guides(cdrAllGuides)

If Not s.Guide.Preset Then s.Delete

Next s

End Sub

 Related Topics


Guide.Type

Property Type As cdrGuideType

Guide

Description

The Type property returns the type of the guideline. A guideline may be one of three types: horizontal, vertical, or slanted.

Read-Only

Example

The following example displays the number of horizontal, vertical, and slanted guidelines in the master page.

Sub Test()

Dim s As Shape

Dim hg As Long, vg As Long, sg As Long

For Each s In ActiveDocument.Pages(0).Guides(cdrAllGuides)

Select Case s.Guide.Type

Case cdrVerticalGuide

vg = vg + 1

Case cdrSlantedGuide

sg = sg + 1

Case cdrHorizontalGuide

hg = hg + 1

End Select

Next s

MsgBox "The document contains:" & vbCr & _

"Horizontal guides: " & hg & vbCr & _

"Vertical guides: " & vg & vbCr & _

"Slanted guides: " & sg

End Sub

 Related Topics


Guide.MakeEditable

Sub MakeEditable()

Guide

Description

The MakeEditable method converts a preset guideline to a normal guideline that may be edited directly on the drawing page.

Example

The following example converts all preset guidelines to normal guidelines on the master page.

Sub Test()

Dim s As Shape

For Each s In ActiveDocument.Pages(0).Guides(cdrAllGuides)

If s.Guide.Preset Then s.Guide.MakeEditable

Next s

End Sub

 Related Topics


IImportCropHandler methods

IImportCropHandler     Legend

   Crop


IImportCropHandler

Class IImportCropHandler

Methods     Referenced By

 Related Topics


IImportCropHandler.Crop

Function Crop(ByVal Options As StructImportCropOptions) As Boolean

IImportCropHandler

Description

Parameters	Description

Options	[in]

Return value

Returns Boolean

Example

The following example creates a new crop options class. It then imports a JPEG file and crops it depending on the value for CustomData. Before the crop is applied, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cCrop."

Option Explicit

Implements IImportCropHandler

Private Function IImportCropHandler_Crop(ByVal Options As IStructImportCropOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

s = s & "ImageHeight:  " & Options.ImageHeight & vbCr

s = s & "ImageWidth:  " & Options.ImageWidth & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 7 then crop half of the original; otherwise, subtract 0.5 units from the height and width.

If Options.CustomData = 7 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Options.Top = Options.Top / 2

Options.Left = Options.Left / 2

Else

Options.Height = Options.Height - 0.5

Options.Width = Options.Width - 0.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testCrop()

' Declare a new crop class.

Dim MyCrop As New cCrop

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to crop.

io.Mode = cdrImportCrop

' Set the custom data.

io.CustomData = 7

' Set the import options crop handler to the one created.

Set io.CropHandler = MyCrop

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


IImportResampleHandler methods

IImportResampleHandler     Legend

   Resample


IImportResampleHandler

Class IImportResampleHandler

Methods     Referenced By

 Related Topics


IImportResampleHandler.Resample

Function Resample(ByVal Options As StructImportResampleOptions) As Boolean

IImportResampleHandler

Description

Parameters	Description

Options	[in]

Return value

Returns Boolean

Example

The following example creates a new resample options class. It then imports a JPEG file and resamples it depending on the value for CustomData. Before it applies the resampling, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cResample."

Option Explicit

Implements IImportResampleHandler

Private Function IImportResampleHandler_Resample(ByVal Options As IStructImportResampleOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 8, then resample half of the original; otherwise 1.5

If Options.CustomData = 8 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Else

Options.Height = Options.Height / 1.5

Options.Width = Options.Width / 1.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testResample()

' Declare a new resample class.

Dim MyResampler As New cResample

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to resample.

io.Mode = cdrImportResample

' Set the custom data.

io.CustomData = 8

' Set the import options resample handler to the one created.

Set io.ResampleHandler = MyResampler

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


ImportFilter properties

ImportFilter     Legend

    HasDialog


ImportFilter methods

ImportFilter     Legend

   Finish
   Reset
   ShowDialog


ImportFilter

Class ImportFilter

Properties     Methods     Referenced By

ImportFilter Class

 Related Topics


ImportFilter.HasDialog

Property HasDialog As Boolean

ImportFilter

Description

Read-Only

Example

The following example imports the file "C:\Example.jpg" and returns an ImportFilter object which is used to determine if the filter has a dialog. If the filter has a dialog, the dialog is displayed; otherwise, the default JPEG settings are applied. The Finish method is called to finish the import.

Sub Test()

Dim d As Document

Dim s As Shape

Dim i As ImportFilter

Set d = CreateDocument

Set i = d.ActiveLayer.ImportEx("C:\Example.jpg", cdrJPEG)

If i.HasDialog Then

i.ShowDialog

i.Finish

Else

i.Reset

i.Finish

End If

End Sub

 Related Topics


ImportFilter.Finish

Sub Finish()

ImportFilter

Description

Example

The following example imports the file "C:\Example.jpg" and returns an ImportFilter object which is used to determine if the filter has a dialog. If the filter has a dialog, the dialog is displayed; otherwise, the default JPEG settings are applied. The Finish method is called to finish the import.

Sub Test()

Dim d As Document

Dim s As Shape

Dim i As ImportFilter

Set d = CreateDocument

Set i = d.ActiveLayer.ImportEx("C:\Example.jpg", cdrJPEG)

If i.HasDialog Then

i.ShowDialog

i.Finish

Else

i.Reset

i.Finish

End If

End Sub

 Related Topics


ImportFilter.Reset

Sub Reset()

ImportFilter

Description

Example

The following example imports the file "C:\Example.jpg" and returns an ImportFilter object which is used to determine if the filter has a dialog. If the filter has a dialog, the dialog is displayed; otherwise, the default JPEG settings are applied. The Finish method is called to finish the import.

Sub Test()

Dim d As Document

Dim s As Shape

Dim i As ImportFilter

Set d = CreateDocument

Set i = d.ActiveLayer.ImportEx("C:\Example.jpg", cdrJPEG)

If i.HasDialog Then

i.ShowDialog

i.Finish

Else

i.Reset

i.Finish

End If

End Sub

 Related Topics


ImportFilter.ShowDialog

Function ShowDialog([ByVal hWnd As Long = 0]) As Boolean

ImportFilter

Description

Parameters	Description

hWnd	[in]
Optional
Default value = 0

Return value

Returns Boolean

Example

The following example imports the file "C:\Example.jpg" and returns an ImportFilter object which is used to determine if the filter has a dialog. If the filter has a dialog, the dialog is displayed; otherwise, the default JPEG settings are applied. The Finish method is called to finish the import.

Sub Test()

Dim d As Document

Dim s As Shape

Dim i As ImportFilter

Set d = CreateDocument

Set i = d.ActiveLayer.ImportEx("C:\Example.jpg.jpg", cdrJPEG)

If i.HasDialog Then

i.ShowDialog

i.Finish

Else

i.Reset

i.Finish

End If

End Sub

 Related Topics


Layer properties

Layer     Legend

    Application
      Color
      Editable
    Index
      Master
    MasterProperties
      Name
      OverrideColor
    Parent
      Printable
    Properties
    Shapes
      Visible


Layer methods

Layer     Legend

   Activate
   CreateArtisticText
   CreateArtisticTextWide
   CreateConnector
   CreateCurve
   CreateCurveSegment
   CreateCurveSegment2
   CreateEllipse
   CreateEllipse2
   CreateFreeConnector
   CreateGridBoxes
   CreateGuide
   CreateGuideAngle
   CreateLineSegment
   CreateParagraphText
   CreateParagraphTextWide
   CreatePolygon
   CreateRectangle
   CreateRectangle2
   CreateSpiral
   Delete
   FindShape
   FindShapes
   Import
   ImportEx
   MoveAbove
   MoveBelow
   Paste


Layer

Class Layer

Properties     Methods     Referenced By

The Layer class represents a document layer.

 Related Topics


Layer.Application

Property Application As Application

Layer

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Layer.Color

Property Color As Color

Layer

Description

The Color property returns or sets the override color of a layer.

Example

The following example sets the color override feature to True in the active layer and the override color to RGB red.

Sub Test()

ActiveLayer.OverrideColor = True

ActiveLayer.Color.RGBAssign 255, 0, 0

End Sub

 Related Topics


Layer.Editable

Property Editable As Boolean

Layer

Description

The Editable property returns or sets whether a layer is editable (unlocked).

If the Editable property of a layer is True, the layer and its contents are editable.

Example

The following example locks the active layer. Once the layer is locked, edits cannot be made to the layer or its contents.

Sub Test()

ActiveLayer.Editable = False

End Sub

 Related Topics


Layer.Index

Property Index As Long

Layer

Description

The Index property returns the index number of the layer within the Layers collection.

Read-Only

Example

The following example adds a text string named "Layer:" and the index number of each layer to the lower left corner of each layer in the active page.

Sub Test()

Dim l As Layer

For Each l In ActivePage.Layers

l.CreateArtisticText 0, 0, "Layer:" & l.Index, , , 10

Next l

End Sub

 Related Topics


Layer.Master

Property Master As Boolean

Layer

Description

The Master property returns or sets whether the layer is a master state or a local layer.

If the Master property is True, the layer acts as a master layer for the entire document and its contents will appear on every page in that document.

Example

The following example makes the active layer a master layer, ensuring that its content appears on every page throughout the document.

Sub Test()

ActiveLayer.Master = True

End Sub

 Related Topics


Layer.MasterProperties

Property MasterProperties As Properties

Layer

Description

The MasterProperties property returns the Properties collection that allows you to specify and manipulate custom data for the given layer on all pages of the document.

Read-Only

Example

The following example creates 100 shapes and stores their IDs in the active layer for future reference.

Sub CreateAndStoreShapes()

Dim i As Long

Dim x As Double, y As Double, r As Double

Dim MaxX As Double, MaxY As Double, MaxR As Double

Dim s As Shape, Num As Long

MaxX = ActivePage.SizeWidth

MaxY = ActivePage.SizeHeight

MaxR = 1

Num = 100

ActiveLayer.Properties("ShapeArray", 0) = Num ' Store the total number of shapes

For i = 1 To Num

x = Rnd() * MaxX

y = Rnd() * MaxY

r = Rnd() * MaxR

Set s = ActiveLayer.CreateEllipse2(x, y, r)

s.Fill.UniformColor.RGBAssign Rnd() * 256, Rnd() * 256, Rnd() * 256

ActiveLayer.Properties("ShapeArray", i) = s.StaticID ' Store the current shape's ID number

Next i

End Sub

 Related Topics


Layer.Name

Property Name As String

Layer

Description

The Name property returns or sets the name of a layer.

Example

The following example displays the name of the active layer in a message box.

Sub Test()

MsgBox "Active Layer is " & ActiveLayer.Name

End Sub

 Related Topics


Layer.OverrideColor

Property OverrideColor As Boolean

Layer

Description

The OverrideColor property returns or sets whether to use the override color of the layer to draw object outlines in normal view mode.

Example

The following example sets the color override feature to True in the active layer and the override color to RGB red..

Sub Test()

ActiveLayer.OverrideColor = True

ActiveLayer.Color.RGBAssign 255, 0, 0

End Sub

 Related Topics


Layer.Parent

Property Parent As Layers

Layer

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Layer.Printable

Property Printable As Boolean

Layer

Description

The Printable property returns or sets whether the layer is printable.

If the Printable property of a layer is True, the layer and its contents are printable.

Example

The following example makes the "Grid" layer on the master page printable.

Sub Test()

ActiveDocument.Pages(0).Layers("Grid").Printable = True

End Sub

 Related Topics


Layer.Properties

Property Properties As Properties

Layer

Description

The Properties property returns the Properties collection that allows you to specify and manipulate custom data associated for the given layer belonging to a specified page only.

Read-Only

Example

The following example creates 100 shapes and stores their IDs in the active layer for future reference.

Sub CreateAndStoreShapes()

Dim i As Long

Dim x As Double, y As Double, r As Double

Dim MaxX As Double, MaxY As Double, MaxR As Double

Dim s As Shape, Num As Long

MaxX = ActivePage.SizeWidth

MaxY = ActivePage.SizeHeight

MaxR = 1

Num = 100

ActiveLayer.Properties("ShapeArray", 0) = Num ' Store the total number of shapes

For i = 1 To Num

x = Rnd() * MaxX

y = Rnd() * MaxY

r = Rnd() * MaxR

Set s = ActiveLayer.CreateEllipse2(x, y, r)

s.Fill.UniformColor.RGBAssign Rnd() * 256, Rnd() * 256, Rnd() * 256

ActiveLayer.Properties("ShapeArray", i) = s.StaticID ' Store the current shape's ID number

Next i

End Sub

 Related Topics


Layer.Shapes

Property Shapes As Shapes

Layer

Description

The Shapes property returns a collection of all shapes on a specified layer.

Read-Only

Example

The following example deletes the active layer and moves all shapes on the active layer to the next layer on the page.

Sub Test()

Dim Target As Layer

Dim s As Shape

Dim idx As Long

If ActivePage.Layers.Count = 1 Then

MsgBox "Cannot delete a single layer"

End If

If ActiveLayer.Shapes.Count Then

idx = 1 ' Determining the index of the active layer

For Each Target In ActivePage.Layers

If Target Is ActiveLayer Then Exit For

 idx = idx + 1

Next Target

' Finding the index of target layer

If idx = 1 Then idx = 2 Else idx = idx - 1

Set Target = ActivePage.Layers(idx)

ActiveDocument.ClearSelection

ActiveLayer.Shapes.All.AddToSelection

ActiveSelection.Layer = Target

End If

ActiveLayer.Delete

End Sub

 Related Topics


Layer.Visible

Property Visible As Boolean

Layer

Description

The Visible property returns or sets the visibility status of a layer and all shapes on the layer.

If the Visible property is set the True, the layer is visible.

Example

The following example shows a warning message if the current layer is invisible.

Sub Test()

If Not ActiveLayer.Visible Then

MsgBox "The Current Layer is invisible!"

End If

End Sub

 Related Topics


Layer.Activate

Sub Activate()

Layer

Description

The Activate method activates a layer (makes it the active layer).

Example

The following example activates the "Layer 1" in the active page.

Sub Test()

ActivePage.Layers("Layer 1").Activate

End Sub

 Related Topics


Layer.CreateArtisticText

Function CreateArtisticText(ByVal Left As Double, ByVal Bottom As Double, ByVal Text As String, [ByVal LanguageID As cdrTextLanguage = cdrLanguageNone (0)], [ByVal CharSet As cdrTextCharSet = cdrCharSetMixed (-1)], [ByVal Font As String], [ByVal Size As Single = 0], [ByVal Bold As cdrTriState = cdrUndefined (-2)], [ByVal Italic As cdrTriState = cdrUndefined (-2)], [ByVal Underline As cdrFontLine = cdrMixedFontLine (7)]), [ByVal Alignment As cdrAlignment = cdrMixedAlignment (6)]) As Shape

Layer

Description

The CreateArtisticText method creates an artistic text object at a specified point on a layer. You can specify various properties for the object.

Parameters	Description

Left	Determines the horizontal positioning of the artistic text. This value is measured in document units. [in]

Bottom	Determines the vertical positioning of the artistic text. This value is measured in document units. [in]

Text	Determines the content of the newly created artistic text. The value of the Text parameter becomes the actual text created with the CreateArtisticText method. [in]

LanguageID	Specifies the language [in]
Optional
Default value = cdrLanguageNone (0)

CharSet	Specifies the character set [in]
Optional
Default value = cdrCharSetMixed (-1)

Font	Specifies the font [in]
Optional

Size	Specifies the font size [in]
Optional
Default value = 0

Bold	Specifies whether to apply bold [in]
Optional
Default value = cdrUndefined (-2)

Italic	Specifies whether to apply italic [in]
Optional
Default value = cdrUndefined (-2)

Underline	Specifies an underline to apply [in]
Optional
Default value = cdrMixedFontLine (7)

Alignment	Specifies the alignment [in]
Optional
Default value = cdrMixedAlignment (6)

Return value

Returns Shape

Example

The following example adds the word "page:" and the page number to the lower left corner of the active layer of each page.

Sub Test()

Dim p As Page

For Each p In ActiveDocument.Pages

p.ActiveLayer.CreateArtisticText 0, 0, "page: " & p.Index, _

cdrEnglishUS, , "Arial", 6, cdrTrue, cdrTrue, , cdrLeftAlignment

Next p

End Sub

 Related Topics


Layer.CreateArtisticTextWide

Function CreateArtisticTextWide(ByVal Left As Double, ByVal Bottom As Double, ByVal Text As String, [ByVal LanguageID As cdrTextLanguage = cdrLanguageNone (0)], [ByVal CharSet As cdrTextCharSet = cdrCharSetMixed (-1)], [ByVal Font As String], [ByVal Size As Single = 0], [ByVal Bold As cdrTriState = cdrUndefined (-2)], [ByVal Italic As cdrTriState = cdrUndefined (-2)], [ByVal Underline As cdrFontLine = cdrMixedFontLine (7)], [ByVal Alignment As cdrAlignment = cdrMixedAlignment (6)]) As Shape

Layer

Description

The ArtisticTextWide method creates artistic text in Unicode. You can specify various properties for the text.

Parameters	Description

Left	Specifies the left coordinate [in]

Bottom	Specifies the bottom coordinate [in]

Text	Specifies the text [in]

LanguageID	Specifies the language [in]
Optional
Default value = cdrLanguageNone (0)

CharSet	Specifies the character set [in]
Optional
Default value = cdrCharSetMixed (-1)

Font	Specifies the font [in]
Optional

Size	Specifies the font size [in]
Optional
Default value = 0

Bold	Specifies whether to apply bold [in]
Optional
Default value = cdrUndefined (-2)

Italic	Specifies whether to apply italic [in]
Optional
Default value = cdrUndefined (-2)

Underline	Specifies an underline [in]
Optional
Default value = cdrMixedFontLine (7)

Alignment	Specifies the alignment [in]
Optional
Default value = cdrMixedAlignment (6)

Return value

Returns Shape

Example

Creates a Greek text string on the current layer of the active document at the lower left corner of the current page.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticTextWide(0, 0, Chr(216) & Chr(231) & Chr(241) & _

Chr(233) & Chr(243), cdrGreek, cdrCharSetGreek, "Times New Roman", 24)

End Sub

 Related Topics


Layer.CreateConnector

Function CreateConnector(ByVal Start As SnapPoint, ByVal End As SnapPoint) As Shape

Layer

Description

The CreateConnector method creates a connector line.

See also the CreateFreeConnector method.

Parameters	Description

Start	Specifies the starting point of the connector line object [in]

End	Specifies the ending point of the connector line object [in]

Return value

Returns Shape

Examples

The following example creates a rectangle and ellipse on the active layer, and draws a connector line between them.

Sub Test()

Dim rect As Shape, ell As Shape

Dim lr As Layer

Set lr = ActiveLayer

Set rect = lr.CreateRectangle(0, 0, 3, 3)

Set ell = lr.CreateEllipse2(5, 5, 1, 1)

lr.CreateConnector rect.SnapPoints(9), ell.SnapPoints(5)

End Sub

The following example creates a rectangle and an ellipse, and draws a connector line that joins the center of each object. You can also use the Application.CreateSnapPoint function to create a free snap point object.

Sub Test()

Dim r As Shape, e As Shape

Set r = ActiveLayer.CreateRectangle(0, 0, 3, 3)

Set e = ActiveLayer.CreateEllipse2(5, 5, 1, 1)

ActiveLayer.CreateConnector r.SnapPoints(r.SnapPoints.Count), _

e.SnapPoints(e.SnapPoints.Count)

End Sub

 Related Topics


Layer.CreateCurve

Function CreateCurve(ByVal Source As Curve) As Shape

Layer

Description

The CreateCurve method creates a curve in a document. You can use this method after you have created an empty curve and have appended segments to it. See the Application.CreateCurve method to create a curve in memory.

Parameters	Description

Source	Specifies the source of the curve [in]

Return value

Returns Shape

Examples

The following example creates a curve on the active layer.

Sub Test()

Dim crv As Curve

Dim s As Shape

Dim sp As SubPath

Set crv = CreateCurve(ActiveDocument)

Set sp = crv.CreateSubPath(1, 5)

sp.AppendLineSegment 2, 0

sp.AppendCurveSegment2 5, 7, 6, 6, 3, 5

sp.AppendCurveSegment2 7, 2, 3, 6, 7, 1

sp.AppendLineSegment 9, 6

sp.Nodes(3).Type = cdrSmoothNode

Set s = ActiveLayer.CreateCurve(crv)

End Sub

The following example creates a puzzle piece.

Sub Test()

Dim s As Shape, sp As SubPath, crv As Curve

Set crv = Application.CreateCurve(ActiveDocument)

Set sp = crv.CreateSubPath(1.351, 8.545)

sp.AppendCurveSegment 1.351, 8.926, 0.127, 89.901, 0.127, -64.56

sp.AppendCurveSegment 1.156, 8.952, 0.066, 115.44, 0.066, -48.906

sp.AppendCurveSegment 1.156, 9.15, 0.065, 131.09, 0.065, -133.149

sp.AppendCurveSegment 1.351, 9.163, 0.065, 46.846, 0.065, -116.315

sp.AppendCurveSegment 1.351, 9.545, 0.127, 63.683, 0.127, -89.902

sp.AppendCurveSegment 0.976, 9.545, 0.125, 179.951, 0.125, 25.612

sp.AppendCurveSegment 0.96, 9.342, 0.063, -154.391, 0.063, 40.943

sp.AppendCurveSegment 0.767, 9.339, 0.067, -139.06, 0.067, -41.987

sp.AppendCurveSegment 0.752, 9.547, 0.063, 138.014, 0.065, -33.906

sp.AppendCurveSegment 0.351, 9.545, 0.134, 146.087, 0.134, 0.045

sp.AppendCurveSegment 0.351, 9.163, 0.127, -90#, 0.127, 63.681

sp.AppendCurveSegment 0.156, 9.15, 0.065, -116.317, 0.065, 46.846

sp.AppendCurveSegment 0.156, 8.952, 0.065, -133.152, 0.065, 131.093

sp.AppendCurveSegment 0.351, 8.926, 0.066, -48.906, 0.066, 115.439

sp.AppendCurveSegment 0.351, 8.545, 0.127, -64.561, 0.127, 90#

sp.AppendCurveSegment 0.752, 8.547, 0.134, 0.002, 0.134, 146.087

sp.AppendCurveSegment 0.767, 8.339, 0.065, -33.908, 0.063, 138.012

sp.AppendCurveSegment 0.96, 8.342, 0.067, -41.987, 0.067, -139.058

sp.AppendCurveSegment 0.976, 8.545, 0.063, 40.943, 0.063, -154.388

sp.AppendCurveSegment 1.351, 8.545, 0.125, 25.613, 0.125, 179.998

sp.Closed = True

Set s = ActiveLayer.CreateCurve(crv)

End Sub

 Related Topics


Layer.CreateCurveSegment

Function CreateCurveSegment(ByVal StartX As Double, ByVal StartY As Double, ByVal EndX As Double, ByVal EndY As Double, [ByVal StartingControlPointLength As Double = -1], [ByVal StartingControlPointAngle As Double = 0], [ByVal EndingControlPointLength As Double = -1], [ByVal EndingControlPointAngle As Double = 0]) As Shape

Layer

Description

The CreateCurveSegment method creates a single curve.

Parameters	Description

StartX	Specifies the horizontal coordinate for the starting point of the curve segment. This value is measured in document units. [in]

StartY	Specifies the vertical coordinate for the starting point of the curve segment. This value is measured in document units. [in]

EndX	Specifies the horizontal coordinate for the ending point of the curve segment. This value is measured in document units. [in]

EndY	Specifies the vertical coordinate for the ending point of the curve segment. This value is measured in document units. [in]

StartingControlPointLength	Specifies the length of the starting control point. The length is measured in document units. [in]
Optional
Default value = -1

StartingControlPointAngle	Specifies the angle, measured in degrees, of the starting control point. [in]
Optional
Default value = 0

EndingControlPointLength	Specifies the length of the ending control point. The length is measured in document units. [in]
Optional
Default value = -1

EndingControlPointAngle	Specifies the angle, measured in degrees, of the ending control point. [in]
Optional
Default value = 0

Return value

Returns Shape

Example

The following example creates a curve segment on the active layer. The starting point of the curve is (3, 3), and the ending point is (6, 6). The length of the starting and ending control points is 5 and the starting and ending angles of the control points are 45 degrees.

Sub CurveCreate()

ActiveLayer.CreateCurveSegment(3, 3, 6, 6, 5, 45, 5, 45)

End Sub

 Related Topics


Layer.CreateCurveSegment2

Function CreateCurveSegment2(ByVal x1 As Double, ByVal y1 As Double, ByVal StartingControlPointX As Double, ByVal StartingControlPointY As Double, ByVal EndingControlPointX As Double, ByVal EndingControlPointY As Double, ByVal x2 As Double, ByVal y2 As Double) As Shape

Layer

Description

The CreateCurveSegment2 method creates a curve segment using specified control point coordinates.

Parameters	Description

x1	Specifies the horizontal coordinate for the starting point of the curve segment. This value is measured in document units. [in]

y1	Specifies the vertical coordinate for the starting point of the curve segment. This value is measured in document units. [in]

StartingControlPointX	Specifies the horizontal coordinate for the starting control point [in]

StartingControlPointY	Specifies the vertical coordinate for the starting control point [in]

EndingControlPointX	Specifies the horizontal coordinate for the ending control point [in]

EndingControlPointY	Specifies the vertical coordinate for the ending control point [in]

x2	Specifies the horizontal coordinate for the ending point of the curve segment. This value is measured in document units. [in]

y2	Specifies the vertical coordinate for the ending point of the curve segment. This value is measured in document units.[in]

Return value

Returns Shape

Example

The following example creates a curve and adds text along the curve.

Sub Test()

Dim sText As Shape, sPath As Shape

Set sText = ActiveLayer.CreateArtisticText(0, 0, "Some Text")

Set sPath = ActiveLayer.CreateCurveSegment2(0.6, 4.5, 0, 3, 5.2, 8.2, 5.3, 7)

sText.Text.FitToPath sPath

sText.Effects(1).TextOnPath.Placement = cdrCenterPlacement

End Sub

 Related Topics


Layer.CreateEllipse

Function CreateEllipse(ByVal Left As Double, ByVal Top As Double, ByVal Right As Double, ByVal Bottom As Double, [ByVal StartAngle As Double = 90], [ByVal EndAngle As Double = 90], [ByVal Arc As Boolean = False]) As Shape

Layer

Description

The CreateEllipse method creates an ellipse shape on a layer. The CreateEllipse method uses the corners of the ellipse bounding box to create the shape.

Parameters	Description

Left	Specifies the distance from the left side of the ellipse to the left side of the page frame. The value is measured in document units. [in]

Top	Specifies the distance from the top of the ellipse to the top of the page frame. The value is measured in document units. [in]

Right	Specifies the distance from the right side of the ellipse to the right side of the page frame. The value is measured in document units. [in]

Bottom	Specifies the distance from the bottom of the ellipse to the bottom of the page frame. The value is measured in document units. [in]

StartAngle	Sets the degree of an ellipse's start angle [in]
Optional
Default value = 90

EndAngle	Sets a value associated with the degree of an ellipse's end angle. Altering the start angle changes the shape of the ellipse. [in]
Optional
Default value = 90

Arc	Sets whether the newly created ellipse is changed into an arc [in]
Optional
Default value = False

Return value

Returns Shape

Example

The following example creates a rectangle with a red ellipse inside it, both at the lower left corner of the page.

Sub Test()

Dim s As Shape

Dim lr As Layer

Set lr = ActiveLayer

ActiveDocument.DrawingOriginX = -ActivePage.SizeWidth / 2

ActiveDocument.DrawingOriginY = -ActivePage.SizeHeight / 2

lr.CreateRectangle 0, 0, 3, 2

Set s = lr.CreateEllipse(0, 0, 3, 2)

s.Fill.UniformColor.RGBAssign 255, 0, 0 'Red

End Sub

 Related Topics


Layer.CreateEllipse2

Function CreateEllipse2(ByVal CenterX As Double, ByVal CenterY As Double, ByVal Radius1 As Double, [ByVal Radius2 As Double = 0], [ByVal StartAngle As Double = 90], [ByVal EndAngle As Double = 90], [ByVal Arc As Boolean = False]) As Shape

Layer

Description

The CreateEllipse2 method creates an ellipse using the coordinates of the shape's center, the horizontal radius, and, if you want, the vertical radius.

Parameters	Description

CenterX	Defines the horizontal, or x, coordinate of the center point. The value is measured in document units. [in]

CenterY	Defines the vertical, or y, coordinate of the center point. The value is measured in document units. [in]

Radius1	Defines the measurement from the horizontal coordinate of the center point to the circumference. The value is measured in document units. [in]

Radius2	Defines the measurement from the vertical coordinate of the center point to the circumference. The value is measured in document units. [in]
Optional
Default value = 0

StartAngle	Defines the degree of an ellipse's start angle [in]
Optional
Default value = 90

EndAngle	Defines the degree of an ellipse's end angle [in]
Optional
Default value = 90

Arc	Indicates whether the newly created ellipse is an arc [in]
Optional
Default value = False

Return value

Returns Shape

Example

The following example creates a yellow circle in the middle of the page and a green ellipse above it.

Sub Test()

Dim s As Shape

Dim lr As Layer

Set lr = ActiveLayer

ActiveDocument.DrawingOriginX = 0

ActiveDocument.DrawingOriginY = 0

Set s = lr.CreateEllipse2(0, 0, 1)

s.Fill.UniformColor.RGBAssign 255, 255, 0 'Yellow

Set s = lr.CreateEllipse2(0, 2, 2, 1)

s.Fill.UniformColor.RGBAssign 0, 255, 0 'Green

End Sub

 Related Topics


Layer.CreateFreeConnector

Function CreateFreeConnector(ByVal x1 As Double, ByVal y1 As Double, ByVal x2 As Double, ByVal y2 As Double) As Shape

Layer

Description

The CreateFreeConnector method creates a connector line that is not connected to any shape.

See also the CreateConnector method.

Parameters	Description

x1	Defines the horizontal, or x, coordinate for the start point of the new connector line on the layer. This value is measured in document units. [in]

y1	Defines the vertical, or y, coordinate for the start point of the new connector line on the layer. This value is measured in document units. [in]

x2	Defines the horizontal, or x, coordinate for the end point of the new connector line on the layer. This value is measured in document units. [in]

y2	Defines the vertical, or y, coordinate for the end point of the new connector line on the layer. This value is measured in document units. [in]

Return value

Returns Shape

Example

The following example creates a free connector line on the active layer in the active document.

Sub LayerConnector()

ActiveLayer.CreateFreeConnector 2, 3, 6, 7

End Sub

 Related Topics


Layer.CreateGridBoxes

Function CreateGridBoxes(ByVal Left As Double, ByVal Top As Double, ByVal Right As Double, ByVal Bottom As Double, ByVal Wide As Long, ByVal High As Long) As Shape

Layer

Description

The CreateGridBoxes method creates a group of rectangles (as if using Graph Paper tool).

Parameters	Description

Left	Specifies the distance from the left side of the first rectangle grid box to the left side of the page frame. The value is measured in document units. [in]

Top	Specifies the distance from the top of the first rectangle grid box to the top of the page frame. The value is measured in document units. [in]

Right	Specifies the distance from the right side of the first rectangle grid box to the right side of the page frame. The value is measured in document units. [in]

Bottom	Specifies the distance from the bottom of the first rectangle grid box to the bottom of the page frame. The value is measured in document units. [in]

Wide	Defines the horizontal size of each rectangular grid box. This value is measured in document units. [in]

High	Defines the vertical measurement of the rectangle. This value is measured in document units. [in]

Return value

Returns Shape

Example

The following example creates a series of rectangles on the active layer, resembling 2x3 graph paper.

Sub Test()

ActiveLayer.CreateGridBoxes 0, 0, 5, 5, 2, 3

End Sub

 Related Topics


Layer.CreateGuide

Function CreateGuide(ByVal x1 As Double, ByVal y1 As Double, ByVal x2 As Double, ByVal y2 As Double) As Shape

Layer

Description

The CreateGuide method creates a guideline using two points.

Parameters	Description

x1	Defines the horizontal, or x, coordinate for the first point that defines the guideline. This value is measured in document units. [in]

y1	Defines the vertical, or y, coordinate for the first point that defines the guideline. This value is measured in document units. [in]

x2	Defines the horizontal, or x, coordinate for the second point that defines the guideline. This value is measured in document units. [in]

y2	Defines the vertical, or y, coordinate for the second point that defines the guideline. This value is measured in document units. [in]

Return value

Returns Shape

Example

The following example divides a page into 4 x 8 rectangles using guidelines.

Sub Test()

Const sx As Long = 4

Const sy As Long = 8

Dim i As Long

Dim px As Double, py As Double

px = ActivePage.SizeWidth

py = ActivePage.SizeHeight

For i = 0 To sx

ActiveLayer.CreateGuide i * px / sx, 0, i * px / sx, py

Next i

For i = 0 To sy

ActiveLayer.CreateGuide 0, i * py / sy, px, i * py / sy

Next i

End Sub

 Related Topics


Layer.CreateGuideAngle

Function CreateGuideAngle(ByVal X As Double, ByVal Y As Double, ByVal Angle As Double) As Shape

Layer

Description

The CreateGuideAngle method creates a guideline using a point and an angle.

Parameters	Description

X	Defines the horizontal, or x, coordinate for the point that defines the guideline. This value is measured in document units. [in]

Y	Defines the vertical, or y, coordinate for the point that defines the guideline. This value is measured in document units. [in]

Angle	Defines the degree to which the guideline is slanted on a layer. Values range from 0 to 360 degrees. [in]

Return value

Returns Shape

Example

The following example creates 10 guidelines that intersect at the center of the page.

Sub Test()

Const an As Long = 10

Dim i As Long

ActiveDocument.DrawingOriginX = 0

ActiveDocument.DrawingOriginY = 0

For i = 0 To an - 1

ActiveLayer.CreateGuideAngle 0, 0, i * 360 / an

Next i

End Sub

 Related Topics


Layer.CreateLineSegment

Function CreateLineSegment(ByVal StartX As Double, ByVal StartY As Double, ByVal EndX As Double, ByVal EndY As Double) As Shape

Layer

Description

The CreateLineSegment method creates a curve comprised of a single line segment.

Parameters	Description

StartX	Defines the horizontal coordinate for the starting point of the line segment. This value is measured in document units. [in]

StartY	Defines the vertical coordinate for the starting point of the line segment. This value is measured in document units. [in]

EndX	Defines the horizontal coordinate for the ending point of the line segment. This value is measured in document units. [in]

EndY	Defines the vertical coordinate for the ending point of the line segment. This value is measured in document units. [in]

Return value

Returns Shape

Example

The following example creates a line segment on the active layer.

Sub Test()

ActiveLayer.CreateLineSegment 1, 2, 5, 6

End Sub

 Related Topics


Layer.CreateParagraphText

Function CreateParagraphText(ByVal Left As Double, ByVal Top As Double, ByVal Right As Double, ByVal Bottom As Double, [ByVal Text As String], [ByVal LanguageID As cdrTextLanguage = cdrLanguageNone (0)], [ByVal CharSet As cdrTextCharSet = cdrCharSetMixed (-1)], [ByVal Font As String], [ByVal Size As Single = 0], [ByVal Bold As cdrTriState = cdrUndefined (-2)], [ByVal Italic As cdrTriState = cdrUndefined (-2)], [ByVal Underline As cdrFontLine = cdrMixedFontLine (7)], [ByVal Alignment As cdrAlignment = cdrMixedAlignment (6)]) As Shape

Layer

Description

The CreateParagraphText method creates a paragraph text object at a given point on a layer.

Parameters	Description

Left	Specifies the distance from the left side of the paragraph text frame to the left side of the page frame. The left coordinate is measured in document units. [in]

Top	Specifies the distance from the top side of the paragraph text frame to the top of the page frame. The top coordinate is measured in document units. [in]

Right	Specifies the distance from the right side of the paragraph text frame to the right side of the page frame. The right coordinate is measured in document units. [in]

Bottom	Specifies the distance from the bottom of the paragraph text frame to the bottom of the page frame. The bottom coordinate is measured in document units. [in]

Text	Determines the content of the newly created paragraph text. The value of the Text parameter becomes the actual text created with the CreateParagraphText method. [in]
Optional

LanguageID	Specifies the language [in]
Optional
Default value = cdrLanguageNone (0)

CharSet	Specifies the character set [in]
Optional
Default value = cdrCharSetMixed (-1)

Font	Specifies the font [in]
Optional

Size	Specifies the font size [in]
Optional
Default value = 0

Bold	Specifies whether to apply bold [in]
Optional
Default value = cdrUndefined (-2)

Italic	Specifies whether to apply italic [in]
Optional
Default value = cdrUndefined (-2)

Underline	Specifies an underline [in]
Optional
Default value = cdrMixedFontLine (7)

Alignment	Specifies an alignment [in]
Optional
Default value = cdrMixedAlignment (6)

Return value

Returns Shape

Example

The following example creates a paragraph text object typed in bold Times New Roman font.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateParagraphText(0, 0, 4, 4, "Paragraph Text", , , _

"Times New Roman", 24, cdrTrue, cdrTrue, , cdrCenterAlignment)

End Sub

 Related Topics


Layer.CreateParagraphTextWide

Function CreateParagraphTextWide(ByVal Left As Double, ByVal Top As Double, ByVal Right As Double, ByVal Bottom As Double, [ByVal Text As String], [ByVal LanguageID As cdrTextLanguage = cdrLanguageNone (0)], [ByVal CharSet As cdrTextCharSet = cdrCharSetMixed (-1)], [ByVal Font As String], [ByVal Size As Single = 0], [ByVal Bold As cdrTriState = cdrUndefined (-2)], [ByVal Italic As cdrTriState = cdrUndefined (-2)], [ByVal Underline As cdrFontLine = cdrMixedFontLine (7)], [ByVal Alignment As cdrAlignment = cdrMixedAlignment (6)]) As Shape

Layer

Description

The CreateParagraphTextWide method creates paragraph text in Unicode.

Parameters	Description

Left	Specifies the distance from the left side of the paragraph text frame to the left side of the page frame [in]

Top	Specifies the distance from the top side of the paragraph text frame to the top of the page frame [in]

Right	Specifies the distance from the right side of the paragraph text frame to the right side of the page frame [in]

Bottom	Specifies the distance from the bottom of the paragraph text frame to the bottom of the page frame[in]

Text	Specifies the text [in]
Optional

LanguageID	Specifies the language [in]
Optional
Default value = cdrLanguageNone (0)

CharSet	Specifies the character set [in]
Optional
Default value = cdrCharSetMixed (-1)

Font	Specifies the font [in]
Optional

Size	Specifies the font size [in]
Optional
Default value = 0

Bold	Specifies whether to apply bold [in]
Optional
Default value = cdrUndefined (-2)

Italic	Specifies whether to apply italic [in]
Optional
Default value = cdrUndefined (-2)

Underline	Specifies an underline [in]
Optional
Default value = cdrMixedFontLine (7)

Alignment	Specifies an alignment [in]
Optional
Default value = cdrMixedAlignment (6)

Return value

Returns Shape

Example

The following example creates a paragraph text object in Greek.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateParagraphTextWide(0, 3, 3, 0, Chr(216) & _

Chr(231) & Chr(241) & Chr(233) & Chr(243), cdrGreek, cdrCharSetGreek, _

"Times New Roman", 24)

End Sub

 Related Topics


Layer.CreatePolygon

Function CreatePolygon(ByVal Left As Double, ByVal Top As Double, ByVal Right As Double, ByVal Bottom As Double, ByVal Sides As Long, [ByVal Subpaths As Long = 1], [ByVal Complexity As Long = 1], [ByVal Star As Boolean = False], [ByVal StarComplexity As Long = 50], [ByVal MaxComplexity As Long = 100]) As Shape

Layer

Description

The CreatePolygon method creates a new polygon .

Parameters	Description

Left	Specifies the distance from the left side of the polygon to the left side of the page frame. The value is measured in document units. [in]

Top	Specifies the distance from the top of the polygon to the top of the page frame. The value is measured in document units. [in]

Right	Specifies the distance from the right side of the polygon to the right side of the page frame. The value is measured in document units. [in]

Bottom	Specifies the distance from the bottom of the polygon to the bottom of the page frame. The value is measured in document units. [in]

Sides	Specifies the number of sides in the polygon. A polygon can have 3 to 500 sides in CorelDRAW. [in]

Subpaths	Specifies the number of subpaths in the polygon [in]
Optional
Default value = 1

Complexity	[in]
Optional
Default value = 1

Star	Specifies whether the polygon appears as a star shape on the layer [in]
Optional
Default value = False

StarComplexity	[in]
Optional
Default value = 50

MaxComplexity	[in]
Optional
Default value = 100

Return value

Returns Shape

Example

The following example creates a star on the active layer.

Sub Test()

ActiveLayer.CreatePolygon 0, 3, 3, 0, 5, 1, 1, True

End Sub

 Related Topics


Layer.CreateRectangle

Function CreateRectangle(ByVal Left As Double, ByVal Top As Double, ByVal Right As Double, ByVal Bottom As Double, [ByVal CornerUL As Long = 0], [ByVal CornerUR As Long = 0], [ByVal CornerLR As Long = 0], [ByVal CornerLL As Long = 0]) As Shape

Layer

Description

The CreateRectangle method creates a rectangle on a layer.

This method uses the coordinates of the upper left and lower right corners of the rectangle as parameters, and optionally the roundness of each corner.

Parameters	Description

Left	Specifies the distance from the left side of the rectangle to the left side of the page frame. The value is measured in document units. [in]

Top	Specifies the distance from the top of the rectangle to the top of the page frame. The value is measured in document units. [in]

Right	Specifies the distance from the right side of the rectangle to the right side of the page frame. The value is measured in document units. [in]

Bottom	Specifies the distance from the bottom of the rectangle to the bottom of the page frame. The value is measured in document units. [in]

CornerUL	Specifies the roundness measurement of the upper left corner of the rectangle. When you round the corners of a rectangle, CorelDRAW splits each corner node in two and draws an arc between each of these two new nodes. Values range between 0 and 100. [in]
Optional
Default value = 0

CornerUR	Specifies the roundness measurement of the upper right corner of the rectangle. Values range between 0 and 100. [in]
Optional
Default value = 0

CornerLR	Specifies the roundness measurement of the lower right corner of the rectangle. Values range between 0 and 100. [in]
Optional
Default value = 0

CornerLL	Specifies the roundness measurement of the lower left corner of the rectangle. Values range between 0 and 100. [in]
Optional
Default value = 0

Return value

Returns Shape

Example

The following example creates a five-inch square with 20% corner roundness (a corner radius of 0.5").

Sub Test()

ActiveLayer.CreateRectangle 0, 0, 5, 5, 20, 20, 20, 20

End Sub

 Related Topics


Layer.CreateRectangle2

Function CreateRectangle2(ByVal X As Double, ByVal Y As Double, ByVal Width As Double, ByVal Height As Double, [ByVal RadiusUL As Double = 0], [ByVal RadiusUR As Double = 0], [ByVal RadiusLR As Double = 0], [ByVal RadiusLL As Double = 0]) As Shape

Layer

Description

The CreateRectangle2 method creates a rectangle using coordinates of the upper left corner, the width, the height, and an actual corner radius.

Parameters	Description

X	Defines the horizontal, or x, position of the upper left corner coordinate. This value is measured in document units. [in]

Y	Defines the vertical, or y, position of the upper left corner coordinate. This value is measured in document units. [in]

Width	Defines the horizontal measurement. This value is measured in document units. [in]

Height	Defines the vertical measurement. This value is measured in document units. [in]

RadiusUL	Specifies the actual corner radius measurement of the upper left corner [in]
Optional
Default value = 0

RadiusUR	Specifies the actual corner radius measurement of the upper right corner [in]
Optional
Default value = 0

RadiusLR	Specifies the actual corner radius measurement of the lower right corner [in]
Optional
Default value = 0

RadiusLL	Specifies the actual corner radius measurement of the lower left corner [in]
Optional
Default value = 0

Return value

Returns Shape

 Related Topics


Layer.CreateSpiral

Function CreateSpiral(ByVal Left As Double, ByVal Top As Double, ByVal Right As Double, ByVal Bottom As Double, ByVal NumRevolutions As Long, ByVal SpiralType As cdrSpiralType, ByVal GrowthRate As Long) As Shape

Layer

Description

The CreateSpiral method creates a spiral.

Parameters	Description

Left	Specifies the distance from the left side of the spiral to the left side of the page frame. The coordinate is measured in document units. [in]

Top	Specifies the distance from the top of the spiral to the top of the page frame. The coordinate is measured in document units. [in]

Right	Specifies the distance from the right side of the spiral to the right side of the page frame. The coordinate is measured in document units. [in]

Bottom	Specifies the distance from the bottom of the spiral to the bottom of the page frame. The coordinate is measured in document units. [in]

NumRevolutions	Specifies the number of revolutions in the spiral. [in]

SpiralType	Specifies the type of spiral you create. This value returns cdrSpiralType. [in]

GrowthRate	Specifies the factor to increase the distance between revolutions in a logarithmic spiral. Values range from 1 to 100. [in]

Return value

Returns Shape

Example

The following example creates a logarithmic spiral on the active layer. The spiral has four revolutions with a growth factor of 100 within each revolution.

Sub Test()

ActiveLayer.CreateSpiral 0, 0, 5, 5, 4, cdrLogarithmic, 100

End Sub

 Related Topics


Layer.Delete

Sub Delete()

Layer

Description

The Delete method removes a layer and its contents.

Example

The following example deletes "Layer 1" on the active page. Deleting the layer also deletes all of its contents.

Sub Test()

ActivePage.Layers("Layer 1").Delete

End Sub

 Related Topics


Layer.FindShape

Function FindShape([ByVal Name As String], [ByVal Type As cdrShapeType = cdrNoShape (0)], [ByVal StaticID As Long = 0], [ByVal Recursive As Boolean = True]) As Shape

Layer

Description

The FindShape method locates a shape with specified properties on a layer. If the shape cannot be found, an empty reference (nothing) is returned.

Parameters	Description

Name	Identifies the string value that uniquely identifies the shape on the layer [in]
Optional

Type	Identifies the type of shape. This value returns cdrShapeType. [in]
Optional
Default value = cdrNoShape (0)

StaticID	Specifies a value which represents a shape's unique ID [in]
Optional
Default value = 0

Recursive	Specifies whether to iterate through all the shapes [in]
Optional
Default value = True

Return value

Returns Shape

Example

The following example finds a rectangle named "Frame" and selects it.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.FindShape(Name:="Frame", Type:=cdrRectangleShape)

If s Is Nothing Then

MsgBox "The rectange 'Frame' cannot be found on layer " & ActiveLayer.Name

Else

s.CreateSelection

End If

End Sub

 Related Topics


Layer.FindShapes

Function FindShapes([ByVal Name As String], [ByVal Type As cdrShapeType = cdrNoShape (0)], [ByVal Recursive As Boolean = True]) As ShapeRange

Layer

Description

The FindShapes method locates all shapes on a layer that have the specified properties. It returns a ShapeRange object containing all shapes found.

Parameters	Description

Name	Identifies the string value that uniquely identifies the shape [in]
Optional

Type	Identifies the type of shape. This value returns cdrShapeType. [in]
Optional
Default value = cdrNoShape (0)

Recursive	Specifies whether to iterate through all the shapes [in]
Optional
Default value = True

Return value

Returns ShapeRange

Example

The following example finds all rectangles on the current layer and fills them with a red uniform fill.

Sub Test()

Dim sr As ShapeRange

Set sr = ActiveLayer.FindShapes(Type:=cdrRectangleShape)

If sr.Count <> 0 Then

sr.ApplyUniformFill CreateRGBColor(255, 0, 0)

Else

MsgBox "There are no rectangles on the current layer"

End If

End Sub

 Related Topics


Layer.Import

Sub Import(ByVal FileName As String, [ByVal Filter As cdrFilter = cdrAutoSense (0)], [ByVal Options As StructImportOptions = Nothing])

Layer

Description

The Import method imports shapes from a disk file and places them on the specified layer.

The imported shapes are selected after the method is executed. You can use the Document.Selection function to access those shapes.

Parameters	Description

FileName	Identifies the full path name of the disk file that contains the shapes that are imported. For example, a CorelDRAW document named "Importing.cdr", stored on the root of the C drive, has a FileName value of "C:\Importing.cdr". [in]

Filter	Specifies the filter that is used when importing objects. This value returns cdrFilter. [in]
Optional
Default value = cdrAutoSense (0)

Options	Specifies additional parameters for the import [in]
Optional
Default value = Nothing

Example

The following example imports the file, mygraphic.cmx, stored on the root of C, to the active layer.

Sub Test()

ActiveLayer.Import "C:\MyGraphic.cmx"

End Sub

 Related Topics


Layer.ImportEx

Function ImportEx(ByVal FileName As String, [ByVal Filter As cdrFilter = cdrAutoSense (0)], [ByVal Options As StructImportOptions = Nothing]) As ImportFilter

Layer

Description

The ImportEx method imports a file and returns an ImportFilter object.

Parameters	Description

FileName	Specifies the file to import [in]

Filter	Specifies the filter that is used when importing objects. This value returns cdrFilter [in]
Optional
Default value = cdrAutoSense (0)

Options	Specifies additional parameters for the import [in]
Optional
Default value = Nothing

Return value

Returns ImportFilter

Example

The following example imports a Corel Presentation Exchange file (CMX) on the active layer.

Sub Test()

Dim im As ImportFilter

Set im = ActiveLayer.ImportEx(SetupPath & "Draw\CustomMediaStrokes\Arrow.cmx")

im.Finish

End Sub

 Related Topics


Layer.MoveAbove

Sub MoveAbove(ByVal Layer As Layer)

Layer

Description

The MoveAbove method rearranges layers by placing a layer above the given one.

The MoveAbove method changes the stacking order of a layer.

Parameters	Description

Layer	Identifies the layer object that has another layer moved above it [in]

Example

The following example moves the active layer and places it above layer "Layer 1."

Sub Test()

ActiveLayer.MoveAbove ActivePage.Layers("Layer 1")

End Sub

 Related Topics


Layer.MoveBelow

Sub MoveBelow(ByVal Layer As Layer)

Layer

Description

The MoveBelow method rearranges layers by placing a layer below the given one.

The MoveBelow method changes the stacking order of a layer.

Parameters	Description

Layer	Identifies the layer object that has another layer moved below it [in]

Example

The following example moves the current layer and places it below layer "Layer 1."

Sub Test()

ActiveLayer.MoveBelow ActivePage.Layers("Layer 1")

End Sub

 Related Topics


Layer.Paste

Function Paste() As Shape

Layer

Description

The Paste method places the contents in the system clipboard on a layer.

Return value

Returns Shape

Example

The following example copies the shapes from the current page to the clipboard, then adds 3 empty pages to the end of the document, and pastes the objects on the active layer of each new page.

Sub Test()

Dim p As Page

Dim i As Long, idx As Long

ActivePage.Shapes.All.Copy

Set p = ActiveDocument.AddPages(3)

idx = p.Index

For i = idx To ActiveDocument.Pages.Count

Set p = ActiveDocument.Pages(i)

p.Activate

p.ActiveLayer.Paste

Next i

End Sub

 Related Topics


Layers properties

Layers     Legend

    Application
    Count
  Item
    Parent


Layers

Class Layers

Properties     Referenced By

The Layers class represents a collection of document layers.

 Related Topics


Layers.Application

Property Application As Application

Layers

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Layers.Count

Property Count As Long

Layers

Description

The Count property returns the number of layers available.

In order to access master layers, you need to access the Layers collection of the master page. The master page is accessible as Document.Pages(0).

Read-Only

Example

The following example displays the number of master layers in the active document.

Sub Test()

MsgBox "Document contains " & ActiveDocument.Pages(0).Layers.Count & " layer(s)"

End Sub

 Related Topics


Layers.Item

Property Item(ByVal IndexOrName As Variant) As Layer

Layers

Description

The Item property returns the layer associated with a given index number.

The Item property is the default property and its reference may be omitted when referencing items in the collection. For example, Layers.Item(2) is the same as Layers(2) - they both reference the second layer object in the Layers collection.

You can access layers either by their index or name.

Read-Only

Parameters	Description

IndexOrName	Represents a preset placeholder for each object in a Layers collection; it uniquely identifies each member of the collection. Name is the unique string value that identifies each layer. [in]

Example

The following example creates a rectangle on the topmost layer of the first page of the active document, and also creates a horizontal line on the "Guides" layer.

Sub Test()

Dim d As Document

Dim p As Page

Set d = ActiveDocument

Set p = d.Pages(1)

p.Layers(1).CreateRectangle 0, 0, 3, 3

d.Pages(0).Layers("Guides").CreateLineSegment 0, 4, 5, 4

End Sub

 Related Topics


Layers.Parent

Property Parent As Page

Layers

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Node properties

Node     Legend

    AbsoluteIndex
    Application
    Index
    IsEnding
    NextSegment
    Parent
      PositionX
      PositionY
    PrevSegment
    Segment
    SubPath
    SubPathIndex
      Type


Node methods

Node     Legend

   BreakApart
   ConnectWith
   Delete
   GetDistanceFrom
   GetPosition
   JoinWith
   Move
   Next
   Previous
   SetPosition


Node

Class Node

Properties     Methods     Referenced By

The Node class represents a single node on a curve.

 Related Topics


Node.AbsoluteIndex

Property AbsoluteIndex As Long

Node

Description

The AbsoluteIndex property returns the number (index) of a node within a curve (containing all subpaths).

The Index property returns the number (index) of the node within its subpath. The Index and AbsoluteIndex properties return the same value if the node belongs to the first subpath of the curve.

Read-Only

Example

The following example loops through all the nodes of each subpath and prints the nodes' Index and AbsoluteIndex property in the Intermediate window of the Visual Basic Editor:

Sub Test()

Dim s As Shape

Dim sp As SubPath

Dim n As Node

Set s = ActiveShape

If s.Type = cdrCurveShape Then

For Each sp In s.Curve.Subpaths

For Each n In sp.Nodes

Debug.Print n.Index, n.AbsoluteIndex

Next n

Next sp

End If

End Sub

 Related Topics


Node.Application

Property Application As Application

Node

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Node.Index

Property Index As Long

Node

Description

The Index property returns the number (index) of the node within its subpath.

The AbsoluteIndex property returns the number (index) of a node within a curve (containing all subpaths). The Index and AbsoluteIndex properties return the same value if the node belongs to the first subpath of the curve.

Read-Only

Example

The following example loops through all the nodes of each subpath and displays the nodes' Index and AbsoluteIndex property in the Intermediate window of the Visual Basic Editor:

Sub Test()

Dim s As Shape

Dim sp As SubPath

Dim n As Node

Set s = ActiveShape

If s.Type = cdrCurveShape Then

For Each sp In s.Curve.Subpaths

For Each n In sp.Nodes

Debug.Print n.Index, n.AbsoluteIndex

Next n

Next sp

End If

End Sub

 Related Topics


Node.IsEnding

Property IsEnding As Boolean

Node

Description

The IsEnding property returns True if the node is the first or last node of an open subpath.

Read-Only

Example

The following example marks each ending node in a curve with a small circle.

Sub Test()

Dim n As Node

For Each n In ActiveShape.Curve.Nodes

If n.IsEnding Then

ActiveLayer.CreateEllipse2 n.PositionX, n.PositionY, 0.1

End If

Next n

End Sub

 Related Topics


Node.NextSegment

Property NextSegment As Segment

Node

Description

The NextSegment property returns the next segment which is adjacent to the node, or returns Nothing if no segment exists.

Read-Only

Example

The following example creates an ellipse on the active layer, converts it to curves, and returns the first segment.

Sub Test()

Dim s1 As Shape

Dim sg As Segment

Set s1 = ActiveLayer.CreateEllipse(0, 0, 2, 2)

s1.ConvertToCurves

Set sg = s1.Curve.Nodes(1).NextSegment

End Sub

 Related Topics


Node.Parent

Property Parent As Curve

Node

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Node.PositionX

Property PositionX As Double

Node

Description

The PositionX property returns or sets the horizontal coordinate of a node relative to its reference point.

Example

The following example draws small ellipses over each node in the selected curve and colors the ellipse according to the type of the node.

Sub ShowNodes()

Dim n As Node

Dim s As Shape

For Each n In ActiveShape.Curve.Nodes

Set s = ActiveLayer.CreateEllipse2(n.PositionX, n.PositionY, 0.05)

Select Case n.Type

Case cdrSymmetricalNode

s.Fill.UniformColor.RGBAssign 0, 0, 255

Case cdrSmoothNode

s.Fill.UniformColor.RGBAssign 255, 255, 0

Case cdrCuspNode

s.Fill.UniformColor.RGBAssign 255, 0, 0

End Select

Next n

End Sub

 Related Topics


Node.PositionY

Property PositionY As Double

Node

Description

The PositionY property returns or sets the vertical coordinate of a node relative to its reference point.

Example

The following example draws small ellipses over each node in the selected curve and colors the ellipse according to the type of the node.

Sub ShowNodes()

Dim n As Node

Dim s As Shape

For Each n In ActiveShape.Curve.Nodes

Set s = ActiveLayer.CreateEllipse2(n.PositionX, n.PositionY, 0.05)

Select Case n.Type

Case cdrSymmetricalNode

s.Fill.UniformColor.RGBAssign 0, 0, 255

Case cdrSmoothNode

s.Fill.UniformColor.RGBAssign 255, 255, 0

Case cdrCuspNode

s.Fill.UniformColor.RGBAssign 255, 0, 0

End Select

Next n

End Sub

 Related Topics


Node.PrevSegment

Property PrevSegment As Segment

Node

Description

The PrevSegment property returns the previous segment which is adjacent to the node, or Nothing if no segment exists.

Read-Only

Example

The following example creates an ellipse on the active layer, converts it to curves, and returns the third segment.

Sub Test()

Dim s1 As Shape

Dim sg As Segment

Set s1 = ActiveLayer.CreateEllipse(0, 0, 2, 2)

s1.ConvertToCurves

Set sg = s1.Curve.Nodes(s1.Curve.Nodes.Count).PrevSegment

End Sub

 Related Topics


Node.Segment

Property Segment As Segment

Node

Description

The Segment property returns the segment that contains the node.

Read-Only

Example

The following example converts the segment that is adjacent to third node in the selected curve to a line.

Sub Test()

ActiveShape.Curve.Nodes(3).Segment.Type = cdrLineSegment

End Sub

 Related Topics


Node.SubPath

Property SubPath As SubPath

Node

Description

The SubPath property returns the subpath to which the node belongs.

Read-Only

Example

The following example displays the length of a node's subpath in a message box. The length of the subpath is measured in document units.

Sub PathLength()

With ActiveShape.Curve.Nodes(1)

MsgBox .Subpath.Length

End With

End Sub

 Related Topics


Node.SubPathIndex

Property SubPathIndex As Long

Node

Description

The SubPathIndex property returns the index of the subpath within the Curve.Subpaths collection.

Read-Only

Example

The following example displays the number of nodes that are selected on a curve and the number of subpaths they reside on. Before running this macro, you must use the Shape tool to select nodes.

Sub Test()

Dim nr As NodeRange

Dim n As Node

Dim spi As New Collection

Dim Found As Boolean

Dim idx As Variant

If ActiveShape Is Nothing Then

MsgBox "Nothing is selected."

Exit Sub

End If

If ActiveShape.Type <> cdrCurveShape Then

MsgBox "A curve must be selected."

Exit Sub

End If

Set nr = ActiveShape.Curve.Selection

If nr.Count = 0 Then

MsgBox "Please use the Shape tool to select several nodes."

Exit Sub

End If

For i = 1 To nr.Count

Set n = nr(i)

Found = False

For Each idx In spi

If n.SubPathIndex = idx Then

Found = True

Exit For

End If

Next idx

If Not Found Then spi.Add n.SubPathIndex

Next i

MsgBox "Selected " & nr.Count & " node(s) on " & spi.Count & " different subpath(s)"

End Sub

 Related Topics


Node.Type

Property Type As cdrNodeType

Node

Description

The Type property returns or sets the type of the node. A node can be a cusp, smooth or symmetrical node. The Type property returns a value of cdrNodeType.

Example

The following example converts all the cusp nodes in the curve to smooth nodes.

Sub Test()

Dim n As Node

For Each n In ActiveShape.Curve.Nodes

If n.Type = cdrCuspNode Then n.Type = cdrSmoothNode

Next n

End Sub

 Related Topics


Node.BreakApart

Sub BreakApart()

Node

Description

The BreakApart method breaks a subpath at the specified node.

Example

The following example breaks the curve into individual segments .

Sub Test()

Dim s As Shape

Dim i As Long

Set s = ActiveShape

If s.Type <> cdrCurveShape Then s.ConvertToCurves

s.Curve.Closed = False

For i = s.Curve.Nodes.Count To 1 Step -1

s.Curve.Nodes(i).BreakApart

Next i

s.BreakApart

End Sub

 Related Topics


Node.ConnectWith

Sub ConnectWith(ByVal Target As Node)

Node

Description

The ConnectWith method connects two ending nodes by drawing a straight line between them.

The JoinWith method connects two ending nodes by merging the two nodes into one.

Parameters	Description

Target	Specifies the node that is joined to the current node [in]

Example

The following example connects the ending nodes of each open subpath with the starting node of the next open subpath.

Sub Test()

Dim s As Shape

Dim spath As SubPath

Dim n1 As Node, n2 As Node

Dim Joined As Boolean, Repeat As Boolean

Set s = ActiveShape

If s.Type <> cdrCurveShape Then s.ConvertToCurves

Repeat = True

While Repeat

Set n1 = Nothing

Set n2 = Nothing

Joined = False

For Each spath In s.Curve.Subpaths

If Not spath.Closed Then

If n2 Is Nothing Then

' The first open SubPath found

Set n1 = spath.StartNode

Set n2 = spath.EndNode

Else

' n2 is the last node of previous open SubPath

' Join it with the first node of the current subpath

n2.ConnectWith spath.StartNode

' Joining subpaths reduces the number of subpath in the curve

' So we need to restart

Joined = True

Exit For

End If

End If

Next spath

If Not Joined Then

If Not n1 Is Nothing Then

' There's only one open subpath left. Close it

n1.ConnectWith n2

End If

Repeat = False

End If

Wend

End Sub

 Related Topics


Node.Delete

Sub Delete()

Node

Description

The Delete method breaks a subpath at the specified node by removing a node from a curve.

If you delete a node from a segment that contains two nodes, the whole segment is removed.

Example

The following example deletes all cusp nodes in the curve.

Sub Test()

Dim s As Shape

Dim n As Node

Dim i As Long, Num As Long

Set s = ActiveShape

If s.Type <> cdrCurveShape Then Exit Sub

Num = s.Curve.Nodes.Count

i = 1

While i <= Num

Set n = s.Curve.Nodes(i)

If n.Type = cdrCuspNode Then

If n.SubPath.Nodes.Count = 2 Then

' Deleting a node from a segment containing only 2 nodes

' will remove the whole segment. If we are deleting the last

' node of the subpath, then we must move one more step back.

If n.SubPath.EndNode Is n Then i = i - 1

n.Delete

Num = Num - 2

i = i - 1

Else

' Just delete the node and adjust the number of nodes left.

n.Delete

Num = Num - 1

i = i - 1

End If

End If

i = i + 1

Wend

End Sub

 Related Topics


Node.GetDistanceFrom

Function GetDistanceFrom(ByVal Node As Node) As Double

Node

Description

The GetDistanceFrom method returns the distance from the current node to a specified node.

Parameters	Description

Node	Specifies the node from which the distance is returned [in]

Return value

Returns Double

Example

The following example closes all the open subpaths in a curve by joining or connecting it with the closest node of another open subpath.

Sub CloseShape()

Dim s As Shape

Dim e As Double, r As Double, nr As Double

Dim sp As SubPath

Dim sn As Node, en As Node, n1 As Node, n2 As Node

Dim b As Boolean

Set s = ActiveShape

If s.Type <> cdrCurveShape Then

MsgBox "Curve must be selected"

Exit Sub

End If

' E is auto-join limit beyond which the nodes are joined rather than connected

' Here assumed to be 1% of an average object size

e = s.SizeHeight * s.SizeWidth / 10000

Do

Set sn = Nothing

Set en = Nothing

Set n1 = Nothing

Set n2 = Nothing

b = False

For Each sp In s.Curve.Subpaths

If Not sp.Closed Then

Set n1 = sp.StartNode

Set n2 = sp.EndNode

nr = n1.GetDistanceFrom(n2)

If nr < e And sp.Nodes.Count > 2 Then

n1.JoinWith n2

b = True

Else

If sn Is Nothing Then

Set sn = n1

Set en = n2

r = nr

Else

nr = sn.GetDistanceFrom(n1)

If nr < r Then

Set en = n1

r = nr

End If

nr = sn.GetDistanceFrom(n2)

If nr < r Then

Set en = n2

r = nr

End If

End If

End If

End If

If b Then Exit For

Next sp

If Not b And Not sn Is Nothing Then

If r < e Then sn.JoinWith en Else sn.ConnectWith en

b = True

End If

Loop While b

End Sub

 Related Topics


Node.GetPosition

Sub GetPosition(ByRef PositionX As Double, ByRef PositionY As Double)

Node

Description

The GetPosition method returns the horizontal and vertical coordinates of a node.

The SetPosition method moves the node to new coordinates.

Parameters	Description

PositionX	Specifies the x, or horizontal, coordinate of a node. The x-coordinate is measured in document units. [out]

PositionY	Specifies the y, or vertical, coordinate of a node. The y-coordinate is measured in document units. [out]

Example

The following example draws small ellipses over each node in the selected curve.

Sub Test()

Dim n As Node

Dim x As Double, y As Double

For Each n In ActiveShape.Curve.Nodes

n.GetPosition x, y

ActiveLayer.CreateEllipse2 x, y, 0.05

Next n

End Sub

 Related Topics


Node.JoinWith

Sub JoinWith(ByVal Target As Node)

Node

Description

The JoinWith method connects two ending nodes by merging the two nodes into one.

The ConnectWith method connects two ending nodes by drawing a straight line between them.

Parameters	Description

Target	Specifies the node that is joined to the current node [in]

Example

The following example joins the first and last nodes of the active curve by merging the two nodes into one.

Sub Connect()

Dim s as Shape

Dim sp as SubPath

Set s = ActiveShape

Set sp = ActiveShape.Curve.Subpaths(1)

With s.Curve.Nodes(1)

.JoinWith sp.Nodes(9)

End With

End Sub

 Related Topics


Node.Move

Sub Move([ByVal DeltaX As Double = 0], [ByVal DeltaY As Double = 0])

Node

Description

The Move method offsets the position of a node relative to its original location.

Parameters	Description

DeltaX	Specifies the horizontal offset [in]
Optional
Default value = 0

DeltaY	Specifies the vertical offset [in]
Optional
Default value = 0

Example

The following example randomly distorts the selected curve. This macro loops through all the nodes and changes their positions by moving each node by a random offset.

Sub Test()

Dim s As Shape

Dim n As Node

Dim dx As Double, dy As Double

Const Amplitude As Double = 0.5

Set s = ActiveShape

If s.Type = cdrCurveShape Then

For Each n In s.Curve.Nodes

dx = (Rnd() - 0.5) * Amplitude

dy = (Rnd() - 0.5) * Amplitude

n.Move dx, dy

Next n

End If

End Sub

 Related Topics


Node.Next

Function Next() As Node

Node

Description

The Next method returns the next node in the curve relative to the given node.

Return value

Returns Node

Example

The following example changes the fifth node to a smooth node if the fourth node of the curve is symmetrical and the fifth node is a cusp node.

Sub Test()

Dim s As Shape

Dim n As Node

Set s = ActiveShape

If s.Type = cdrCurveShape Then

Set n = s.Curve.Nodes(4)

If n.Type = cdrSymmetricalNode And n.Next.Type = cdrCuspNode Then

n.Next.Type = cdrSmoothNode

End If

End If

End Sub

 Related Topics


Node.Previous

Function Previous() As Node

Node

Description

The Previous method returns the preceding node in the curve relative to the given node.

Return value

Returns Node

Example

The following example creates a curve with six segments, finds the first symmetrical node, and displays the index number of the node preceding the first symmetrical node.

Sub Test()

Dim s As Shape

Dim n As Node

Dim sp As SubPath

Dim crv As Curve

Set crv = CreateCurve(ActiveDocument)

ActiveDocument.ReferencePoint = cdrBottomLeft

Set sp = crv.CreateSubPath(1, 1)

sp.AppendLineSegment 1, 1

sp.AppendCurveSegment 3, 3

sp.AppendCurveSegment 5, 1

sp.AppendCurveSegment 6, 4

sp.AppendCurveSegment 8, 2

sp.AppendLineSegment 10, 5

sp.Nodes(2).Type = cdrSmoothNode

sp.Nodes(3).Type = cdrSmoothNode

sp.Nodes(4).Type = cdrSymmetricalNode

sp.Nodes(5).Type = cdrSmoothNode

Set s = ActiveLayer.CreateCurve(crv)

For Each n In s.Curve.Nodes

If n.Type = cdrSymmetricalNode Then

Set n = s.Curve.Nodes.Item(n.Index).Previous

Exit For

End If

Next n

MsgBox n.Index

End Sub

 Related Topics


Node.SetPosition

Sub SetPosition(ByVal PositionX As Double, ByVal PositionY As Double)

Node

Description

The SetPosition method moves a node to the specified horizontal and vertical coordinates.

The GetPosition method returns the horizontal and vertical coordinates of a node.

Parameters	Description

PositionX	Specifies the x, or horizontal, coordinate of a node. The x-coordinate is measured in document units. [in]

PositionY	Specifies the y, or vertical, coordinate of a node. The y-coordinate is measured in document units. [in]

Example

The following example distorts the selected curve. The amount of distortion depends on the distance between the node and the center of the shape. The node is moved only radially.

Sub Test()

Dim s As Shape

Dim n As Node

Dim xc As Double, yc As Double

Dim r As Double

Dim dx As Double, dy As Double

Const Amplitude As Double = 0.2

Set s = ActiveShape

If s.Type = cdrCurveShape Then

ActiveDocument.ReferencePoint = cdrCenter

s.GetPosition xc, yc

For Each n In s.Curve.Nodes

dx = n.PositionX - xc

dy = n.PositionY - yc

r = Exp((Rnd() - 0.5) * Amplitude)

n.SetPosition xc + dx * r, yc + dy * r

Next n

End If

End Sub

 Related Topics


NodeRange properties

NodeRange     Legend

    Application
    Count
  Item
    Parent
    PositionX
    PositionY
    SegmentRange
    SizeHeight
    SizeWidth
    Type


NodeRange methods

NodeRange     Legend

   Add
   AddRange
   AutoReduce
   BreakApart
   Delete
   Move
   Remove
   RemoveAll
   RemoveRange
   Rotate
   SetType
   Skew
   Smoothen
   Stretch


NodeRange

Class NodeRange

Properties     Methods     Referenced By

The NodeRange class a number of nodes on a curve.

 Related Topics


NodeRange.Application

Property Application As Application

NodeRange

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


NodeRange.Count

Property Count As Long

NodeRange

Description

The Count property returns the number of nodes in the NodeRange object.

Read-Only

Example

The following example displays the number of nodes selected with the Shape tool before running the macro.

Sub Test()

Dim nr As NodeRange

Set nr = ActiveShape.Curve.Selection

MsgBox nr.Count & " node(s) selected in the curve"

End Sub

Sub Test()

Dim nr As New NodeRange

Dim n As Node

Dim ret As VbMsgBoxResult

For Each n In ActiveShape.Curve.Nodes

If n.Type = cdrCuspNode Then nr.Add n

Next n

If nr.Count = 0 Then

MsgBox "No cusp nodes found"

Else

ret = MsgBox(nr.Count & " cusp nodes found. Do you want to delete them?", vbYesNo)

If ret = vbYes Then nr.Delete

End If

End Sub

 Related Topics


NodeRange.Item

Property Item(ByVal Index As Long) As Node

NodeRange

Description

The Item property returns the specified Node object from the NodeRange object.

The Item property is the default property and its reference may be omitted when accessing items in the range. For example, NodeRange.Item(2) is the same as NodeRange(2) - they both reference the second node in the range.

Read-Only

Parameters	Description

Index	Specifies the node by its index number [in]

Example

The following example creates a node range from all nodes in the curve, and removes all symmetrical and smooth nodes from the range (but the nodes are not deleted from the curve). The remaining collection of cusp nodes are rotated by 30°, relative to its geometric center.

Sub Test()

Dim nr As NodeRange

Dim n As Node

Dim i As Long

Set nr = ActiveShape.Curve.Nodes.All

For i = nr.Count To 1 Step -1

If nr.Item(i).Type <> cdrCuspNode Then nr.Remove i

' The same as: If nr(i).Type <> cdrCuspNode Then nr.Remove i

Next i

ActiveDocument.ReferencePoint = cdrCenter

If nr.Count > 0 Then nr.Rotate 30

End Sub

 Related Topics


NodeRange.Parent

Property Parent As Curve

NodeRange

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


NodeRange.PositionX

Property PositionX As Double

NodeRange

Description

The PositionX property returns the horizontal position of the bounding box that encloses all the nodes in the node range. The position is relative to the document's reference point and is measured in document units.

It is important to note that PositionX and PositionY are always 0 if there are no nodes in the node range.

Read-Only

Example

The following example draws a rectangle around the selected nodes .

Sub Test()

Dim nr As NodeRange

Dim x1 As Double, y1 As Double

Dim x2 As Double, y2 As Double

Set nr = ActiveShape.Curve.Selection

ActiveDocument.ReferencePoint = cdrTopLeft

x1 = nr.PositionX

y1 = nr.PositionY

ActiveDocument.ReferencePoint = cdrBottomRight

x2 = nr.PositionX

y2 = nr.PositionY

ActiveLayer.CreateRectangle x1, y1, x2, y2

End Sub

 Related Topics


NodeRange.PositionY

Property PositionY As Double

NodeRange

Description

The PositionY property returns the vertical position of the bounding box that encloses all the nodes in the node range. The position is relative to the document's reference point and is measured in document units.

It is important to note that PositionX and PositionY are always 0 if there are no nodes in the node range.

Read-Only

Example

The following example draws a rectangle around the selected nodes .

Sub Test()

Dim nr As NodeRange

Dim x1 As Double, y1 As Double

Dim x2 As Double, y2 As Double

Set nr = ActiveShape.Curve.Selection

ActiveDocument.ReferencePoint = cdrTopLeft

x1 = nr.PositionX

y1 = nr.PositionY

ActiveDocument.ReferencePoint = cdrBottomRight

x2 = nr.PositionX

y2 = nr.PositionY

ActiveLayer.CreateRectangle x1, y1, x2, y2

End Sub

 Related Topics


NodeRange.SegmentRange

Property SegmentRange As SegmentRange

NodeRange

Description

The SegmentRange property returns a SegmentRange object which contains all the segments that start at the nodes in the current node range.

Read-Only

Example

The following example converts all selected nodes in the current curve to smooth nodes, and converts all the associated segments to curve segments.

Sub Test()

Dim nr As NodeRange

Dim sr As SegmentRange

Set nr = ActiveShape.Curve.Selection

If nr.Count > 0 Then

Set sr = nr.SegmentRange

sr.SetType cdrCurveSegment

nr.SetType cdrSmoothNode

End If

End Sub

 Related Topics


NodeRange.SizeHeight

Property SizeHeight As Double

NodeRange

Description

The SizeHeight property returns the height of the bounding box enclosing all of the nodes in the node range. This value is measured in document units.

Read-Only

Example

The following example draws a rectangle around the selected nodes.

Sub Test()

Dim nr As NodeRange

Dim x1 As Double, y1 As Double

Dim x2 As Double, y2 As Double

Set nr = ActiveShape.Curve.Selection

ActiveDocument.ReferencePoint = cdrBottomLeft

x1 = nr.PositionX

y1 = nr.PositionY

x2 = x1 + nr.SizeWidth

y2 = y1 + nr.SizeHeight

ActiveLayer.CreateRectangle x1, y1, x2, y2

End Sub

 Related Topics


NodeRange.SizeWidth

Property SizeWidth As Double

NodeRange

Description

The SizeWidth property returns the width of the bounding box enclosing all of the nodes in the node range. This value is measured in document units.

Read-Only

Example

The following example draws a rectangle around the selected nodes.

Sub Test()

Dim nr As NodeRange

Dim x1 As Double, y1 As Double

Dim x2 As Double, y2 As Double

Set nr = ActiveShape.Curve.Selection

ActiveDocument.ReferencePoint = cdrBottomLeft

x1 = nr.PositionX

y1 = nr.PositionY

x2 = x1 + nr.SizeWidth

y2 = y1 + nr.SizeHeight

ActiveLayer.CreateRectangle x1, y1, x2, y2

End Sub

 Related Topics


NodeRange.Type

Property Type As cdrNodeType

NodeRange

Description

The Type property returns the type of nodes in the NodeRange object. If there are nodes of different types, Type property will return cdrMixedNodes

The Type property can also be used with the Item property to return the node type for a specific node within the range.

The Type property returns a value of cdrNodeType.

Read-Only

Example

The following example displays the number of nodes selected and their type, for example, "5 cusp nodes selected" or "3 nodes of different type selected."

Sub Test()

Dim nr As NodeRange

Dim s As String

Set nr = ActiveShape.Curve.Selection

If nr.Count = 0 Then

s = "No nodes selected"

Else

s = CStr(nr.Count) & " "

Select Case nr.Type

Case cdrSymmetricalNode

s = s & "symmetrical"

Case cdrSmoothNode

s = s & "smooth"

Case cdrCuspNode

s = s & "cusp"

Case cdrMixedNodes

s = s & "nodes of different type"

End Select

If nr.Type <> cdrMixedNodes Then s = s & " nodes"

s = s & " selected"

End If

MsgBox s

End Sub

 Related Topics


NodeRange.Add

Sub Add(ByVal Node As Node)

NodeRange

Description

The Add method places a specified node in a NodeRange object

Adding a node to a node range doesn't make that node active within a curve - it merely includes the node in future references to the node range.

Parameters	Description

Node	Specifies the node that is added to the node range  [in]

Example

The following example creates a node range containing the first, second, and third nodes of the curve,. A fifth node is added to the curve and then all four nodes are deleted from the curve.

Sub Test()

Dim nr As NodeRange

Set nr = ActiveShape.Curve.Nodes.Range(1, 2, 3)

nr.Add ActiveShape.Curve.Nodes(5)

nr.Delete

End Sub

 Related Topics


NodeRange.AddRange

Sub AddRange(ByVal NodeRange As NodeRange)

NodeRange

Description

The AddRange method adds nodes from another node range to the current range.

Parameters	Description

NodeRange	Specifies the range of nodes that are added to the current node range. [in]

Example

The following example sets the type of all nodes on the first and second subpaths of the selected curve to smooth.

Sub Test()

Dim nr As NodeRange

Set nr = ActiveShape.Curve.Subpaths(1).Nodes.All

nr.AddRange ActiveShape.Curve.Subpaths(2).Nodes.All

nr.SetType cdrSmoothNode

End Sub

 Related Topics


NodeRange.AutoReduce

Sub AutoReduce(ByVal PrecisionMargin As Double)

NodeRange

Description

The AutoReduce method remove extra nodes, keeping the shape of the curve within a given margin of deviation.

Parameters	Description

PrecisionMargin	Specifies the maximum allowable deviation of the curve shape. This value is measured in document units of length. Specifying larger numbers will leave fewer nodes and may cause a larger distortion of the shape. [in]

Example

The following example removes any extra nodes in the active shape, keeping changes in the curve's shape within 0.01", where inches is the document unit of measurement.

Sub Test()

ActiveShape.Curve.Nodes.All.AutoReduce 0.01

End Sub

 Related Topics


NodeRange.BreakApart

Sub BreakApart()

NodeRange

Description

The BreakApart method breaks a curve at each node in the range of nodes.

Example

The following example breaks the selected curve into a set of individual segments and then scatters each segment randomly.

Sub Test()

Dim s As Shape

Set s = ActiveShape

s.Curve.Nodes.All.BreakApart ' Break apart curve into multiple subpaths

s.BreakApart ' Break apart subpaths into individual shapes

For Each s In ActiveSelection.Shapes

s.Move Rnd() - 0.5, Rnd() - 0.5

Next s

End Sub

 Related Topics


NodeRange.Delete

Sub Delete()

NodeRange

Description

The Delete method removes all the nodes in a node range. The nodes are physically removed from the curve object.

Example

The following example deletes all the selected nodes in the curve. Deleting all nodes results in the deletion of the curve. An object must be selected before executing this macro.

Sub Test()

ActiveShape.Curve.Selection.Delete

End Sub

 Related Topics


NodeRange.Move

Sub Move([ByVal DeltaX As Double = 0], [ByVal DeltaY As Double = 0], [ByVal AnchorIndex As Long = 1], [ByVal ElasticMode As Boolean = False])

NodeRange

Description

The Move method repositions all the nodes in a node range by moving the node by a specified offset.

Parameters	Description

DeltaX	Specifies the horizontal distance to move a node [in]
Optional
Default value = 0

DeltaY	Specifies the vertical distance to move a node [in]
Optional
Default value = 0

AnchorIndex	Specifies the node in the node range that acts as the anchor. The node is identified by its index number. [in]
Optional
Default value = 1

ElasticMode	If set to True, only the node identified by the AnchorIndex parameter is moved by the exact offset specified. The remaining nodes are offset a smaller value depending on their position in the curve. (This is the equivalent of using the Elastic Mode in the CorelDRAW user interface.) [in]
Optional
Default value = False

Example

The following example creates a node range from all nodes in the curve except for the first and the last nodes. The nodes are then moved up (vertically) by 1" and moved back down by 1" with elastic mode enabled. The middle node (node_count/2) is used in the last operation as the anchor node.

Sub Test()

Dim crv As Curve

Dim nr As NodeRange

Set crv = ActiveShape.Curve

Set nr = crv.Nodes.AllExcluding(1, crv.Nodes.Count)

nr.Move 0, 1

nr.Move 0, -1, nr.Count \ 2, True

End Sub

 Related Topics


NodeRange.Remove

Sub Remove(ByVal Index As Long)

NodeRange

Description

The Remove method takes a specified node out of a NodeRange.

Removing a node doesn't delete the node from a curve. The node is not included in future references to the range.

Parameters	Description

Index	Specifies the node that is removed from the node range [in]

Example

The following example gets the selected nodes, removes the first and last selected node from the range, and deletes the remaining nodes. As a result, all the selected nodes, except the first and last, are deleted from the curve.

Sub Test()

Dim nr As NodeRange

Set nr = ActiveShape.Curve.Selection

nr.Remove 1

nr.Remove nr.Count

nr.Delete

End Sub

 Related Topics


NodeRange.RemoveAll

Sub RemoveAll()

NodeRange

Description

The RemoveAll method removes all nodes from a range of nodes and makes the range empty.

This method does not delete the nodes; it just removes them from the range.

Example

The following example displays the number of nodes in the selected curve. It then empties the node range object and displays the number of nodes (zero) now stored in the range.

Sub Test()

Dim nr As NodeRange

Set nr = ActiveShape.Curve.Nodes.All

MsgBox "There are " & nr.Count & " nodes in the curve."

nr.RemoveAll

MsgBox "Now the range contains " & nr.Count & " nodes."

End Sub

 Related Topics


NodeRange.RemoveRange

Sub RemoveRange(ByVal NodeRange As NodeRange)

NodeRange

Description

The RemoveRange method removes the nodes in the specified range from the current range.

Parameters	Description

NodeRange	Specifies the range of nodes that are removed [in]

Example

The following example creates a curve and two node ranges. The first node range contains all the nodes, and the second node range contains all the cusp nodes. The second node range is removed from the first, leaving all nodes except cusp nodes in the first node range.

Sub Test()

Dim s As Shape

Dim n As Node

Dim sp As SubPath

Dim crv As Curve

Dim nr1 As NodeRange

Dim nr2 As New NodeRange

Set crv = CreateCurve(ActiveDocument)

ActiveDocument.ReferencePoint = cdrBottomLeft

Set sp = crv.CreateSubPath(-1, 0.2)

sp.AppendLineSegment 0.5, 1

sp.AppendCurveSegment 2, 3

sp.AppendCurveSegment 4, 1

sp.AppendCurveSegment 5, 4

sp.AppendCurveSegment 7, 2

sp.AppendLineSegment 8, 5

sp.AppendLineSegment 9, 1

sp.Nodes(2).Type = cdrSmoothNode

sp.Nodes(4).Type = cdrSmoothNode

Set s = ActiveLayer.CreateCurve(crv)

Set nr1 = s.Curve.Nodes.All

For Each n In s.Curve.Nodes

If n.Type = cdrCuspNode Then

nr2.Add n

End If

Next n

nr1.RemoveRange nr2

End Sub

 Related Topics


NodeRange.Rotate

Sub Rotate(ByVal Angle As Double, [ByVal UseCenterPoint As Boolean = False], [ByVal RotationCenterX As Double = 0], [ByVal RotationCenterY As Double = 0])

NodeRange

Description

The Rotate property rotates the nodes in a node range as if the node range is a separate shape object.

Parameters	Description

Angle	Specifies the angle, measured in degrees, that the node range is rotated [in]

UseCenterPoint	[in]
Optional
Default value = False

RotationCenterX	[in]
Optional
Default value = 0

RotationCenterY	[in]
Optional
Default value = 0

Example

The following example rotates the selected nodes around their geometrical center. The nodes are rotated 30 degrees:

Sub Test()

Dim nr As NodeRange

Set nr = ActiveShape.Curve.Selection

ActiveDocument.ReferencePoint = cdrCenter

nr.Rotate 30

End Sub

 Related Topics


NodeRange.SetType

Sub SetType(ByVal Type As cdrNodeType)

NodeRange

Description

The SetType method sets the type of all nodes in a range.

The SetType method returns a value of cdrNodeType.

Parameters	Description

Type	Specifies the type of node for all the nodes within a range of nodes  [in]

Example

The following example sets the type of all the nodes in the active shape to cusp nodes.

Sub Test()

ActiveShape.Curve.Nodes.All.SetType cdrCuspNode

End Sub

 Related Topics


NodeRange.Skew

Sub Skew([ByVal AngleX As Double = 0], [ByVal AngleY As Double = 0], [ByVal UseAnchorPoint As Boolean = False], [ByVal SkewAnchorX As Double = 0], [ByVal SkewAnchorY As Double = 0])

NodeRange

Description

The Skew property skews the nodes in a node range as if the node range is a separate shape object.

Parameters	Description

AngleX	Specifies the degree in which to horizontally slant the node range. [in]
Optional
Default value = 0

AngleY	Specifies the degree in which to vertically slant the node range. [in]
Optional
Default value = 0

UseAnchorPoint	Specifies whether to use an anchor point [in]
Optional
Default value = False

SkewAnchorX	Specifies the horizontal coordinate of the anchor point when skewing the node range. This value is measured in document units. [in]
Optional
Default value = 0

SkewAnchorY	Specifies the vertical coordinate of the anchor point when skewing the node range. This value is measured in document units. [in]
Optional
Default value = 0

Example

The following example skews the node range in the active shape horizontally and vertically by 25 degrees. A reference point is not set and the anchor point is set at (0, 0).

Sub Test()

Dim nr as NodeRange

Set nr = ActiveShape.Curve.Nodes.All

With nr

.Skew 25, 25, False, 0, 0

End With

End Sub

 Related Topics


NodeRange.Smoothen

Sub Smoothen(ByVal Smoothness As Long)

NodeRange

Description

The Smoothen method changes the smoothness of a curve at all nodes in the range.

This method produces the same effect as changing the value of the Curve smoothness slider on the property bar.

Parameters	Description

Smoothness	Sets the level of smoothness. Higher values indicate an increased level of smoothness. Values range from 0 to 100. [in]

Example

The following example smoothens all curves on the active page in the drawing.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrCurveShape Then

s.Curve.Nodes.All.Smoothen 20

End If

Next s

End Sub

 Related Topics


NodeRange.Stretch

Sub Stretch([ByVal RatioX As Single = 1], [ByVal RatioY As Single = 1], [ByVal UseAnchorPoint As Boolean = False], [ByVal StretchAnchorX As Double = 0], [ByVal StretchAnchorY As Double = 0])

NodeRange

Description

The Stretch property stretches the nodes in a node range as if the node range is a separate shape object.

Parameters	Description

RatioX	Specifies the width in the aspect ratio used when stretching objects. The aspect ratio is the ratio of the width of an image to its height (expressed mathematically as x:y). The width is expressed as a multiple of the current width. [in]
Optional
Default value = 1

RatioY	Specifies the height in the aspect ratio used when stretching objects. The height is expressed as a multiple of the current height. [in]
Optional
Default value = 1

UseAnchorPoint	Specifies whether to use an anchor point [in]
Optional
Default value = False

StretchAnchorX	Specifies the horizontal coordinate of the anchor point when stretching the node range. The anchor point is the point that remains stationary when you stretch, scale, mirror, or skew an object. This value is measured in document units. [in]
Optional
Default value = 0

StretchAnchorY	Specifies the vertical coordinate of the anchor point when stretching the node range. This value is measured in document units. [in]
Optional
Default value = 0

Example

The following example stretches the node range in the active shape with ratio values of 1, no reference point, and the anchor point set at (0, 0).

Sub SkewNode()

Dim nr as NodeRange

Set nr = ActiveShape.Curve.Nodes.All

With nr

.Stretch 1, 1, False, 0, 0

End With

End Sub

 Related Topics


Nodes properties

Nodes     Legend

    Application
    Count
  Item
    Parent


Nodes methods

Nodes     Legend

   All
   AllExcluding
   Range


Nodes

Class Nodes

Properties     Methods     Referenced By

The Nodes class represents a collection of nodes on a curve.

 Related Topics


Nodes.Application

Property Application As Application

Nodes

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Nodes.Count

Property Count As Long

Nodes

Description

The Count property returns the total number of nodes in the Nodes collection.

Read-Only

Example

The following example displays the number of nodes, segments, and subpaths in the curve.

Sub Test()

Dim crv As Curve

Set crv = ActiveShape.Curve

MsgBox "The curve contains:" & vbCr & _

"Nodes: " & crv.Nodes.Count & vbCr & _

"Segments: " & crv.Segments.Count & vbCr & _

"Subpaths: " & crv.Subpaths.Count

End Sub

 Related Topics


Nodes.Item

Property Item(ByVal Index As Long) As Node

Nodes

Description

The Item property returns the specified node.

The Item property is the default property and its reference may be omitted when accessing items in the collection. For example, Nodes.Item(2) is the same as Nodes(2) - they both reference the second node object in the Nodes collection.

Read-Only

Parameters	Description

Index	Specifies the node by its index number [in]

Example

The following example converts all nodes in the curve to cusp nodes.

Sub Test()

Dim i As Long

For i = 1 To ActiveShape.Curve.Nodes.Count

ActiveShape.Curve.Nodes(i).Type = cdrCuspNode

Next i

End Sub

Sub Test()

Dim n As Node

For Each n In ActiveShape.Curve.Nodes

n.Type = cdrCuspNode

Next n

End Sub

 Related Topics


Nodes.Parent

Property Parent As Curve

Nodes

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Nodes.All

Function All() As NodeRange

Nodes

Description

The All method returns the NodeRange object which contains all nodes from the collection.

Return value

Returns NodeRange

Example

The following example applies auto-reduction to all curves on the active page.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrCurveShape Then

s.Curve.Nodes.All.AutoReduce 0.05

End If

Next s

End Sub

 Related Topics


Nodes.AllExcluding

Function AllExcluding(ByRef IndexArray() As Variant) As NodeRange

Nodes

Description

The AllExcluding method returns a NodeRange object which contains all the nodes from the collection except for the specified nodes.

This function accepts variable number of arguments. It also accepts arrays.

Parameters	Description

IndexArray	Specifies a range of index numbers that identify and group specific nodes [in]

Return value

Returns NodeRange

Example

The following example deletes all nodes in the curve, with the exception of the first three nodes. Deleting nodes alters the appearance of the active shape.

Sub Test()

Dim nr As NodeRange

Set nr = ActiveShape.Curve.Nodes.AllExcluding(1, 2, 3)

nr.Delete

End Sub

 Related Topics


Nodes.Range

Function Range(ByRef IndexArray() As Variant) As NodeRange

Nodes

Description

The Range method returns a NodeRange object which contains all specified nodes from the collection. This function accepts a variable number of arguments. It also accepts arrays.

Parameters	Description

IndexArray	Specifies a range of index numbers that identify and group specific nodes [in]

Return value

Returns NodeRange

Example

The following example moves nodes the first, third and fifth nodes by 2" towards the top of the page.

Sub Test()

Dim nr As NodeRange

Set nr = ActiveShape.Curve.Nodes.Range(Array(1, 3, 5))

nr.Move 0, 2

End Sub

 Related Topics


Outline properties

Outline     Legend

      BehindFill
      Color
      EndArrow
      LineCaps
      LineJoin
      NibAngle
      NibStretch
      ScaleWithShape
      StartArrow
      Style
      Type
      Width


Outline methods

Outline     Legend

   ConvertToObject
   SetProperties


Outline

Class Outline

Properties     Methods     Referenced By

The Outline class represents outline-specific properties of a shape.

 Related Topics


Outline.BehindFill

Property BehindFill As Boolean

Outline

Description

The BehindFill property determines whether an outline is placed behind the object's fill. If the BehindFill property is set to True, the outline appears behind the fill.

Example

The following example creates an ellipse with a thick outline that is placed behind the ellipse's fill.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(3, 3, 2)

s.Fill.UniformColor.RGBAssign 255, 0, 0

With s.Outline

.Width = 0.2

.Color.RGBAssign 0, 0, 255

.BehindFill = True

End With

End Sub

 Related Topics


Outline.Color

Property Color As Color

Outline

Description

The Color property returns or sets the color of an outline.

Example

The following example converts colors of outlines of all objects on the active page to grayscale.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Outline.Type = cdrOutline Then

s.Outline.Color.ConvertToGray

End If

Next s

End Sub

The following example creates a copy of the selected object's outline as a set of shapes (one for each curve segment). It then applies a color that gradually changes from black to red to each subsequent segment, causing the effect of "fountain fill on path."

Sub Test()

Dim seg As Segment

Dim sr As New ShapeRange

Dim s As Shape, st As Shape

Dim Steps As Long

Set s = ActiveShape

Optimization = True

If s Is Nothing Then

MsgBox "Nothing is selected."

Exit Sub

End If

If s.Type <> cdrCurveShape Then

MsgBox "A curve must be selected. Try again."

Exit Sub

End If

If s.Outline.Type = cdrNoOutline Then

MsgBox "The curve must have an outline. Try again."

Exit Sub

End If

Steps = s.Curve.Segments.Count

For Each seg In s.Curve.Segments

Select Case seg.Type

Case cdrLineSegment

Set st = ActiveLayer.CreateLineSegment( _

seg.StartNode.PositionX, seg.StartNode.PositionY, _

seg.EndNode.PositionX, seg.EndNode.PositionY)

Case cdrCurveSegment

Set st = ActiveLayer.CreateCurveSegment( _

seg.StartNode.PositionX, seg.StartNode.PositionY, _

seg.EndNode.PositionX, seg.EndNode.PositionY, _

seg.StartingControlPointLength, _

seg.StartingControlPointAngle, _

seg.EndingControlPointLength, _

seg.EndingControlPointAngle)

End Select

st.Outline.Width = s.Outline.Width

st.Outline.Color.RGBAssign 255 * seg.Index / Steps, 0, 0

sr.Add st

Next seg

sr.Group

Optimization = False

ActiveWindow.Refresh

End Sub

 Related Topics


Outline.EndArrow

Property EndArrow As ArrowHead

Outline

Description

The EndArrow property represents the ending arrowhead of an outline.

Example

The following example applies the fifth arrowhead to the ending point of the selected curve.

Sub Test()

Dim s As Shape

Set s = ActiveShape

If s Is Nothing Then

MsgBox "Nothing is selected."

Exit Sub

End If

If s.Outline.Type = cdrOutline Then

s.Outline.EndArrow = ArrowHeads(5)

End If

End Sub

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Outline.Type = cdrOutline Then

s.Outline.StartArrow = Nothing

s.Outline.EndArrow = Nothing

End If

Next s

End Sub

 Related Topics


Outline.LineCaps

Property LineCaps As cdrOutlineLineCaps

Outline

Description

The LineCaps property returns or sets the endpoint style of an open path outline.

The LineCaps property has a value of cdrOutlineLineCaps.

Example

The following example assigns round line caps and round joins to the outline of the selected shape.

Sub Test()

ActiveShape.Outline.LineCaps = cdrOutlineRoundLineCaps

ActiveShape.Outline.LineJoin = cdrOutlineRoundLineJoin

End Sub

 Related Topics


Outline.LineJoin

Property LineJoin As cdrOutlineLineJoin

Outline

Description

The LineJoin property returns or sets the type of join for lines that intersect in an outline.

The LineJoin property returns a value of cdrOutlineLineJoin.

Example

The following example assigns round line caps and round joins to the outline of the selected shape.

Sub Test()

ActiveShape.Outline.LineCaps = cdrOutlineRoundLineCaps

ActiveShape.Outline.LineJoin = cdrOutlineRoundLineJoin

End Sub

 Related Topics


Outline.NibAngle

Property NibAngle As Double

Outline

Description

The NibAngle property returns or sets the angle of the Brush tool in a calligraphic outline.

The default value of the NibAngle property is 0.

Example

The following example assigns a very thin horizontal pen nib to the outline of the active shape.

Sub Test()

ActiveShape.Outline.NibAngle = 90

ActiveShape.Outline.NibStretch = 1

End Sub

 Related Topics


Outline.NibStretch

Property NibStretch As Long

Outline

Description

The NibStretch property returns or sets the thickness of the Brush tool in a calligraphic outline.

Values range from 1 to 100, and the default value is 100.

Example

The following example assigns a very thin horizontal pen nib to the outline of the active shape.

Sub Test()

ActiveShape.Outline.NibAngle = 90

ActiveShape.Outline.NibStretch = 1

End Sub

 Related Topics


Outline.ScaleWithShape

Property ScaleWithShape As Boolean

Outline

Description

The ScaleWithShape property determines whether an object's outline maintains the size proportions of the object. If this property is set to True, the outline's properties are scaled along with its shape.

Example

The following example creates an ellipse and applies an outline that is 0.1" wide. The ellipse is then enlarged to twice its previous size, and the outline's width (now it is 0.2") is displayed.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(4, 4, 2)

s.Outline.Width = 0.1

s.Outline.ScaleWithShape = True

s.Stretch 2

MsgBox "Outline width is " & s.Outline.Width

End Sub

 Related Topics


Outline.StartArrow

Property StartArrow As ArrowHead

Outline

Description

The StartArrow property represents the starting arrowhead of an outline.

Example

The following example replaces all starting arrowheads that are represented by the third arrow from the arrowhead list with the fifth arrowhead from the list. The color of the outline of the shape is changed to red.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

With s.Outline

If .Type = cdrOutline Then

If .StartArrow.Index = 3 Then

.StartArrow = ArrowHeads(5)

.Color.RGBAssign 255, 0, 0

End If

End If

End With

Next s

End Sub

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Outline.Type = cdrOutline Then

s.Outline.StartArrow = Nothing

s.Outline.EndArrow = Nothing

End If

Next s

End Sub

 Related Topics


Outline.Style

Property Style As OutlineStyle

Outline

Description

The Style property returns OutlineStyle object which represents the outline style (for example, solid, dashed, and so on).

Example

The following example searches through all shapes on the active page. If the width of a shape's outline is greater than 0.1", a "Dot" outline style is applied to the shape.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Outline.Width > 0.1 Then

s.Outline.Style = OutlineStyles(1)

End If

Next s

End Sub

Sub Test()

With ActiveShape.Outline

.Width = 0.03

.Style.DashCount = 2

.Style.DashLength(1) = 1

.Style.DashLength(2) = 10

.Style.GapLength(1) = 4

.Style.GapLength(2) = 4

End With

End Sub

 Related Topics


Outline.Type

Property Type As cdrOutlineType

Outline

Description

The Type property lets you remove an outline or check if an outline is available for a shape.

The Type property returns a value of cdrOutlineType.

Example

The following example removes the outline from the selected shape.

Sub Test()

ActiveShape.Outline.Type = cdrNoOutline

End Sub

Sub Test()

If ActiveShape.Outline.Type = cdrNoOutline Then

ActiveShape.Outline.Width = 0.1

End If

End Sub

 Related Topics


Outline.Width

Property Width As Double

Outline

Description

The Width property returns or sets the width, in points, of a shape's outline.

Assigning a value to this property automatically adds an outline to the shape if it does not already exist.

Example

The following example creates an ellipse with an outline that is 0.1" in width.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(4, 4, 2)

s.Outline.Width = 0.1

End Sub

 Related Topics


Outline.ConvertToObject

Function ConvertToObject() As Shape

Outline

Description

The ConvertToObject method converts an object's outline into a separate shape and returns the new Shape object. If the BehindFill option is enabled, the outline object appears behind the original object.

Return value

Returns Shape

Example

The following example creates an ellipse with a thick outline. A shape is created from the outline and is offset by 1" both horizontally and vertically.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateEllipse2(3, 3, 2)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

s1.Outline.Width = 0.2

s1.Outline.Color.RGBAssign 0, 0, 255

Set s2 = s1.Outline.ConvertToObject

s2.Move 1, 1

End Sub

 Related Topics


Outline.SetProperties

Sub SetProperties([ByVal Width As Double = -1], [ByVal Style As OutlineStyle = Nothing], [ByVal Color As Color = Nothing], [ByVal StartArrow As ArrowHead = Nothing], [ByVal EndArrow As ArrowHead = Nothing], [ByVal BehindFill As cdrTriState = cdrUndefined (-2)], [ByVal ScaleWithShape As cdrTriState = cdrUndefined (-2)], [ByVal LineCaps As cdrOutlineLineCaps = cdrOutlineUndefinedLineCaps (-1)], [ByVal LineJoin As cdrOutlineLineJoin = cdrOutlineUndefinedLineJoin (-1)], [ByVal NibAngle As Double = -9999], [ByVal NibStretch As Long = 0])

Outline

Description

The SetProperties method allows you to set all the properties of an outline with a single command.

Any missing parameter will not change the corresponding property.

Parameters	Description

Width	Specifies the width of an object's outline. An outline's width is measured in points. [in]
Optional
Default value = -1

Style	Sets the outline style of an object's outline. [in]
Optional
Default value = Nothing

Color	Sets the color of an object's outline. [in]
Optional
Default value = Nothing

StartArrow	Sets the start arrow of an object's outline. [in]
Optional
Default value = Nothing

EndArrow	Sets the end arrow of an object's outline. [in]
Optional
Default value = Nothing

BehindFill	Determines whether an outline is behind the object's fill. [in]
Optional
Default value = cdrUndefined (-2)

ScaleWithShape	Determines whether an object's outline maintains the size proportions of the object. [in]
Optional
Default value = cdrUndefined (-2)

LineCaps	Sets the style of the endpoint of an open path outline. [in]
Optional
Default value = cdrOutlineUndefinedLineCaps (-1)

LineJoin	Sets the appearance of lines that intersect each other in an outline. This value returns cdrOutlineLineJoin. [in]
Optional
Default value = cdrOutlineUndefinedLineJoin (-1)

NibAngle	Sets the angle of the Brush tool in a calligraphic outline [in]
Optional
Default value = -9999

NibStretch	Sets the thickness of the Brush tool in a calligraphic outline [in]
Optional
Default value = 0

Example

The following example creates a rectangle with an outline that is 0.3 inches wide. The blue outline is set behind the rectangle's fill and does not to scale to size with the rectangle. The outline's fill has round line caps and beveled line joins. The nib angle is set to 34 degrees with a nib stretch of 100.

Sub test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(3, 3, 7, 7)

s.Outline.SetProperties 0.3, , CreateRGBColor(0, 0, 255), , , True, _

False, cdrOutlineRoundLineCaps, cdrOutlineBevelLineJoin, 34, 100

End Sub

 Related Topics


OutlineStyle properties

OutlineStyle     Legend

      DashCount
      DashLength
      GapLength
    Index


OutlineStyle

Class OutlineStyle

Properties     Referenced By

The OutlineStyle class represents the dash style for outlines.

 Related Topics


OutlineStyle.DashCount

Property DashCount As Long

OutlineStyle

Description

The DashCount property specifies how many pairs of dashes and gaps appear in an outline style. In an outline style, the number of dash and gap pairs can range from 1 to 5.

Example

The following example applies a custom outline style to the selected shape. The new outline appears as a small dot followed by a long dash, with equal gaps between each dash.

Sub Test()

With ActiveShape.Outline

.Width = 0.03

.Style.DashCount = 2

.Style.DashLength(1) = 1

.Style.DashLength(2) = 10

.Style.GapLength(1) = 4

.Style.GapLength(2) = 4

End With

End Sub

 Related Topics


OutlineStyle.DashLength

Property DashLength(ByVal Index As Long) As Long

OutlineStyle

Description

The DashLength property returns or sets the length of each dash in an outline style. The number of dash/gap pairs can range from 1 to 5. The length of each dash is calculated as a multiple of the width of the outline, and is measured in document units. For example, if DashLength(1) = 2 and the width of the outline is 0.5 inch, the length of the first dash in the dash/gap pair is 1 inch.

Parameters	Description

Index	Specifies a dash and gap pair in an outline style [in]

Example

The following example creates an dash and gap pattern of an outline as a set of rectangles at the bottom of the page. Before you run this macro, you need to create an object with a dashed outline and have the object selected.

Sub Test()

Const w As Double = 0.2

Dim x As Double, dx As Double

Dim i As Long

Dim s As Shape

With ActiveShape.Outline

If .Type = cdrOutline Then

For i = 1 To .Style.DashCount

dx = .Style.DashLength(i) * w

Set s = ActiveLayer.CreateRectangle(x, 0, x + dx, w)

s.Fill.UniformColor.RGBAssign 255, 0, 0

x = x + dx

dx = .Style.GapLength(i) * w

Set s = ActiveLayer.CreateRectangle(x, 0, x + dx, w)

s.Fill.UniformColor.RGBAssign 255, 255, 0

x = x + dx

Next i

End If

End With

End Sub

 Related Topics


OutlineStyle.GapLength

Property GapLength(ByVal Index As Long) As Long

OutlineStyle

Description

The GapLength property returns or sets  the length of each gap in an outline style. The number of dash/gap pairs can range from 1 to 5. The length of each gap is calculated as a multiple of the width of the outline, and is measured in document units. For example, if GapLength(1) = 2 and the width of the outline is 0.5 inch, the length of the first gap in the dash/gap pair is 1 inch.

Parameters	Description

Index	Specifies a dash and gap pair in an outline style [in]

Example

The following example creates an dash and gap pattern of an outline as a set of rectangles at the bottom of the page. Before you run this macro, you need to create an object with a dashed outline and have the object selected.

Sub Test()

Const w As Double = 0.2

Dim x As Double, dx As Double

Dim i As Long

Dim s As Shape

With ActiveShape.Outline

If .Type = cdrOutline Then

For i = 1 To .Style.DashCount

dx = .Style.DashLength(i) * w

Set s = ActiveLayer.CreateRectangle(x, 0, x + dx, w)

s.Fill.UniformColor.RGBAssign 255, 0, 0

x = x + dx

dx = .Style.GapLength(i) * w

Set s = ActiveLayer.CreateRectangle(x, 0, x + dx, w)

s.Fill.UniformColor.RGBAssign 255, 255, 0

x = x + dx

Next i

End If

End With

End Sub

 Related Topics


OutlineStyle.Index

Property Index As Long

OutlineStyle

Description

The Index property returns the index of the dash style in the OutlineStyles collection. If the outline style is not saved in the global style collection, this property returns -1.

Read-Only

Example

The following example changes all dotted outlines to long-dashed outlines.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Outline.Type = cdrOutline Then

If s.Outline.Style.Index = 1 Then

s.Outline.Style = OutlineStyles(7)

End If

End If

Next s

End Sub

 Related Topics


OutlineStyles properties

OutlineStyles     Legend

    Application
    Count
  Item
    Parent


OutlineStyles methods

OutlineStyles     Legend

   Add
   AddStyle
   Remove
   Save


OutlineStyles

Class OutlineStyles

Properties     Methods     Referenced By

The OutlineStyles class represents a collection of available dash styles for outlines.

 Related Topics


OutlineStyles.Application

Property Application As Application

OutlineStyles

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


OutlineStyles.Count

Property Count As Long

OutlineStyles

Description

The Count property returns the number of outline styles available.

Read-Only

Example

The following example creates lines and applies a different outline style to each of them.

Sub Test()

Dim d As Document

Dim s As Shape

Dim i As Long

Dim y As Double

Set d = CreateDocument()

For i = 1 To OutlineStyles.Count

y = i * 0.3

Set s = d.ActiveLayer.CreateLineSegment(0, y, 5, y)

s.Outline.Width = 0.01

s.Outline.Style = OutlineStyles(i)

Next i

End Sub

 Related Topics


OutlineStyles.Item

Property Item(ByVal Index As Long) As OutlineStyle

OutlineStyles

Description

The Item property returns the specified outline style from the collection.

The Item property is the default property and its reference may be omitted when accessing items in the collection. For example, OutlineStyles.Item(2) is the same as OutlineStyles(2) - they both reference the second outline style object in the OutlineStyles collection.

Read-Only

Parameters	Description

Index	Specifies the style of outline by its index number [in]

Examples

The following example applies a dotted outline style (the second option in the Style list of the Outline Properties dialog box) to the selected shape.

Sub Test()

ActiveShape.Outline.Style = OutlineStyles(2)

End Sub

The following example creates a sample of each available outline style by creating lines and applying a style to each one in turn.

Sub Test()

Dim d As Document

Dim s As Shape

Dim stl As OutlineStyle

Dim y As Double

Set d = CreateDocument()

For Each stl In OutlineStyles

y = stl.Index * 0.3

Set s = d.ActiveLayer.CreateLineSegment(0, y, 5, y)

s.Outline.Width = 0.01

s.Outline.Style = stl

Next stl

End Sub

 Related Topics


OutlineStyles.Parent

Property Parent As Application

OutlineStyles

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


OutlineStyles.Add

Function Add() As OutlineStyle

OutlineStyles

Description

The Add method adds a new outline style to the collection.

You can call the Save method after you modify the list of outline styles so that the changes will be available the next time you start CorelDRAW.

Return value

Returns OutlineStyle

Example

The following example creates a new outline style and applies the new style to a line segment that is created on the active layer. After the style has been added to OutlineStyles collection, it can be accessed through both the collection and the Outline Properties dialog box.

Sub Test()

Dim s As Shape

Dim stl As OutlineStyle

Set stl = OutlineStyles.Add()

stl.DashCount = 1

stl.DashLength(1) = 20

stl.GapLength(1) = 1

OutlineStyles.Save

Set s = ActiveLayer.CreateLineSegment(0, 0, 5, 5)

s.Outline.Width = 0.1

s.Outline.Style = stl

End Sub

 Related Topics


OutlineStyles.AddStyle

Function AddStyle(ByVal Style As OutlineStyle) As OutlineStyle

OutlineStyles

Description

The AddStyle method adds a new outline style to the collection. The new style is based on an existing style.

This method returns an OutlineStyle object.

You can call the Save method after you modify the list of outline styles so that the changes will be available the next time you start CorelDRAW.

Parameters	Description

Style	Specifies the style from which the dash and gap pattern is copied. [in]

Return value

Returns OutlineStyle

Example

The following example creates a custom outline style based on the second outline in the collection. The changes are then saved.

Sub Test()

Dim stl As OutlineStyle

Set stl = OutlineStyles.AddStyle(OutlineStyles(2))

stl.DashLength(1) = 3

OutlineStyles.Save

End Sub

 Related Topics


OutlineStyles.Remove

Sub Remove(ByVal Index As Long)

OutlineStyles

Description

The Remove method removes an outline style from the OutlineStyles collection.

This method is reserved for future development.

Parameters	Description

Index	Specifies the outline style to remove [in]

Example

The following example creates an outline style, applies it to a line segment, and then removes the style from the collection.

Sub Test()

Dim s As Shape

Dim stl As OutlineStyle

Set stl = OutlineStyles.Add()

stl.DashCount = 1

stl.DashLength(1) = 20

stl.GapLength(1) = 1

OutlineStyles.Save

Set s = ActiveLayer.CreateLineSegment(0,0,5,5)

s.Outline.Width = 0.1

s.Outline.Style = stl

OutlineStyles.Remove stl.Index

End Sub

 Related Topics


OutlineStyles.Save

Sub Save()

OutlineStyles

Description

The Save method saves the list of outline styles.

You can call this method after you modify the list of outline styles so that the changes will be available the next time you start CorelDRAW.

Example

The following example creates a custom outline style based on the second outline in the collection. The changes are then saved.

Sub Test()

Dim stl As OutlineStyle

Set stl = OutlineStyles.AddStyle(OutlineStyles(2))

stl.DashLength(1) = 3

OutlineStyles.Save

End Sub

 Related Topics


Page properties

Page     Legend

    ActiveLayer
    Application
      Background
      Bleed
    CenterX
    CenterY
      Color
    Guides
    Index
    Layers
      Name
      Orientation
    Paper
    Parent
      PrintExportBackground
    Properties
      Resolution
    Shapes
      SizeHeight
      SizeWidth


Page methods

Page     Legend

   Activate
   CreateLayer
   Delete
   FindShape
   FindShapes
   GetSize
   MoveTo
   SelectShapesAtPoint
   SelectShapesFromRectangle
   SetSize
   TextFind
   TextReplace
   UnlockAllShapes


Page

Class Page

Properties     Methods     Referenced By

The Page class represents a page in a document.

 Related Topics


Page.ActiveLayer

Property ActiveLayer As Layer

Page

Description

The ActiveLayer property returns the active layer of a specified page.

Read-Only

Example

The following example places page numbers on each page of the document.

Sub Test()

Dim p As Page

For Each p In ActiveDocument.Pages

p.ActiveLayer.CreateArtisticText 0, 0, "Page " & p.Index

Next p

End Sub

 Related Topics


Page.Application

Property Application As Application

Page

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Page.Background

Property Background As cdrPageBackground

Page

Description

The Background property returns or sets the type of background for a page.

The Background property returns a value of cdrPageBackground. A background may contain a bitmap image, a solid fill, or no background at all.

Example

The following example displays the type of background for the specified page.

Sub Test()

Select Case ActiveDocument.Pages(0).Background

Case cdrPageBackgroundNone

MsgBox "No page background"

Case cdrPageBackgroundSolid

MsgBox "Solid color background"

Case cdrPageBackgroundBitmap

MsgBox "Bitmap page background"

End Select

End Sub

 Related Topics


Page.Bleed

Property Bleed As Double

Page

Description

The Bleed property returns or sets the bleed of a page.

Example

The following example sets the bleed value to 0.1", the document resolution to 150 dpi, and the page background to yellow which is omitted when printing or exporting the document.

Sub Test()

With ActiveDocument.Pages(0)

.Color.RGBAssign 255, 255, 0

.PrintExportBackground = False

.Bleed = 0.1

.Resolution = 150

End With

End Sub

 Related Topics


Page.CenterX

Property CenterX As Double

Page

Description

The CenterX property returns the horizontal coordinate of the center of the page.

Read-Only

Example

The following example creates an ellipse with a radius of two inches at the center of the active page.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(ActivePage.CenterX, ActivePage.CenterY, 2)

End Sub

 Related Topics


Page.CenterY

Property CenterY As Double

Page

Description

The CenterY property returns the vertical coordinate of the center of the page.

Read-Only

Example

The following example creates an ellipse with a radius of two inches at the center of the active page.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(ActivePage.CenterX, ActivePage.CenterY, 2)

End Sub

 Related Topics


Page.Color

Property Color As Color

Page

Description

The Color property returns or sets the background color of a page.

The Color property only applies if the Background property is set to cdrPageBackgroundSolid.

Example

The following example creates a red background in the in the master page of the active document. Applying a red background to the master page applies that background to every page in the document:

Sub Test()

ActiveDocument.Pages(0).Color.RGBAssign 255, 0, 0

End Sub

 Related Topics


Page.Guides

Property Guides([ByVal Type As cdrGuideType = cdrAllGuides (-1)]) As ShapeRange

Page

Description

The Guides property returns returns a set of local guidelines defined on the page.

Read-Only

Parameters	Description

Type	Specifies the type of guideline on a page. This value returns cdrGuideType. [in]
Optional
Default value = cdrAllGuides (-1)

Example

The following example deletes all of the local vertical guidelines on the active page.

Sub Test()

ActivePage.Guides(cdrVerticalGuide).Delete

End Sub

 Related Topics


Page.Index

Property Index As Long

Page

Description

The Index property returns the page number of a page.

Read-Only

Example

The following example inserts page numbers on each page of the document.

Sub Test()

Dim p As Page

Dim s As Shape

For Each p In ActiveDocument.Pages

Set s = p.ActiveLayer.CreateArtisticText(p.SizeWidth / 2, 0.5, "- Page " & p.Index & " -")

s.Text.AlignProperties.Alignment = cdrCenterAlignment

Next p

End Sub

 Related Topics


Page.Layers

Property Layers As Layers

Page

Description

The Layers property returns the collection of all layers in the document. If you want to access a master layer, you can use the master page returned by Pages(0).

Read-Only

Example

The following example creates a text object on each layer of the page. The text object contains the name of the corresponding layer.

Sub Test()

Dim lyr As Layer

Dim n As Long

n = 0

For Each lyr In ActivePage.Layers

lyr.CreateArtisticText 0, n, lyr.Name

n = n + 1

Next lyr

End Sub

 Related Topics


Page.Name

Property Name As String

Page

Description

The Name property returns or sets the name of a page.

Example

The following example displays the name of the active page.

Sub Test()

MsgBox "Current Page: " & ActivePage.Name

End Sub

 Related Topics


Page.Orientation

Property Orientation As cdrPageOrientation

Page

Description

The Orientation property returns or sets the orientation of a page. When setting a different orientation for the page, the values for the width and height are exchanged.

The Orientation property returns a value of cdrPageOrientation.

Example

The following example inserts a text object on each page, indicating the page orientation of the page.

Sub Test()

Dim Orient As String

Dim p As Page

For Each p In ActiveDocument.Pages

If p.Orientation = cdrPortrait Then

Orient = "Portrait"

Else

Orient = "Landscape"

End If

p.ActiveLayer.CreateArtisticText 0, 0, Orient

Next p

End Sub

 Related Topics


Page.Paper

Property Paper As String

Page

Description

The Paper property returns the name of the paper size if the name exists.

Read-Only

Example

The following example checks to see if the active page size is set to "Letter" (8.5x11) size paper. If it is not set to Letter settings, the correct values are applied to the SizeWidth and SizeHeight values:

Sub Test()

If ActivePage.Paper <> "Letter" Then

ActivePage.SizeWidth = 8.5

ActivePage.SizeHeight = 11

End If

End Sub

The following example displays a warning if the selected paper size is not a standard one.

Sub Test()

If ActivePage.Paper = "Custom" Then

MsgBox "Attention: non-standard page size used!"

End If

End Sub

 Related Topics


Page.Parent

Property Parent As Pages

Page

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Page.PrintExportBackground

Property PrintExportBackground As Boolean

Page

Description

The PrintExportBackground property returns or sets whether the background of a page is printed or exported.

Example

The following example sets the bleed value to 0.1", the document resolution to 150 dpi, and the page background to yellow which is omitted when printing or exporting the document.

Sub Test()

With ActiveDocument.Pages(0)

.Color.RGBAssign 255, 255, 0

.PrintExportBackground = False

.Bleed = 0.1

.Resolution = 150

End With

End Sub

 Related Topics


Page.Properties

Property Properties As Properties

Page

Description

The Properties property returns the Properties collection which allows you to specify and manipulate custom data associated with a page.

Read-Only

Examples

The following example creates 100 shapes and stores their IDs for future reference in the active page.

Sub CreateAndStoreShapes()

Dim i As Long

Dim x As Double, y As Double, r As Double

Dim MaxX As Double, MaxY As Double, MaxR As Double

Dim s As Shape, Num As Long

MaxX = ActivePage.SizeWidth

MaxY = ActivePage.SizeHeight

MaxR = 1

Num = 100

' Store the total number of shapes

ActivePage.Properties("ShapeArray", 0) = Num

For i = 1 To Num

x = Rnd() * MaxX

y = Rnd() * MaxY

r = Rnd() * MaxR

Set s = ActiveLayer.CreateEllipse2(x, y, r)

s.Fill.UniformColor.RGBAssign Rnd() * 256, Rnd() * 256, Rnd() * 256

' Store the current shape's ID number

ActivePage.Properties("ShapeArray", i) = s.StaticID

Next i

End Sub

The following example retrieves all the shape references stored in the page and deletes them.

Sub DeleteStoredShapes()

Dim s As Shape, sr As New ShapeRange

Dim v As Variant

Dim Num As Long, i As Long, id As Long

v = ActivePage.Properties("ShapeArray", 0) ' Retrieving the total number of shape references stored

If Not IsNull(v) Then

' Deleting the property

ActivePage.Properties.Delete "ShapeArray", 0

Num = v

ActiveDocument.ClearSelection

For i = 1 To Num

' Getting the current shape's ID to find

id = ActivePage.Properties("ShapeArray", i)

Set s = ActivePage.FindShape(StaticID:=id)

' Add the shape to the shape range

If Not s Is Nothing Then sr.Add s

' Delete the property

ActivePage.Properties.Delete "ShapeArray", i

Next i

sr.Delete ' Delete all shapes found

Else

MsgBox "No shape references are stored in the active page."

End If

End Sub

 Related Topics


Page.Resolution

Property Resolution As Long

Page

Description

The Resolution property returns or sets the resolution for bitmap rendering, measured in dots per inch (dpi).

Example

The following example sets the bleed value to 0.1", the document resolution to 150 dpi, and the page background to yellow which is omitted when printing or exporting the document.

Sub Test()

With ActiveDocument.Pages(0)

.Color.RGBAssign 255, 255, 0

.PrintExportBackground = False

.Bleed = 0.1

.Resolution = 150

End With

End Sub

 Related Topics


Page.Shapes

Property Shapes As Shapes

Page

Description

The Shapes property returns the collection of shapes on a page.

Read-Only

Example

The following code fills each object on the active page with the color assigned to the layer they reside on (the layer override color).

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

s.Fill.ApplyUniformFill s.Layer.Color

Next s

End Sub

 Related Topics


Page.SizeHeight

Property SizeHeight As Double

Page

Description

The SizeHeight property returns or sets the height of a page.

Example

The following example sets all document pages to 5" x 11".

Sub Test()

Dim p As Page

For Each p In ActiveDocument.Pages

p.SizeWidth = 5

p.SizeHeight = 11

Next p

End Sub

 Related Topics


Page.SizeWidth

Property SizeWidth As Double

Page

Description

The SizeWidth property returns or sets the width of a page.

Example

The following example sets all document pages to 5" x 11".

Sub Test()

Dim p As Page

For Each p In ActiveDocument.Pages

p.SizeWidth = 5

p.SizeHeight = 11

Next p

End Sub

 Related Topics


Page.Activate

Sub Activate()

Page

Description

The Activate method makes the specified page active.

Example

The following example activates the first page and displays it on the screen:

Sub Test()

ActiveDocument.Pages(1).Activate

End Sub

 Related Topics


Page.CreateLayer

Function CreateLayer(ByVal LayerName As String) As Layer

Page

Description

The CreateLayer method adds a new layer to the document. If the layer is created on a master page, it becomes a master layer.

Parameters	Description

LayerName	Specifies a name for the new layer [in]

Return value

Returns Layer

Example

The following example adds a new layer named "MyLayer" to the active page, and creates a rectangle on the new layer.

Sub Test()

Dim lr As Layer

Set lr = ActivePage.CreateLayer("MyLayer")

lr.CreateRectangle 0, 0, 2, 2

End Sub

 Related Topics


Page.Delete

Sub Delete()

Page

Description

The Delete method removes a page from a document and deletes all the shapes on the page.

Example

The following example deletes all of the empty pages in the active document.

Sub Test()

Dim p As Page

For Each p In ActiveDocument.Pages

If p.Shapes.Count = 0 Then p.Delete

Next p

End Sub

 Related Topics


Page.FindShape

Function FindShape([ByVal Name As String], [ByVal Type As cdrShapeType = cdrNoShape (0)], [ByVal StaticID As Long = 0], [ByVal Recursive As Boolean = True]) As Shape

Page

Description

The FindShape method locates a shape with specified properties. If the shape cannot be found on the page, an empty reference (Nothing) is returned.

Parameters	Description

Name	Specifies the name of the shape on the page. [in]
Optional

Type	Specifies the type of shape. This value returns cdrShapeType. [in]
Optional
Default value = cdrNoShape (0)

StaticID	Specifies a value which represents a shape's unique ID [in]
Optional
Default value = 0

Recursive	Specifies whether to iterate through all the shapes [in]
Optional
Default value = True

Return value

Returns Shape

Example

The following example finds a rectangle named "Frame" and selects it.

Sub Test()

Dim s As Shape

Set s = ActivePage.FindShape(Name:="Frame", Type:=cdrRectangleShape)

If s Is Nothing Then

MsgBox "The rectange 'Frame' cannot be found on page " & ActivePage.Index

Else

s.CreateSelection

End If

End Sub

 Related Topics


Page.FindShapes

Function FindShapes([ByVal Name As String], [ByVal Type As cdrShapeType = cdrNoShape (0)], [ByVal Recursive As Boolean = True]) As ShapeRange

Page

Description

The FindShapes method locates all shapes that have certain properties on a page. It returns the ShapeRange object which contains all shapes that are found.

Parameters	Description

Name	Specifies the name of the shape on the page [in]
Optional

Type	Specifies the type of shape. This value returns cdrShapeType. [in]
Optional
Default value = cdrNoShape (0)

Recursive	Specifies whether to iterate through all the shapes [in]
Optional
Default value = True

Return value

Returns ShapeRange

Example

The following example finds all rectangles on the active page and fills them with a uniform red fill.

Sub Test()

Dim sr As ShapeRange

Set sr = ActivePage.FindShapes(Type:=cdrRectangleShape)

If sr.Count <> 0 Then

sr.ApplyUniformFill CreateRGBColor(255, 0, 0)

Else

MsgBox "There are no rectangles on the current page"

End If

End Sub

 Related Topics


Page.GetSize

Sub GetSize(ByRef Width As Double, ByRef Height As Double)

Page

Description

The GetSize method gets both the width and height of a page.

Parameters	Description

Width	Returns the width of a page, measured in document units [out]

Height	Returns the height of a page, measured in document units [out]

Example

The following example creates a rectangle with the size of active page (the page frame).

Sub Test()

Dim sx As Double, sy As Double

ActivePage.GetSize sx, sy

ActiveLayer.CreateRectangle2 0, 0, sx, sy

End Sub

 Related Topics


Page.MoveTo

Sub MoveTo(ByVal Index As Long)

Page

Description

The MoveTo method moves a page to the specified position in the document.

Parameters	Description

Index	The Index parameter specifies the new index number of the moved page in the Pages collection of CorelDRAW. A new index number repositions the page within the collection. [in]

Example

The following example moves the second page to the beginning of the document.

Sub Test()

ActiveDocument.Pages(2).MoveTo 1

End Sub

 Related Topics


Page.SelectShapesAtPoint

Function SelectShapesAtPoint(ByVal X As Double, ByVal Y As Double, ByVal SelectUnfilled As Boolean, [ByVal HotArea As Double = -1]) As Shape

Page

Description

The SelectShapesAtPoint method selects all the shapes at a specified point in the document. This method creates a new selection and returns the selection shape object.

Parameters	Description

X	Specifies the horizontal coordinate of the point. This value is measured in document units. [in]

Y	Specifies the vertical coordinate of the point. This value is measured in document units [in]

SelectUnfilled	Specifies whether to select the shapes inside the shape [in]

HotArea	Specifies the area around the point to include [in]
Optional
Default value = -1

Return value

Returns Shape

Example

The following example allows the user to click over a shape. The shape's fill is then changed by shifting its Hue by 30°.

Sub Test()

Dim d As Document

Dim sel As Shape, s As Shape

Dim x As Double, y As Double, Shift As Long

Dim c As New Color

Set d = ActiveDocument

d.ShapeEnumDirection = cdrShapeEnumBottomFirst

While d.GetUserClick(x, y, Shift, 100, False, cdrCursorWinArrow) = 0

Set sel = d.ActivePage.SelectShapesAtPoint(x, y, False)

If sel.Shapes.Count > 0 Then

Set s = sel.Shapes(1)

d.ClearSelection

s.AddToSelection

If s.Fill.Type <> cdrUniformFill Then

s.Fill.UniformColor.RGBAssign 255, 0, 0

Else

c.CopyAssign s.Fill.UniformColor

c.ConvertToHLS

c.HLSHue = (c.HLSHue + 30) Mod 360

s.Fill.ApplyUniformFill c

End If

End If

Wend

End Sub

 Related Topics


Page.SelectShapesFromRectangle

Function SelectShapesFromRectangle(ByVal x1 As Double, ByVal y1 As Double, ByVal x2 As Double, ByVal y2 As Double, ByVal Touch As Boolean) As Shape

Page

Description

The SelectShapesFromRectangle method selects all the shapes within a given rectangle as if selected with a marquee.

This method creates a new selection and returns the selection shape object.

Parameters	Description

x1	Defines the horizontal coordinate for the upper left corner of a rectangle, measured in document units [in]

y1	Defines the vertical coordinate for the upper left corner of a rectangle, measured in document units [in]

x2	Defines the horizontal coordinate for the lower right corner of a rectangle, measured in document units [in]

y2	Defines the vertical coordinate for the lower right corner of a rectangle, measured in document units [in]

Touch	If set to True, the shapes not completely enclosed within the rectangle area are also selected. [in]

Return value

Returns Shape

Example

The following example allows the user to pick a color which is used to fill all shapes in a defined area. This procedure repeats until Esc is pressed.

Sub Test()

Dim d As Document

Dim sel As Shape, s As Shape

Dim x1 As Double, y1 As Double, x2 As Double, y2 As Double, Shift As Long

Dim c As New Color

Set d = ActiveDocument

c.UserAssign

While d.GetUserArea(x1, y1, x2, y2, Shift, 100, False, cdrCursorWinCross) = 0

Set sel = d.ActivePage.SelectShapesFromRectangle(x1, y1, x2, y2, False)

For Each s In sel.Shapes

s.Fill.ApplyUniformFill c

Next s

Wend

End Sub

 Related Topics


Page.SetSize

Sub SetSize(ByVal Width As Double, ByVal Height As Double)

Page

Description

The SetSize method sets both the width and height of a page.

Parameters	Description

Width	Sets the width of a page, measured in document units [in]

Height	Sets the height of a page, measured in document units [in]

Example

The following example sets the width of the active page to 4.25 inches and the height to 5.5 inches.

Sub Test()

ActivePage.SetSize 4.25, 5.5

End Sub

 Related Topics


Page.TextFind

Function TextFind(ByVal Text As String, ByVal CaseSensitive As Boolean) As Shape

Page

Description

The TextFind method finds a text object containing specified text.

Parameters	Description

Text	Specifies a string, contained in quotation marks, indicating the text to search for  [in]

CaseSensitive	Determines whether the search string should look for case sensitive text. If the parameter is set to True, the text in the Text parameter must match the case of the text in the text range. [in]

Return value

Returns Shape

Example

The following example creates three text objects, finds the text object that contains the word "Sentence", and fills the text object with red.

Sub Test()

Dim s As Shape

ActiveLayer.CreateArtisticText 0, 0, "Text1"

ActiveLayer.CreateArtisticText 0, 3, "Some Sentence."

ActiveLayer.CreateArtisticText 0, 5, "Word"

Set s = ActivePage.TextFind("Sentence", True)

If Not s Is Nothing Then

s.Fill.UniformColor.RGBAssign 255, 0, 0

End If

End Sub

 Related Topics


Page.TextReplace

Sub TextReplace(ByVal OldText As String, ByVal NewText As String, ByVal CaseSensitive As Boolean, [ByVal ReplaceSelectedOnly As Boolean = True])

Page

Description

The Replace method finds and replaces the specified text string.

Parameters	Description

OldText	Specifies a text string, contained in quotation marks, indicating the text in a text range that is replaced [in]

NewText	Represents a text string, contained in quotation marks, indicating the text that replaces the text specified in the OldText parameter [in]

CaseSensitive	Determines whether the search string should look for case sensitive text [in]

ReplaceSelectedOnly	Determines whether only the selected text is to be replaced with the TextReplace method [in]
Optional
Default value = True

Example

The following example creates three text objects, and replaces the word "Some" with "Short", which results in one of the text objects becoming "Short Sentence."

Sub Test()

ActiveLayer.CreateArtisticText 0, 0, "Text1"

ActiveLayer.CreateArtisticText 0, 3, "Some Sentence."

ActiveLayer.CreateArtisticText 0, 5, "Word"

ActivePage.TextReplace "Some", "Short", True, False

End Sub

 Related Topics


Page.UnlockAllShapes

Sub UnlockAllShapes()

Page

Description

The UnlockAllShapes method unlocks all locked shapes on the page. Once objects on the page are unlocked, editing of the objects is possible.

Example

The following example unlocks all of the shape objects on the active page.

Sub CountProp()

ActivePage.UnlockAllShapes

End Sub

 Related Topics


Pages properties

Pages     Legend

    Application
    Count
  Item
    Parent


Pages

Class Pages

Properties     Referenced By

The Pages class represents the collection of all pages in a document.

 Related Topics


Pages.Application

Property Application As Application

Pages

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Pages.Count

Property Count As Long

Pages

Description

The Count property returns the number of pages in the document.

Read-Only

Example

The following example returns a message if the document contains only one page.

Sub Test()

Dim ret As VbMsgBoxResult

If ActiveDocument.Pages.Count = 1 Then

ret = MsgBox("Document contains only 1 page. Do you want to continue?", vbYesNo)

If ret = vbNo Then Exit Sub

End If

End Sub

 Related Topics


Pages.Item

Property Item(ByVal Index As Long) As Page

Pages

Description

The Item property returns the specified Page of the document.

The Item property is the default property and its reference may be omitted when accessing an item in the collection. For example, Pages.Item(2) is the same as Pages(2) - they both reference the second page in the Pages collection.

A page with an index number of 0 returns the Master Page. Some layers, such as Guides or Grid, are available only on the master page.

Read-Only

Parameters	Description

Index	Specifies the Page by its index number [in]

Example

The following example inserts page numbers to each page in the active document.

Sub Test()

Dim p As Page

Dim i As Long

For i = 1 To ActiveDocument.Pages.Count

Set p = ActiveDocument.Pages(i)

p.ActiveLayer.CreateArtisticText 0, 0, "Page " & p.Index

Next i

End Sub

Sub Test()

Dim p As Page

For Each p In ActiveDocument.Pages

p.ActiveLayer.CreateArtisticText 0, 0, "Page " & p.Index

Next p

End Sub

 Related Topics


Pages.Parent

Property Parent As Document

Pages

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


PageSize properties

PageSize     Legend

    BuiltIn
    Document
      Height
    Index
    Name
    Parent
      Width


PageSize methods

PageSize     Legend

   Delete


PageSize

Class PageSize

Properties     Methods     Referenced By

PageSize Class

 Related Topics


PageSize.BuiltIn

Property BuiltIn As Boolean

PageSize

Description

The BuiltIn property returns True if the type of the paper is predefined.

Read-Only

Example

The following example displays the names of all the page sizes, and their width and height, if the paper type is predefined.

Sub Test()

Dim ps As PageSizes

Dim d As Document

Dim p As PageSize

Dim st As String

Dim s As Shape

Set d = CreateDocument

Set ps = d.PageSizes

For Each p In ps

If p.BuiltIn Then

st = st & p.Name & "(" & p.Width & " X " & p.Height & ")" & vbCr

End If

Next p

Set s = d.ActiveLayer.CreateParagraphText(8.5, 11, 0, 0, st)

End Sub

 Related Topics


PageSize.Document

Property Document As Document

PageSize

Description

The Document property returns the document to which the object belongs.

Read-Only

Example

The following example returns the filename of the document.

Sub Test()

Dim ps As PageSizes

Dim d As Document

Dim p As PageSize

Set d = CreateDocument

Set ps = d.PageSizes

Set p = ps.Item(4)

MsgBox p.Document.FileName

End Sub

 Related Topics


PageSize.Height

Property Height As Double

PageSize

Description

The Height property returns the height of the page.

Example

The following example displays the names of all page sizes, and their widths and heights, if the paper type is predefined.

Sub Test()

Dim ps As PageSizes

Dim d As Document

Dim p As PageSize

Dim st As String

Dim s As Shape

Set d = CreateDocument

Set ps = d.PageSizes

For Each p In ps

If p.BuiltIn Then

st = st & p.Name & "(" & p.Width & " X " & p.Height & ")" & vbCr

End If

Next p

Set s = d.ActiveLayer.CreateParagraphText(8.5, 11, 0, 0, st)

End Sub

 Related Topics


PageSize.Index

Property Index As Long

PageSize

Description

The Index property returns the index number for the paper type.

Read-Only

Example

The following example displays the names of all page sizes, and their index numbers, if the paper type is predefined.

Sub Test()

Dim ps As PageSizes

Dim d As Document

Dim p As PageSize

Dim st As String

Dim s As Shape

Set d = CreateDocument

Set ps = d.PageSizes

For Each p In ps

If p.BuiltIn Then

st = st & p.Name & "(" & p.Index & ")" & vbCr

End If

Next p

Set s = d.ActiveLayer.CreateParagraphText(8.5, 11, 0, 0, st)

End Sub

 Related Topics


PageSize.Name

Property Name As String

PageSize

Description

The Name property returns the name of the paper type.

Read-Only

Example

The following example displays the names of all page sizes, and their widths and heights, if the paper type is predefined.

Sub Test()

Dim ps As PageSizes

Dim d As Document

Dim p As PageSize

Dim st As String

Dim s As Shape

Set d = CreateDocument

Set ps = d.PageSizes

For Each p In ps

If p.BuiltIn Then

st = st & p.Name & "(" & p.Width & " X " & p.Height & ")" & vbCr

End If

Next p

Set s = d.ActiveLayer.CreateParagraphText(8.5, 11, 0, 0, st)

End Sub

 Related Topics


PageSize.Parent

Property Parent As PageSizes

PageSize

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


PageSize.Width

Property Width As Double

PageSize

Description

The Width property returns the width of the page.

Example

The following example displays the names of all page sizes, and their widths and heights, if the paper type is predefined.

Sub Test()

Dim ps As PageSizes

Dim d As Document

Dim p As PageSize

Dim st As String

Dim s As Shape

Set d = CreateDocument

Set ps = d.PageSizes

For Each p In ps

If p.BuiltIn Then

st = st & p.Name & "(" & p.Width & " X " & p.Height & ")" & vbCr

End If

Next p

Set s = d.ActiveLayer.CreateParagraphText(8.5, 11, 0, 0, st)

End Sub

 Related Topics


PageSize.Delete

Sub Delete()

PageSize

Description

The Delete property deletes a custom paper type.

Example

The following example deletes all page sizes that are not predefined, including custom page sizes.

Sub Test()

Dim ps As PageSizes

Dim d As Document

Dim p As PageSize

Set d = CreateDocument

Set ps = d.PageSizes

For Each p In ps

If Not p.BuiltIn Then

p.Delete

End If

Next p

End Sub

 Related Topics


PageSizes properties

PageSizes     Legend

    Count
  Item
    Parent


PageSizes methods

PageSizes     Legend

   Add


PageSizes

Class PageSizes

Properties     Methods     Referenced By

PageSizes Class

 Related Topics


PageSizes.Count

Property Count As Long

PageSizes

Description

The Count property returns the number of objects in the collection.

Read-Only

Example

The following example displays the number of available page sizes for the active document.

Sub Test()

MsgBox ActiveDocument.PageSizes.Count

End Sub

 Related Topics


PageSizes.Item

Property Item(ByVal IndexOrName As Variant) As PageSize

PageSizes

Description

The Item property returns the specified PageSize object.

Read-Only

Parameters	Description

IndexOrName	Specifies the item by its name or index number [in]

Example

The following example displays the name of the second page size in the PageSizes collection.

Sub Test()

MsgBox ActiveDocument.PageSizes(2).Name

End Sub

 Related Topics


PageSizes.Parent

Property Parent As Document

PageSizes

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


PageSizes.Add

Function Add(ByVal Name As String, ByVal Width As Double, ByVal Height As Double) As PageSize

PageSizes

Description

The Add method adds a custom page size to the collection.

Parameters	Description

Name	Specifies the name of the custom page size [in]

Width	Specifies the width [in]

Height	Specifies the height [in]

Return value

Returns PageSize

Example

The following example adds a new page size named "Test Paper Size." The new page size has a width of  5.5 inches and a height of 9.5 inches.

Public Sub PageSizes_Add()

Dim ps As PageSizes

Dim d As Document

Set d = CreateDocument

Set ps = d.PageSizes

ps.Add "Test Paper Size", 5.5, 9.5

End Sub

 Related Topics


Palette properties

Palette     Legend

    Application
      Color
    ColorCount
    DuplicatePresent
    FileName
      Name
    PaletteID
    Parent
    Type


Palette methods

Palette     Legend

   AddColor
   Close
   Colors
   FindColor
   GetIndexOfColor
   InsertColor
   MatchColor
   RemoveColor
   Save


Palette

Class Palette

Properties     Methods     Referenced By

The Palette class represents a color palette.

 Related Topics


Palette.Application

Property Application As Object

Palette

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Palette.Color

Property Color(ByVal Index As Long) As Color

Palette

Description

The Color property returns a specified color from a palette.

This property is similar to using the Colors collection, but it works faster when you need to access only a single color from the palette.

Parameters	Description

Index	Specifies a color from the palette using its index number [in]

Example

The following example creates an ellipse and fills it with the 15th color of the default color palette.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(2, 2, 1)

s.Fill.ApplyUniformFill ActivePalette.Color(15)

End Sub

 Related Topics


Palette.ColorCount

Property ColorCount As Long

Palette

Description

The ColorCount property returns the number of colors in a color palette.

It functions similarly but faster than Colors.Count.

Read-Only

Example

The following example displays the total number of colors found in the default palette.

Sub Test()

Dim pal As Palette

Set pal = ActivePalette

MsgBox "Default palette contains " & pal.ColorCount & " color(s)"

End Sub

 Related Topics


Palette.DuplicatePresent

Property DuplicatePresent As Boolean

Palette

Description

The DuplicatePresent property determines whether a color is repeated in a color palette.

If the value returned is True, there are any duplicate colors in the palette.

Read-Only

Example

The following example displays a message if there are any duplicate colors in the default palette.

Sub Test()

If ActivePalette.DuplicatePresent Then

MsgBox "Default palette contains duplicate colors"

End If

End Sub

 Related Topics


Palette.FileName

Property FileName As String

Palette

Description

The FileName property returns the filename of the palette.

Read-Only

Example

The following example displays the filename of the palette.

Sub Test()

MsgBox ActivePalette.FileName

End Sub

 Related Topics


Palette.Name

Property Name As String

Palette

Description

The Name property returns or sets the name of the palette.

The palette name can only be set with the Name property if the palette is a custom palette.

Example

The following example displays the name of all open palettes.

Sub Test()

Dim s As String

Dim pal As Palette

s = "Open palettes:" & vbCr

For Each pal In Palettes

s = s & vbCr & pal.Name

Next pal

MsgBox s

End Sub

 Related Topics


Palette.PaletteID

Property PaletteID As cdrPaletteID

Palette

Description

The PaletteID property returns the ID of a color palette. You can use this ID to identify fixed color palettes such as Pantone or Web.

The value returned is cdrPaletteID.

Read-Only

Example

The following example opens the Pantone Process color palette if it is not already open.

Sub Test()

Dim Found As Boolean

Dim pal As Palette

Found = False

For Each pal In Palettes

If pal.PaletteID = cdrPANTONEProcess Then

Found = True

Exit For

End If

Next pal

If Not Found Then Palettes.OpenFixed cdrPANTONEProcess

End Sub

 Related Topics


Palette.Parent

Property Parent As Object

Palette

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Palette.Type

Property Type As cdrPaletteType

Palette

Description

The Type property returns whether a palette is a custom palette (for example, a CorelDRAW palette or any user-created palette) or a fixed palette (for example, Pantone, Netscape, TOYO, FOCOLTONE, and so on).

The value returned is cdrPaletteType.

Read-Only

Example

The following example displays the total number of palettes that are open, as well as the number of fixed and custom palettes.

Sub Test()

Dim fx As Long, cs As Long

Dim pal As Palette

fx = 0

cs = 0

For Each pal In Palettes

Select Case pal.Type

Case cdrFixedPalette

fx = fx + 1

Case cdrCustomPalette

cs = cs + 1

End Select

Next pal

MsgBox "Total palettes open: " & Palettes.Count & vbCr & _

"Fixed palettes: " & fx & vbCr & _

"Custom palettes: " & cs

End Sub

 Related Topics


Palette.AddColor

Sub AddColor(ByVal Color As Color)

Palette

Description

The AddColor method adds a color to a custom color palette.

Parameters	Description

Color	Specifies the color to add [in]

Example

The following example creates a new palette and adds 21 colors with different shades of cyan varying by steps of 5%.

Sub Test()

Dim pal As Palette

Dim lvl As Long

Dim c As New Color

Set pal = Palettes.Create("Shades of Cyan",, True)

For lvl = 0 To 100 Step 5

c.CMYKAssign lvl, 0, 0, 0

pal.AddColor c

Next lvl

pal.Save

End Sub

 Related Topics


Palette.Close

Sub Close()

Palette

Description

The Close method closes the palette window (bar).

Example

The following example closes all palettes except for the standard palette in CorelDRAW.

Sub Test()

Dim pal As Palette

For Each pal In Palettes

If pal.Name <> "Default CMYK palette" Then pal.Close

Next pal

End Sub

 Related Topics


Palette.Colors

Function Colors() As Colors

Palette

Description

The Colors property returns the collection of all colors in a palette.

Return value

Returns Colors

Example

The following example displays the name of the default color palette and the number of colors it contains.

Sub Test()

Dim pal As Palette

Set pal = ActivePalette

MsgBox "Default palette '" & pal.Name & "' contains " & pal.Colors.Count & " color(s)"

End Sub

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(2, 2, 1)

s.Fill.ApplyUniformFill ActivePalette.Colors(15)

End Sub

 Related Topics


Palette.FindColor

Function FindColor(ByVal Name As String) As Long

Palette

Description

The FindColor method finds a color by its name. If the name is found in the color palette, it returns the index number of the color in the palette. If the color is not found, it returns Nothing (0).

Parameters	Description

Name	Specifies the name to find [in]

Return value

Returns Long

Example

The following example searches the active palette for "Red." If the color is not found, it is added to the palette.

Sub Test()

If ActivePalette.FindColor("Red") = 0 Then

ActivePalette.AddColor CreateRGBColor(255, 0, 0)

End If

End Sub

 Related Topics


Palette.GetIndexOfColor

Function GetIndexOfColor(ByVal Color As Color) As Long

Palette

Description

The GetIndexOfColor property finds the specified color in the color palette. It returns the index of the color in the palette. If the color is not found in the palette, it returns Nothing (0).

Parameters	Description

Color	Specifies a color [in]

Return value

Returns Long

Example

The following example finds the CMYK color cyan in the default palette and displays its index.

Sub Test()

Dim c As New Color

Dim idx As Long

c.CMYKAssign 100, 0, 0, 0

idx = ActivePalette.GetIndexOfColor(c)

MsgBox "Cyan color is at index " & idx

End Sub

 Related Topics


Palette.InsertColor

Sub InsertColor(ByVal Index As Long, ByVal Color As Color)

Palette

Description

The InsertColor method adds an existing color to a palette at a specified position

Parameters	Description

Index	Specifies the position of the color in the color palette [in]

Color	Represents the color to be added [in]

Example

The following example adds the registration color to the beginning of the default palette.

Sub Test()

Dim c As New Color

c.RegistrationAssign

ActivePalette.InsertColor 1, c

End Sub

 Related Topics


Palette.MatchColor

Function MatchColor(ByVal Color As Color) As Long

Palette

Description

The MatchColor method finds the closest match for the color from the given palette.

Parameters	Description

Color	Specifies the color to match [in]

Return value

Returns Long

Example

The following example creates red using the CMYK color model and then converts the color to an RGB color. The MatchColor method then finds the closest match from the active palette and displays the name of that color.

Sub TestPalette()

Dim pal As Palette

Dim cColor As Color

Dim i As Integer

Set pal = ActivePalette

Set cColor = CreateCMYKColor(0, 100, 100, 0) 'Red

cColor.ConvertToRGB

i = pal.MatchColor(cColor)

MsgBox pal.Color(i).Name

End Sub

 Related Topics


Palette.RemoveColor

Sub RemoveColor(ByVal Index As Long)

Palette

Description

The RemoveColor method removes the specified color from a color palette.

Parameters	Description

Index	Specifies the color by its index number [in]

Example

The following example duplicates the default palette and then removes all the dark colors (the colors that have a lightness less than 50%) from it.

Sub Test()

Dim c As New Color

Dim src As Palette, dest As Palette

Dim idx As Long

Set src = ActivePalette

Set dest = Palettes.Create("Bright Colors")

For Each c In src.Colors

dest.AddColor c

Next c

For idx = dest.ColorCount To 1 Step -1

c.CopyAssign dest.Color(idx)

c.ConvertToHLS

If c.HLSLightness < 128 Then dest.RemoveColor idx

Next idx

End Sub

 Related Topics


Palette.Save

Sub Save()

Palette

Description

The Save method saves changes to a color palette.

Example

The following example adds a brown color to the default palette and saves the changed palette.

Sub Test()

Dim c As New Color

c.RGBAssign 128, 0, 0

ActivePalette.InsertColor 1, c

ActivePalette.Save

End Sub

 Related Topics


Palettes properties

Palettes     Legend

    Application
    Count
  Item
    Parent


Palettes methods

Palettes     Legend

   Create
   CreateFromDocument
   CreateFromSelection
   Open
   OpenFixed


Palettes

Class Palettes

Properties     Methods     Referenced By

The Palettes class represents the collection of all open color palettes.

 Related Topics


Palettes.Application

Property Application As Object

Palettes

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Palettes.Count

Property Count As Long

Palettes

Description

The Count property returns the number of color palettes that are open.

Read-Only

Example

The following example displays the number of open color palettes.

Sub PalettesCount()

MsgBox Palettes.Count & " palettes are open."

End Sub

 Related Topics


Palettes.Item

Property Item(ByVal IndexOrName As Variant) As Palette

Palettes

Description

The Item property returns the specified Palette object from the collection.

The Item property is the default property and its reference may be omitted when accessing an item in the collection. For example, Palettes.Item(2) is the same as Palettes(2) - they both reference the second palette in the Palettes collection.

Read-Only

Parameters	Description

IndexOrName	Specifies an item by its index or name [in]

Example

The following example closes the palette that was opened first. You can also reference it using Palettes(1).Close.

Sub Test()

Palettes.Item(1).Close

End Sub

Sub Test()

Palettes("Default CMYK palette").Close

End Sub

 Related Topics


Palettes.Parent

Property Parent As Object

Palettes

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Palettes.Create

Function Create(ByVal Name As String, [ByVal FileName As String], [ByVal Overwrite As Boolean = False]) As Palette

Palettes

Description

The Create method creates a new empty custom color palette.

Parameters	Description

Name	Assigns a name to the new palette [in]

FileName	Assigns a path and filename to the palette [in]
Optional

Overwrite	If set to True, the new palette replaces the default palette. If set to False, the new palette coexists with the default palette. [in]
Optional
Default value = False

Return value

Returns Palette

Example

The following example creates a new palette and adds colors with different shades of cyan varying by steps of 5%.

Sub Test()

Dim pal As Palette

Dim lvl As Long

Dim c As New Color

Set pal = Palettes.Create("Shades of Cyan", Application.UserDataPath & _

"Palettes\CyanShades.cpl", True)

For lvl = 0 To 100 Step 5

c.CMYKAssign lvl, 0, 0, 0

pal.AddColor c

Next lvl

pal.Save

End Sub

 Related Topics


Palettes.CreateFromDocument

Function CreateFromDocument(ByVal Name As String, [ByVal FileName As String], [ByVal Overwrite As Boolean = False]) As Palette

Palettes

Description

The CreateFromDocument method creates a new custom color palette based on the colors used in the active document.

Parameters	Description

Name	Assigns a name to the new palette [in]

FileName	Assigns a path and filename to the palette [in]
Optional

Overwrite	If set to True, the new palette replaces the default palette. If set to False, the new palette coexists with the default palette. [in]
Optional
Default value = False

Return value

Returns Palette

Example

The following example displays the number of colors used in the active document.

Sub Test()

Dim pal As Palette

Set pal = Palettes.CreateFromDocument("Document Colors", _

Application.UserDataPath & "Palettes\DocColors.cpl", True)

MsgBox "The document uses " & pal.ColorCount & " colors"

pal.Close

End Sub

 Related Topics


Palettes.CreateFromSelection

Function CreateFromSelection(ByVal Name As String, [ByVal FileName As String], [ByVal Overwrite As Boolean = False]) As Palette

Palettes

Description

The CreateFromSelection method creates a new custom color palette based on the colors used in a selection of objects.

Parameters	Description

Name	Assigns a name to the new palette [in]

FileName	Assigns a path and filename to the palette [in]
Optional

Overwrite	If set to True, the new palette replaces the default palette. If set to False, the new palette coexists with the default palette. The default value is False. [in]
Optional
Default value = False

Return value

Returns Palette

Example

The following example displays the number of colors used in the selection.

Sub Test()

Dim pal As Palette

Set pal = Palettes.CreateFromSelection("Selection Colors", _

Application.UserDataPath & "Palettes\SelectionColors.cpl", True)

MsgBox "The selection uses " & pal.ColorCount & " colors"

pal.Close

End Sub

 Related Topics


Palettes.Open

Function Open(ByVal FileName As String) As Palette

Palettes

Description

The Open method opens an existing custom color palette.

Parameters	Description

FileName	Refers to the full path name (with a .cpl extension) of a color palette in CorelDRAW [in]

Return value

Returns Palette

Example

The following example opens the specified palette from file.

Sub Test()

Palettes.Open Application.SetupPath & "Custom\coreldrw.cpl"

End Sub

 Related Topics


Palettes.OpenFixed

Function OpenFixed(ByVal PaletteID As cdrPaletteID) As Palette

Palettes

Description

The OpenFixed method opens an existing fixed palette (such as Pantone, Web, and so on).

Parameters	Description

PaletteID	Specifies the numerical ID or the constant name of the fixed palette. For example, OpenFixed (7) and OpenFixed (cdrUniform) both open the Uniform Colors fixed palette in CorelDRAW. [in]

Return value

Returns Palette

Example

The following example opens the Netscape Navigator palette.

Sub Test()

Palettes.OpenFixed cdrNetscapeNavigator

End Sub

 Related Topics


PatternCanvas properties

PatternCanvas     Legend

    Data
      Height
    Index
      Pixel
      Size
      Width


PatternCanvas methods

PatternCanvas     Legend

   Clear
   CopyArea
   FillArea
   FlipArea
   Line
   PSet
   PutCopy
   RotateArea
   Select


PatternCanvas

Class PatternCanvas

Properties     Methods     Referenced By

The PatternCanvas class represents a two-color bitmap fill pattern.

You can use this object to create new patterns or modify existing ones. You can create a PatternCanvas object by using the New keyword in Visual Basic.

 Related Topics


PatternCanvas.Data

Property Data As String

PatternCanvas

Description

The Data property returns or sets the string which represents the bitmap pattern. The pattern is encoded with a special algorithm to allow the binary bitmap data to be represented in a text form.

Example

The following example creates a new checkerboard pattern that is 16x16 pixels, and applies it to a rectangle.

Sub Test()

Dim c As New PatternCanvas

c.Data = "%%['$aH,&A5&0C"

With ActiveLayer.CreateRectangle(0, 0, 3, 3)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

 Related Topics


PatternCanvas.Height

Property Height As Long

PatternCanvas

Description

The Height property returns or sets the vertical size of a pattern canvas.

Allowed values range from 1 to 256 pixels.

Example

The following example creates a small bitmap pattern that is 2x2 pixels in size. The upper left-hand and lower right-hand pixels are set to black, creating a checkerboard pattern.

Sub Test()

Dim c As New PatternCanvas

c.Width = 2

c.Height = 2

c.Clear

c.PSet (0, 0)

c.PSet (1, 1)

With ActiveLayer.CreateRectangle(0, 0, 3, 3)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

 Related Topics


PatternCanvas.Index

Property Index As Long

PatternCanvas

Description

The Index property returns the index of a pattern canvas in the list of available patterns.

This property returns 0 if the pattern is not from the PatternCanvas collection.

Read-Only

Example

The following example creates a sample tile of each available pattern fill.

Sub Test()

Dim c As PatternCanvas

Dim y As Long

For Each c In PatternCanvases

y = c.Index

With ActiveLayer.CreateRectangle(0, (y - 1) / 2, 3, y / 2)

.Fill.ApplyPatternFill cdrTwoColorPattern,, y

End With

Next c

End Sub

 Related Topics


PatternCanvas.Pixel

Property Pixel(ByVal X As Long, ByVal Y As Long) As Boolean

PatternCanvas

Description

The Pixel property returns or sets the color of a pixel in a bitmap pattern. If set to True, the pixel represents black. If set to False, the pixel represents white.

This property is equivalent to Visual Basic's PSet command for changing and reading pixel colors.

Parameters	Description

X	Specifies the horizontal position of a pixel on the pattern canvas. This value is measured in document units. [in]

Y	Specifies the vertical position for a pixel on the pattern canvas. This value is measured in document units. [in]

Example

The following example inverts an existing bitmap pattern, and applies both the inverted pattern and the original pattern to a rectangle.

Sub Test()

Dim c As New PatternCanvas

Dim x As Long, y As Long

c.PutCopy PatternCanvases(8)

For x = 0 To c.Width - 1

For y = 0 To c.Height - 1

c.Pixel(x, y) = Not c.Pixel(x, y)

Next y

Next x

With ActiveLayer.CreateRectangle(0, 0, 3, 3)

.Fill.ApplyPatternFill cdrTwoColorPattern, , 8

End With

With ActiveLayer.CreateRectangle(3, 0, 6, 3)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

 Related Topics


PatternCanvas.Size

Property Size As cdrPatternCanvasSize

PatternCanvas

Description

The Size property returns or sets one of the standard canvas sizes (16x16, 32x32, or 64x64 pixels). Any other sizes are treated as custom sizes. Instead of setting the values of the Width and Height properties, you can use the Size property to set both dimensions to one of the standard values.

The Size property returns a value of cdrPatternCanvasSize.

Example

The following example creates a new pattern canvas that is 64x64 pixels, and applies it to a rectangle.

Sub Test()

Dim c As New PatternCanvas

Dim x As Long, y As Long

c.Size = cdrPatternCanvas64x64

c.Clear

For x = 0 To c.Width - 1

For y = 0 To c.Height - 1

c.Pixel(x, y) = (((x + y) \ 2) Mod 2) <> 0

Next y

Next x

With ActiveLayer.CreateRectangle(0, 0, 2, 2)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

 Related Topics


PatternCanvas.Width

Property Width As Long

PatternCanvas

Description

The Width property returns or sets the horizontal size of a pattern canvas.

Allowed values range from 1 to 256 pixels.

Example

The following example creates a small bitmap pattern that is 2x2 pixels in size. The upper left-hand and lower right-hand pixels are set to black, creating a checkerboard pattern.

Sub Test()

Dim c As New PatternCanvas

c.Width = 2

c.Height = 2

c.Clear

c.PSet (0, 0)

c.PSet (1, 1)

With ActiveLayer.CreateRectangle(0, 0, 3, 3)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

 Related Topics


PatternCanvas.Clear

Sub Clear()

PatternCanvas

Description

The Clear method clears a pattern canvas (fills it with white).

Example

The following example creates a new pattern fill in a 64x64 bitmap and applies the fill to a newly created rectangle.

Sub Test()

Dim c As New PatternCanvas

Dim n As Long

c.Size = cdrPatternCanvas64x64

c.Clear

For n = 2 To 63 Step 2

c.Line (0, 0)-(n, n), , B

Next n

With ActiveLayer.CreateRectangle(0, 0, 2, 2)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

 Related Topics


PatternCanvas.CopyArea

Sub CopyArea(ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal X As Long, ByVal Y As Long)

PatternCanvas

Description

The CopyArea method copies an area of a pattern canvas, defined by two coordinates, and moves the area to a new location on the canvas.

Parameters	Description

x1	Specifies the horizontal coordinate for the first point that defines the area to copy on the pattern canvas. This value is measured in document units. [in]

y1	Specifies the vertical coordinatefor the first point that defines the area to copy on the pattern canvas. This value is measured in document units. [in]

x2	Specifies the horizontal coordinatefor the second point that defines the area to copy on the pattern canvas. This value is measured in document units. [in]

y2	Specifies the vertical coordinatefor the second point that defines the area to copy on the pattern canvas. This value is measured in document units. [in]

X	Specifies the horizontal position for the point on the pattern canvas that marks the new location of the copied area. This value is measured in document units. [in]

Y	Specifies the vertical position for a point on the pattern canvas that marks the new location of the copied area. This value is measured in document units. [in]

Example

The following example creates a "windmill" pattern by drawing a circle, and rotating half of the circle by 90°. It then copies the resulting pattern and rotates the copy by 180°.

Sub Test()

Dim c As New PatternCanvas

Dim a As Double, x As Long, y As Long

c.Size = cdrPatternCanvas64x64

c.Clear

DrawCircle c, 32, 16, 16, True

c.CopyArea 0, 0, 31, 31, 32, 0

c.RotateArea 32, 0, 63, 31, -90

c.CopyArea 0, 0, 63, 31, 0, 32

c.RotateArea 0, 32, 63, 63, 180

With ActiveLayer.CreateRectangle(0, 0, 2, 2)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

' ==== The following two subroutines draw a circle on a canvas

Private Sub DrawCircle(c As PatternCanvas, CenterX As Long, CenterY As Long, Radius As Long, Filled As Boolean)

Dim p As Long, x As Long, y As Long

x = 0

y = Radius

Plot c, x, y, CenterX, CenterY, Filled

p = 1 - Radius

While x < y

If p < 0 Then

x = x + 1

p = p + 2 * x + 1

Else

x = x + 1

y = y - 1

p = p + 2 * (x - y) + 1

End If

Plot c, x, y, CenterX, CenterY, Filled

Wend

End Sub

Private Sub Plot(c As PatternCanvas, x As Long, y As Long, cx As Long, cy As Long, Filled As Boolean)

If Filled Then

c.Line (cx + x, cy + y)-(cx - x, cy + y)

c.Line (cx + x, cy - y)-(cx - x, cy - y)

c.Line (cx + y, cy + x)-(cx - y, cy + x)

c.Line (cx + y, cy - x)-(cx - y, cy - x)

Else

c.PSet (cx + x, cy + y)

c.PSet (cx - x, cy + y)

c.PSet (cx + x, cy - y)

c.PSet (cx - x, cy - y)

c.PSet (cx + y, cy + x)

c.PSet (cx - y, cy + x)

c.PSet (cx + y, cy - x)

c.PSet (cx - y, cy - x)

End If

End Sub

 Related Topics


PatternCanvas.FillArea

Sub FillArea(ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, [ByVal State As Boolean = True])

PatternCanvas

Description

The FillArea method fills a rectangular area of a pattern canvas with black or white pixels.

See also the Line method.

Parameters	Description

x1	Specifies the horizontal coordinate for the first point that defines the area to fill on the pattern canvas. This value is measured in document units. [in]

y1	Specifies the vertical coordinatefor the first point that defines the area to fill on the pattern canvas. This value is measured in document units. [in]

x2	Specifies the horizontal coordinatefor the second point that defines the area to fill on the pattern canvas. This value is measured in document units. [in]

y2	Specifies the vertical coordinatefor the second point that defines the area to fill on the pattern canvas. This value is measured in document units. [in]

State	Determines whether the filled area is returned to its original state after the fill is removed on the pattern canvas. If the value is True, the area is returned to its original state [in]
Optional
Default value = True

Example

The following example creates a pattern of two overlapping, filled rectangles with an unfilled area at their intersection.

Sub Test()

Dim c As New PatternCanvas

c.Size = cdrPatternCanvas32x32

c.FillArea 0, 0, 31, 31, True

c.FillArea 0, 0, 18, 18, False

c.FillArea 14, 14, 31, 31, False

c.FillArea 14, 14, 18, 18, True

With ActiveLayer.CreateRectangle(0, 0, 2, 2)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

 Related Topics


PatternCanvas.FlipArea

Sub FlipArea(ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal Axes As cdrFlipAxes)

PatternCanvas

Description

The FlipArea method repositions an area of a pattern canvas, defined by two coordinates. You can flip the area horizontally, vertically, or both.

Parameters	Description

x1	Specifies the horizontal coordinate for the first point that defines the area to flip on the pattern canvas. This value is measured in document units. [in]

y1	Specifies the vertical coordinatefor the first point that defines the area to flip on the pattern canvas. This value is measured in document units. [in]

x2	Specifies the horizontal coordinatefor the second point that defines the area to flip on the pattern canvas. This value is measured in document units. [in]

y2	Specifies the vertical coordinatefor the second point that defines the area to flip on the pattern canvas. This value is measured in document units. [in]

Axes	Specifies how the area of the pattern canvas is flipped. An area can be flipped horizontally, vertically, or both. [in]

Example

The following example creates a pattern that uses the Mandelbrot set. The set is built only in the upper half of the complex plane, while the other half is a flipped duplicate.

Sub Test()

Dim c As New PatternCanvas

Dim nx As Long, ny As Long

Dim cx As Double, cy As Double

Dim zx As Double, zy As Double, zz As Double

Dim n As Long

c.Height = 256

c.Width = 256

For nx = 0 To 255

cx = nx / 100 - 2

For ny = 0 To 127

cy = 1.27 - ny / 100

zx = 0: zy = 0: n = 0

While n < 10 And zx * zx + zy * zx < 4

zz = zx * zx - zy * zy + cx

zy = 2 * zx * zy + cy

zx = zz

n = n + 1

Wend

c.PSet (nx, ny), (n < 10)

Next ny

Next nx

c.CopyArea 0, 0, 255, 127, 0, 128

' Since the axes are mixed up,

' as a workaround, the following

' command should be called with

' cdrFlipVertical as the last parameter:

c.FlipArea 0, 128, 255, 255, cdrFlipHorizontal

With ActiveLayer.CreateRectangle(0, 0, 2, 2)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

 Related Topics


PatternCanvas.Line

Sub Line(ByVal Flags As Integer, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal Color As Boolean)

PatternCanvas

Description

The Line method draws a line, or a rectangle that is either filled or unfilled.

See also the Visual Basic Help for detailed descriptions of parameters for this function.

See also the FillArea method.

Parameters	Description

Flags	(in) [in]

x1	Specifies the horizontal coordinate for the starting point of the new line on the canvas. This value is measured in document units. [in]

y1	Specifies the vertical coordinate for the starting point of the new line on the canvas. This value is measured in document units. [in]

x2	Specifies the horizontal coordinate for the ending point of the new line on the canvas. This value is measured in document units. [in]

y2	Specifies the vertical coordinate for the ending point of the new line on the canvas. This value is measured in document units. [in]

Color	Determines whether the new line has a color applied to it on the pattern canvas. If this value is set to True, the selected color in the active color palette is applied to the new line. [in]

Example

The following example creates a pattern consisting of a diagonal line, an unfilled rectangle, and two pixels in the upper right-hand and lower left-hand corners of the canvas.

Sub Test()

Dim c As New PatternCanvas

c.Size = cdrPatternCanvas32x32

c.Clear

c.Line (0, 0)-(31, 31)

c.Line (5, 5)-(27, 27), , B

c.PSet (30, 2)

c.PSet (2, 30)

With ActiveLayer.CreateRectangle(0, 0, 2, 2)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

 Related Topics


PatternCanvas.PSet

Sub PSet(ByVal Step As Integer, ByVal X As Long, ByVal Y As Long, ByVal Color As Boolean)

PatternCanvas

Description

The PSet method sets a pixel of a given color at a specified coordinate on a pattern canvas. If set to True, the pixel represents white. If set to False, the pixel represents black.

See also the Visual Basic Help for detailed descriptions of parameters for this function.

See also the Pixel property.

Parameters	Description

Step	Identifies the number of bands (steps) [in]

X	Specifies the horizontal position for a point on the pattern canvas. This value is measured in document units. [in]

Y	Specifies the vertical position for a point on the pattern canvas. This value is measured in document units. [in]

Color	Indicates whether the pixel has a color applied to it on the pattern canvas. If this value is set to True, the selected color in the active color palette is applied to the pixel. [in]

Example

The following example creates a pattern consisting of a diagonal line, an unfilled rectangle, and two pixels in the upper right-hand and lower left-hand corners of the canvas.

Sub Test()

Dim c As New PatternCanvas

c.Size = cdrPatternCanvas32x32

c.Clear

c.Line (0, 0)-(31, 31)

c.Line (5, 5)-(27, 27), , B

c.PSet (30, 2)

c.PSet (2, 30)

With ActiveLayer.CreateRectangle(0, 0, 2, 2)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

 Related Topics


PatternCanvas.PutCopy

Sub PutCopy(ByVal PatternCanvas As PatternCanvas)

PatternCanvas

Description

The PutCopy method places the content of one pattern canvas into the active pattern canvas.

Parameters	Description

PatternCanvas	Specifies the pattern canvas to be copied [in]

Example

The following example creates a new pattern based on the first available fill pattern in the PatternCanvases collection. The new pattern contains a small white rectangle at its center.

Sub Test()

Dim c As New PatternCanvas

Dim x As Long, y As Long

c.PutCopy PatternCanvases(1)

x = c.Width / 2

y = c.Height / 2

c.FillArea x - 10, y - 10, x + 10, y + 10, True

With ActiveLayer.CreateRectangle(0, 0, 2, 2)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

 Related Topics


PatternCanvas.RotateArea

Sub RotateArea(ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal Angle As Double)

PatternCanvas

Description

The RotateArea method rotates an area, defined by two coordinates,. of a pattern canvas. The rotation is measured in degrees. Currently, only integer angle values divisible by 90 can be used (for example, 0, 90, 180, and 270).

Parameters	Description

x1	Specifies the horizontal coordinate for the first point that defines the area to rotate on the pattern canvas. This value is measured in document units. [in]

y1	Specifies the vertical coordinatefor the first point that defines the area to rotate on the pattern canvas. This value is measured in document units. [in]

x2	Specifies the horizontal coordinatefor the second point that defines the area to rotate on the pattern canvas. This value is measured in document units. [in]

y2	Specifies the vertical coordinatefor the second point that defines the area to rotate on the pattern canvas. This value is measured in document units. [in]

Angle	Specifies the angle, measured in degrees, that the pattern canvas area is rotated. [in]

Example

The following example creates a new fill by rotating the default brick pattern by 90 degrees.

Sub Test()

Dim c As New PatternCanvas

c.PutCopy PatternCanvases(4)

c.RotateArea 0, 0, c.Width - 1, c.Height - 1, 90

With ActiveLayer.CreateRectangle(0, 0, 2, 2)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

 Related Topics


PatternCanvas.Select

Sub Select(ByVal Index As Long)

PatternCanvas

Description

The Select method chooses a specific pattern canvas from the PatternCanvases collection, the list of available two color fill patterns.

Parameters	Description

Index	Uniquely identifies a pattern canvas in the PatternCanvases collection of CorelDRAW [in]

Example

The following example selects the next pattern fill for each object with a two-color pattern fill.

Sub Test()

Dim s As Shape

Dim c As PatternCanvas

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrPatternFill Then

If s.Fill.Pattern.Type = cdrTwoColorPattern Then

If s.Fill.Pattern.Canvas.Index <> PatternCanvases.Count Then

Set c = New PatternCanvas

c.Select s.Fill.Pattern.Canvas.Index + 1

s.Fill.Pattern.Canvas = c

End If

End If

End If

Next s

End Sub

 Related Topics


PatternCanvases properties

PatternCanvases     Legend

    Count
    Item


PatternCanvases methods

PatternCanvases     Legend

   Add
   Remove


PatternCanvases

Class PatternCanvases

Properties     Methods     Referenced By

The PatternCanvases class represents a colleciton of all available two-color fill patterns.

 Related Topics


PatternCanvases.Count

Property Count As Long

PatternCanvases

Description

The Count property returns the number of pattern canvases available in the PatternCanvases collection.

Read-Only

Example

The following example creates a sample tile of each available two-color pattern fill.

Sub Test()

Const cx As Long = 8

Const cy As Long = 10

Dim i As Long

Dim nx As Long, ny As Long

Dim x As Double, y As Double

Dim sx As Double, sy As Double

Dim s As Shape

sx = ActivePage.SizeWidth / cx

sy = ActivePage.SizeHeight / cy

nx = 0

ny = 0

For i = 1 To PatternCanvases.Count

x = nx * sx

y = ny * sy

Set s = ActiveLayer.CreateRectangle2(x, y, sx, sy)

s.Fill.ApplyPatternFill cdrTwoColorPattern, , i

nx = nx + 1

If nx >= cx Then

nx = 0

ny = ny + 1

End If

Next i

End Sub

 Related Topics


PatternCanvases.Item

Property Item(ByVal Index As Long) As PatternCanvas

PatternCanvases

Description

The Item property returns or sets a reference to a specified pattern canvas in the PatternCanvases collection

The Item property is the default property and its reference may be omitted when accessing an items in the collection. For example, PatternCanvases.Item(2) is the same as PatternCanvases(2) - they both reference the second pattern canvas in the collection.

Parameters	Description

Index	Uniquely identifies each pattern canvas within the PatternCanvases collection [in]

Example

The following example creates a rectangle and fills it with the "Maple leaf" pattern turned upside down.

Sub Test()

Dim c As New PatternCanvas

c.PutCopy PatternCanvases(25)

c.RotateArea 0, 0, c.Width - 1, c.Height - 1, 180

With ActiveLayer.CreateRectangle(0, 0, 3, 3)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

 Related Topics


PatternCanvases.Add

Function Add(ByVal PatternCanvas As PatternCanvas) As Long

PatternCanvases

Description

The Add method adds a two-color fill pattern to the PatternCanvases collection. The additional pattern is added to the 2-color list box in the Pattern Fill dialog box.

Parameters	Description

PatternCanvas	Specifies the pattern canvas to add to the PatternCanvases collection  [in]

Return value

Returns Long

Example

The following example creates a pattern on a new 64x64 bitmap and adds it to the list of available two-color fills. It then applies the fill pattern to a newly created rectangle.

You can apply a pattern canvas without adding it to the PatternCanvases collection. See also the example for the Item property.

Sub Test()

Dim c As New PatternCanvas

Dim n As Long

c.Size = cdrPatternCanvas64x64

c.Clear

For n = 2 To 63 Step 2

c.Line (0, 0)-(n, n), , B

Next n

On Error Resume Next ' The code in green is a workaround.

n = PatternCanvases.Add(c)

If Err.Number Then n = PatternCanvases.Add(c)

On Error GoTo 0

With ActiveLayer.CreateRectangle(0, 0, 3, 3)

.Fill.ApplyPatternFill cdrTwoColorPattern, , n

End With

End Sub

 Related Topics


PatternCanvases.Remove

Sub Remove(ByVal Index As Long)

PatternCanvases

Description

The Remove method removes a pattern from the PatternCanvases collection.

Parameters	Description

Index	Uniquely identifies each pattern canvas within the PatternCanvases collection [in]

Example

The following example removes the last available two-color pattern.

Sub Test()

PatternCanvases.Remove PatternCanvases.Count

End Sub

 Related Topics


PatternFill properties

PatternFill     Legend

      BackColor
      Canvas
    FilePath
      FrontColor
      MirrorFill
      OriginX
      OriginY
      RotationAngle
      SkewAngle
      TileHeight
      TileOffset
      TileOffsetType
      TileWidth
      TransformWithShape
      Type


PatternFill methods

PatternFill     Legend

   Load


PatternFill

Class PatternFill

Properties     Methods     Referenced By

The PatternFill class represents any of the three types of pattern fills: two-color bitmap (two-color), full-color bitmap (full-color), and vector patterns (vector).

 Related Topics


PatternFill.BackColor

Property BackColor As Color

PatternFill

Description

The BackColor property returns or sets the background color in a two-color bitmap pattern fill.

Example

The following example creates a rectangle, applies a two-color bitmap pattern to it, and changes the background color to red.

Sub Test()

Dim s As Shape

Dim pf As PatternFill

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

Set pf = s.Fill.ApplyPatternFill(cdrTwoColorPattern, , 6)

pf.BackColor.RGBAssign 255, 0, 0

End Sub

 Related Topics


PatternFill.Canvas

Property Canvas As PatternCanvas

PatternFill

Description

The Canvas property returns a PatternCanvas object which manipulates two-color bitmap patterns.

Example

The following example creates a new 16x16 checkerboard pattern and applies it to a rectangle.

Sub Test()

Dim c As New PatternCanvas

c.Data = "%%['$aH,&A5&0C"

With ActiveLayer.CreateRectangle(0, 0, 3, 3)

.Fill.ApplyPatternFill cdrTwoColorPattern

.Fill.Pattern.Canvas = c

End With

End Sub

 Related Topics


PatternFill.FilePath

Property FilePath As String

PatternFill

Description

The FilePath property returns the full file path of the vector pattern file used in the pattern.

Read-Only

Example

The following example displays the file path of the full-color pattern of the selected shape.

Sub Test()

Dim pf As PatternFill

If ActiveShape.Fill.Type <> cdrPatternFill Then

MsgBox "Select an object with a pattern fill"

Exit Sub

End If

Set pf = ActiveShape.Fill.Pattern

If pf.Type <> cdrFullColorPattern Then

MsgBox "Select an object with a full color pattern fill"

Exit Sub

End If

MsgBox pf.FilePath

End Sub

 Related Topics


PatternFill.FrontColor

Property FrontColor As Color

PatternFill

Description

The FrontColor property returns or sets the foreground color in a two-color bitmap pattern fill.

Example

The following example creates a rectangle, applies a two-color bitmap pattern to it, and changes the foreground color to red.

Sub Test()

Dim s As Shape

Dim pf As PatternFill

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

Set pf = s.Fill.ApplyPatternFill(cdrTwoColorPattern, , 6)

pf.FrontColor.RGBAssign 255, 0, 0

End Sub

 Related Topics


PatternFill.MirrorFill

Property MirrorFill As Boolean

PatternFill

Description

The MirrorFill property returns or sets whether to mirror pattern tiles in a pattern fill.

Example

The following example applies a full-color bitmap pattern to a rectangle, and flips the pattern tiles to create a seamless pattern fill.

Sub Test()

Dim s As Shape

Dim pf As PatternFill

Dim FileName As String

FileName = Application.SetupPath & "Custom\Patterns\drwx0835.pat"

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPatternFill(cdrFullColorPattern, FileName)

pf.MirrorFill = True

End Sub

 Related Topics


PatternFill.OriginX

Property OriginX As Double

PatternFill

Description

The OriginX property returns or sets the horizontal coordinate of the point of origin for a pattern.

The OriginX property is measured in document units.

Example

The following example applies a full-color pattern to a rectangle and offsets the first tile by 1" to the right and 1.5" upwards, relative to the lower left corner of the rectangle.

Sub Test()

Dim s As Shape

Dim pf As PatternFill

Dim FileName As String

FileName = Application.SetupPath & "Custom\Patterns\drwx0835.pat"

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPatternFill(cdrFullColorPattern, FileName)

pf.OriginX = 1

pf.OriginY = 1.5

End Sub

 Related Topics


PatternFill.OriginY

Property OriginY As Double

PatternFill

Description

The OriginY property returns or sets the vertical coordinate of the point of origin for a pattern.

The OriginY property is measured in document units.

Example

The following example applies a full-color pattern to a rectangle and offsets the first tile by 1" to the right and 1.5" upwards, relative to the lower left corner of the rectangle.

Sub Test()

Dim s As Shape

Dim pf As PatternFill

Dim FileName As String

FileName = Application.SetupPath & "Custom\Patterns\drwx0835.pat"

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPatternFill(cdrFullColorPattern, FileName)

pf.OriginX = 1

pf.OriginY = 1.5

End Sub

 Related Topics


PatternFill.RotationAngle

Property RotationAngle As Double

PatternFill

Description

The RotationAngle property returns or sets the rotation angle of a pattern fill.

Example

The following example applies a brick fill pattern to a rectangle. The pattern is rotated by 30 degrees counterclockwise and slanted by 10 degrees to the left.

Sub Test()

Dim s As Shape

Dim pf As PatternFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPatternFill(cdrTwoColorPattern, , 4)

pf.RotationAngle = 30

pf.SkewAngle = 10

End Sub

 Related Topics


PatternFill.SkewAngle

Property SkewAngle As Double

PatternFill

Description

The SkewAngle property returns or sets the degree of slant of a pattern fill.

Example

The following example applies a brick fill pattern to a rectangle. The pattern is rotated by 30° counterclockwise and slanted by 10° to the left.

Sub Test()

Dim s As Shape

Dim pf As PatternFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPatternFill(cdrTwoColorPattern, , 4)

pf.RotationAngle = 30

pf.SkewAngle = 10

End Sub

 Related Topics


PatternFill.TileHeight

Property TileHeight As Double

PatternFill

Description

The TileHeight property returns or sets the vertical size of a pattern tile, measured in document units.

Example

The following example applies a two-color bitmap pattern to a tile that is 3" wide and 1" high.

Sub Test()

Dim s As Shape

Dim pf As PatternFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPatternFill(cdrTwoColorPattern, , 8)

pf.TileWidth = 3

pf.TileHeight = 1

End Sub

 Related Topics


PatternFill.TileOffset

Property TileOffset As Long

PatternFill

Description

The TileOffset property returns or sets the offset of pattern tiles in a pattern fill. The value is a percentage of the actual tile size in the pattern fill.

You can use the TileOffsetType property to set the type of offset. A pattern may be offset by row or by column.

Example

The following example applies a two-color bitmap pattern to a rectangle and offsets rows by 50% relative to each other.

Sub Test()

Dim s As Shape

Dim pf As PatternFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPatternFill(cdrTwoColorPattern, , 8)

pf.TileWidth = 1

pf.TileHeight = 1

pf.TileOffsetType = cdrTileOffsetRow

pf.TileOffset = 50

End Sub

 Related Topics


PatternFill.TileOffsetType

Property TileOffsetType As cdrTileOffsetType

PatternFill

Description

The TileOffsetType property returns or sets the type of offset for a tile in a pattern fill. A pattern may be offset by row or by column. The TileOffsetType property returns a value of cdrTileOffsetType.

You can use the TileOffset property to set the offset.

Example

The following example applies a two-color bitmap pattern to a rectangle and offsets rows by 50% relative to each other.

Sub Test()

Dim s As Shape

Dim pf As PatternFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPatternFill(cdrTwoColorPattern, , 8)

pf.TileWidth = 1

pf.TileHeight = 1

pf.TileOffsetType = cdrTileOffsetRow

pf.TileOffset = 50

End Sub

 Related Topics


PatternFill.TileWidth

Property TileWidth As Double

PatternFill

Description

The TileWidth property returns or sets the horizontal size of a pattern tile, measured in document units.

Example

The following example applies a two-color bitmap pattern to a tile that is 3" wide and 1" high.

Sub Test()

Dim s As Shape

Dim pf As PatternFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPatternFill(cdrTwoColorPattern, , 8)

pf.TileWidth = 3

pf.TileHeight = 1

End Sub

 Related Topics


PatternFill.TransformWithShape

Property TransformWithShape As Boolean

PatternFill

Description

The TransformWithShape property returns or sets whether the pattern fill is transformed (stretched/rotated/skewed) along with its parent shape.

Example

The following example applies a pattern fill to a rectangle and specifies that the fill will be transformed when the shape object is altered. The shape is then duplicated and stretched by 200%.

Sub Test()

Dim s As Shape

Dim pf As PatternFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPatternFill(cdrTwoColorPattern, , 8)

pf.TransformWithShape = True

Set s = s.Duplicate(4, 0)

s.StretchEx 2, , 4, 0

End Sub

 Related Topics


PatternFill.Type

Property Type As cdrPatternFillType

PatternFill

Description

The Type property returns or sets the type of pattern fill (two-color bitmap, full-color bitmap, or vector).

The Type property returns a value of cdrPatternFillType.

Example

The following example changes all colors in two-color pattern fills to grayscale.

Sub Test()

Dim s As Shape

Dim pf As PatternFill

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrPatternFill Then

Set pf = s.Fill.Pattern

If pf.Type = cdrTwoColorPattern Then

pf.BackColor.ConvertToGray

pf.FrontColor.ConvertToGray

End If

End If

Next s

End Sub

 Related Topics


PatternFill.Load

Function Load(ByVal FileName As String) As Boolean

PatternFill

Description

The Load method imports a bitmap or vector pattern to use as a pattern fill.

Parameters	Description

FileName	Specifies the full path and filename of the graphic that is imported [in]

Return value

Returns Boolean

Example

The following example applies a two-color pattern fill and then loads a pattern from a file.

Sub Test()

Dim s As Shape

Dim pf As PatternFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPatternFill(cdrTwoColorPattern)

pf.Load SetupPath & "Custom\Bumpmap\Stlplate.cpt"

End Sub

 Related Topics


PDFVBASettings properties

PDFVBASettings     Legend

      Author
      BitmapCompression
      Bleed
      Bookmarks
      ColorMode
      ColorProfile
      ColorResolution
      ComplexFillsAsBitmaps
      CompressText
      CropMarks
      DensitometerScales
      DownsampleColor
      DownsampleGray
      DownsampleMono
      EmbedBaseFonts
      EmbedFonts
      EPSAs
      FileInformation
      FountainSteps
    GetEmbedFile
    GetEmbedFilename
    GetEncoding
      GrayResolution
      Halftones
      Hyperlinks
      IncludeBleed
      JPEGQualityFactor
      Keywords
      Linearize
      MaintainOPILinks
      MonoResolution
      Overprints
      PageRange
      pdfVersion
      PublishRange
      RegistrationMarks
      SetEmbedFile
      SetEmbedFilename
      SetEncoding
      SpotColors
      Startup
      Subject
      SubsetFonts
      SubsetPct
      TextAsCurves
      Thumbnails
      TrueTypeToType1
      UseColorProfile


PDFVBASettings methods

PDFVBASettings     Legend

   Load
   Reset
   Save
   ShowDialog


PDFVBASettings

Class PDFVBASettings

Properties     Methods     Referenced By

The PDFVBASettings class represents all the options used when publishing a document to PDF.

 Related Topics


PDFVBASettings.Author

Property Author As String

PDFVBASettings

Description

The Author property sets or returns the author of a PDF.

Example

The following example publishes the active document to PDF, and specifies the file's author, subject, and keywords.

Sub Test()

With ActiveDocument.PDFSettings

.Author = "Graphix Design, Inc"

.Keywords = "Animals, Farm, Bulls"

.Subject = "Animal Farms"

End With

ActiveDocument.PublishToPDF "C:\MyFarm.pdf"

End Sub

 Related Topics


PDFVBASettings.BitmapCompression

Property BitmapCompression As pdfBitmapCompressionType

PDFVBASettings

Description

The BitmapCompression property sets the compression algorithm for bitmaps.

Example

The following example publishes the active document to PDF using JPEG bitmap compression with a compression factor of 30.

Sub Test()

With ActiveDocument.PDFSettings

.BitmapCompression = pdfJPEG

.JPEGQualityFactor = 30

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.Bleed

Property Bleed As Integer

PDFVBASettings

Description

The Bleed property sets the bleed value, measured in tenths of a micron. In order to include a bleed for a document, the IncludeBleed property must be set to True.

Example

The following example creates a 1" bleed area around the page and then publishes the active document to PDF.

Sub Test()

With ActiveDocument.PDFSettings

.IncludeBleed = True

.Bleed = CorelScriptTools.FromInches(1)

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.Bookmarks

Property Bookmarks As Boolean

PDFVBASettings

Description

The Bookmarks property determines whether to include bookmarks in the PDF.

Example

The following example publishes the active document to PDF. The resulting document includes bookmarks, hyperlinks, and thumbnails.

Sub Test()

With ActiveDocument.PDFSettings

.Bookmarks = True

.Hyperlinks = True

.Thumbnails = True

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.ColorMode

Property ColorMode As pdfColorMode

PDFVBASettings

Description

The ColorMode property sets the color mode for objects when published to PDF.

Example

The following example publishes the active document to PDF. All objects are exported using the RGB color model, and the color profile of the composite printer is applied.

Sub Test()

With ActiveDocument.PDFSettings

.ColorMode = pdfRGB

.UseColorProfile = True

.ColorProfile = pdfCompositeProfile

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.ColorProfile

Property ColorProfile As pdfColorProfile

PDFVBASettings

Description

The ColorProfile property sets the color profile when publishing to PDF. In order to apply a color profile, the UseColorProfile property must be set to True.

Example

The following example publishes the active document to PDF. All objects are exported using the RGB color model, and the color profile of the composite printer is applied.

Sub Test()

With ActiveDocument.PDFSettings

.ColorMode = pdfRGB

.UseColorProfile = True

.ColorProfile = pdfCompositeProfile

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.ColorResolution

Property ColorResolution As Long

PDFVBASettings

Description

The ColorResolution property sets the resolution for downsampled color bitmaps when publishing to PDF. In order to apply the resolution, the DownsampleColor option must be set to True.

Example

The following example publishes the active document to PDF. Color and grayscale bitmaps are downsampled to 72 dpi, and monochrome bitmaps are downsampled to 150 dpi.

Sub Test()

With ActiveDocument.PDFSettings

.DownsampleColor = True

.DownsampleGray = True

.DownsampleMono = True

.ColorResolution = 72

.GrayResolution = 72

.MonoResolution = 150

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.ComplexFillsAsBitmaps

Property ComplexFillsAsBitmaps As Boolean

PDFVBASettings

Description

The ComplexFillsAsBitmaps property determines whether comples fills are rendered as bitmaps when publishing to PDF.

Example

The following example sets options for publishing the active document to PDF. Complex fills are rendered as bitmaps; halftone screens and overprints are included, while OPI links and spot colors are not maintained.

Sub Test()

With ActiveDocument.PDFSettings

.ComplexFillsAsBitmaps = True

.Halftones = True

.MaintainOPILinks = False

.Overprints = True

.SpotColors = False

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.CompressText

Property CompressText As Boolean

PDFVBASettings

Description

The CompressText property determines whether to compress text and line art when publishing to PDF.

Example

The following example compresses text and line art when publishing the active document to PDF.

Sub Test()

With ActiveDocument

.PDFSettings.CompressText = True

.PublishToPDF "C:\MyDocument.pdf"

End With

End Sub

 Related Topics


PDFVBASettings.CropMarks

Property CropMarks As Boolean

PDFVBASettings

Description

The CropMarks property determines whether crop marks are included in the final document when publishing to PDF.

Example

The following example publishes the document to PDF. Crop marks, densitometer scales, file information, and color registration marks are included in the PDF.

Sub Test()

With ActiveDocument.PDFSettings

.CropMarks = True

.DensitometerScales = True

.FileInformation = True

.RegistrationMarks = True

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.DensitometerScales

Property DensitometerScales As Boolean

PDFVBASettings

Description

The DensitometerScales property determines whether densitometer scales are included in the final document when publishing to PDF.

Example

The following example publishes the document to PDF. Crop marks, densitometer scales, file information, and color registration marks are included in the PDF.

Sub Test()

With ActiveDocument.PDFSettings

.CropMarks = True

.DensitometerScales = True

.FileInformation = True

.RegistrationMarks = True

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.DownsampleColor

Property DownsampleColor As Boolean

PDFVBASettings

Description

The DownsampleColor property determines whether color bitmaps are downsampled for publishing to PDF. You can use the ColorResolution property to set the resolution.

Example

The following example publishes the active document to PDF. Color and grayscale bitmaps are downsampled to 72 dpi, and monochrome bitmaps are downsampled to 150 dpi.

Sub Test()

With ActiveDocument.PDFSettings

.DownsampleColor = True

.DownsampleGray = True

.DownsampleMono = True

.ColorResolution = 72

.GrayResolution = 72

.MonoResolution = 150

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.DownsampleGray

Property DownsampleGray As Boolean

PDFVBASettings

Description

The DownsampleGray property determines whether gray bitmaps are downsampled for publishing to PDF. You can use the GrayResolution property to set the resolution.

Example

The following example publishes the active document to PDF. Color and grayscale bitmaps are downsampled to 72 dpi, and monochrome bitmaps are downsampled to 150 dpi.

Sub Test()

With ActiveDocument.PDFSettings

.DownsampleColor = True

.DownsampleGray = True

.DownsampleMono = True

.ColorResolution = 72

.GrayResolution = 72

.MonoResolution = 150

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.DownsampleMono

Property DownsampleMono As Boolean

PDFVBASettings

Description

The DownsampleMono property determines whether monochrome bitmaps are downsampled for publishing to PDF. You can use the MonoResolution property to set the resolution.

Example

The following example publishes the active document to PDF. Color and grayscale bitmaps are downsampled to 72 dpi, and monochrome bitmaps are downsampled to 150 dpi.

Sub Test()

With ActiveDocument.PDFSettings

.DownsampleColor = True

.DownsampleGray = True

.DownsampleMono = True

.ColorResolution = 72

.GrayResolution = 72

.MonoResolution = 150

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.EmbedBaseFonts

Property EmbedBaseFonts As Boolean

PDFVBASettings

Description

The EmbedBaseFonts property determines whether the base 14 fonts are embedded in the document when publishing to PDF.

Example

The following example publishes the document to PDF. All the document's fonts are converted to Type 1 and embedded in the PDF file along with the base 14 fonts. Fonts are subset if less than 80% of their character set is used.

Sub Test()

With ActiveDocument.PDFSettings

.EmbedBaseFonts = True

.EmbedFonts = True

.SubsetFonts = True

.SubsetPct = 80

.TextAsCurves = False

.TrueTypeToType1 = True

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.EmbedFonts

Property EmbedFonts As Boolean

PDFVBASettings

Description

The EmbedFonts property determines whether fonts are embedded in the document when publishing to PDF.

Example

The following example publishes the document to PDF. All the document's fonts are converted to Type 1 and embedded in the PDF file along with the base 14 fonts. Fonts are subset if less than 80% of their character set is used.

Sub Test()

With ActiveDocument.PDFSettings

.EmbedBaseFonts = True

.EmbedFonts = True

.SubsetFonts = True

.SubsetPct = 80

.TextAsCurves = False

.TrueTypeToType1 = True

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.EPSAs

Property EPSAs As pdfEPSAs

PDFVBASettings

Description

The EPSAs property determines how embedded EPS files are published to PDF.

Example

The following example publishes the document to PDF and specifies that only previews of EPS art are published.

Sub Test()

ActiveDocument.PDFSettings.EPSAs = pdfPreview

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.FileInformation

Property FileInformation As Boolean

PDFVBASettings

Description

The FileInformation property determines whether file information is included in the final document when publishing to PDF.

Example

The following example publishes the document to PDF. Crop marks, densitometer scales, file information, and color registration marks are included in the PDF.

Sub Test()

With ActiveDocument.PDFSettings

.CropMarks = True

.DensitometerScales = True

.FileInformation = True

.RegistrationMarks = True

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.FountainSteps

Property FountainSteps As Long

PDFVBASettings

Description

The FountainSteps property sets the number of steps to use when banding fountain fills.

Example

The following example publishes the active document to PDF and applies 100 steps to fountain fills.

Sub Test()

ActiveDocument.PDFSettings.FountainSteps = 100

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.GetEmbedFile

Property GetEmbedFile As Boolean

PDFVBASettings

Description

The GetEmbedFile property returns whether external files are embedded when publishing to PDF.

Read-Only

 Related Topics


PDFVBASettings.GetEmbedFilename

Property GetEmbedFilename As String

PDFVBASettings

Description

The GetEmbedFilename property returns the full path and name of the external files that are embedded when publishing to PDF.

Read-Only

 Related Topics


PDFVBASettings.GetEncoding

Property GetEncoding As pdfEncodingType

PDFVBASettings

Description

The GetEncoding property returns the data encoding to be used when publishing to PDF.

Read-Only

 Related Topics


PDFVBASettings.GrayResolution

Property GrayResolution As Long

PDFVBASettings

Description

The GrayResolution property sets the resolution for downsampled grayscale bitmaps when publishing to PDF. In order to apply the resolution, the DownsampleGray option must be set to True.

Example

The following example publishes the active document to PDF. Color and grayscale bitmaps are downsampled to 72 dpi, and monochrome bitmaps are downsampled to 150 dpi.

Sub Test()

With ActiveDocument.PDFSettings

.DownsampleColor = True

.DownsampleGray = True

.DownsampleMono = True

.ColorResolution = 72

.GrayResolution = 72

.MonoResolution = 150

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.Halftones

Property Halftones As Boolean

PDFVBASettings

Description

The Halftones property determines whether the halftone screen information is preserved when publishing to PDF.

Example

The following example sets options for publishing the active document to PDF. Complex fills are rendered as bitmaps; halftone screens and overprints are included, while OPI links and spot colors are not maintained.

Sub Test()

With ActiveDocument.PDFSettings

.ComplexFillsAsBitmaps = True

.Halftones = True

.MaintainOPILinks = False

.Overprints = True

.SpotColors = False

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.Hyperlinks

Property Hyperlinks As Boolean

PDFVBASettings

Description

The Hyperlinks property determines whether hyperlinks are included when publishing to PDF.

Example

The following example publishes the active document to PDF. The resulting document includes bookmarks, hyperlinks, and thumbnails.

Sub Test()

With ActiveDocument.PDFSettings

.Bookmarks = True

.Hyperlinks = True

.Thumbnails = True

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.IncludeBleed

Property IncludeBleed As Boolean

PDFVBASettings

Description

The IncludeBleed property determines whether a bleed is included when publishing to PDF.

The Bleed property sets the bleed value, measured in tenths of a micron.

Example

The following example creates a 1" bleed area around the page and then publishes the active document to PDF.

Sub Test()

With ActiveDocument.PDFSettings

.IncludeBleed = True

.Bleed = CorelScriptTools.FromInches(1)

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.JPEGQualityFactor

Property JPEGQualityFactor As Integer

PDFVBASettings

Description

The JPEGQualityFactor sets the compression rate when compressing bitmaps with the JPEG algorithm.

Example

The following example publishes the active document to PDF using JPEG bitmap compression with a compression factor of 30.

Sub Test()

With ActiveDocument.PDFSettings

.BitmapCompression = pdfJPEG

.JPEGQualityFactor = 30

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.Keywords

Property Keywords As String

PDFVBASettings

Description

The Keywords property associates keywords with a PDF.

Example

The following example publishes the active document to PDF, and specifies the file's author, subject, and keywords.

Sub Test()

With ActiveDocument.PDFSettings

.Author = "Graphix Design, Inc"

.Keywords = "Animals, Farm, Bulls"

.Subject = "Animal Farms"

End With

ActiveDocument.PublishToPDF "C:\MyFarm.pdf"

End Sub

 Related Topics


PDFVBASettings.Linearize

Property Linearize As Boolean

PDFVBASettings

Description

The Linearize property determines whether the PDF should be optimized for the Web.

Example

The following example optimizes the active document for the Web and publishes it to PDF.

Sub Test()

ActiveDocument.PDFSettings.Linearize = True

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.MaintainOPILinks

Property MaintainOPILinks As Boolean

PDFVBASettings

Description

The MaintainOPILinks property determines whether low-resolution images are subsittued for high-resolution iamges when publishing to PDF.

Example

The following example sets options for publishing the active document to PDF. Complex fills are rendered as bitmaps; halftone screens and overprints are included, while OPI links and spot colors are not maintained.

Sub Test()

With ActiveDocument.PDFSettings

.ComplexFillsAsBitmaps = True

.Halftones = True

.MaintainOPILinks = False

.Overprints = True

.SpotColors = False

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.MonoResolution

Property MonoResolution As Long

PDFVBASettings

Description

The MonoResolution property sets the resolution for downsampled monochrome bitmaps when publishing to PDF. In order to apply the resolution, the DownsampleMono option must be set to True.

Example

The following example publishes the active document to PDF. Color and grayscale bitmaps are downsampled to 72 dpi, and monochrome bitmaps are downsampled to 150 dpi.

Sub Test()

With ActiveDocument.PDFSettings

.DownsampleColor = True

.DownsampleGray = True

.DownsampleMono = True

.ColorResolution = 72

.GrayResolution = 72

.MonoResolution = 150

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.Overprints

Property Overprints As Boolean

PDFVBASettings

Description

The Overprints property determines whether document overprints are preserved when publishing to PDF.

Example

The following example sets options for publishing the active document to PDF. Complex fills are rendered as bitmaps; halftone screens and overprints are included, while OPI links and spot colors are not maintained.

Sub Test()

With ActiveDocument.PDFSettings

.ComplexFillsAsBitmaps = True

.Halftones = True

.MaintainOPILinks = False

.Overprints = True

.SpotColors = False

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.PageRange

Property PageRange As String

PDFVBASettings

Description

The PageRange property sets the range of pages to publish to PDF. In order to apply this property, the PublishRange property must be set to pdfPageRange.

Example

The following example publishes the first three pages of the active document to PDF.

Sub Test()

With ActiveDocument.PDFSettings

.PublishRange = pdfPageRange

.PageRange = "1-3"

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.pdfVersion

Property pdfVersion As pdfVersion

PDFVBASettings

Description

The pdfVersion property optimizes the PDF for the specified version.

Example

The following example publishes the active document to the PDF/X-1 format.

Sub Test()

ActiveDocument.PDFSettings.pdfVersion = pdfVersionPDFX1

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.PublishRange

Property PublishRange As pdfExportRange

PDFVBASettings

Description

The PublishRange property specifies the portion of the document that is published to PDF. If you chose pdfPageRange, you can set the page range by setting the PageRange property.

Example

The following example publishes the first three pages of the active document to PDF.

Sub Test()

With ActiveDocument.PDFSettings

.PublishRange = pdfPageRange

.PageRange = "1-3"

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.RegistrationMarks

Property RegistrationMarks As Boolean

PDFVBASettings

Description

The RegistrationMarks property determines whether registration marks are included in the final document when publishing to PDF.

Example

The following example publishes the document to PDF. Crop marks, densitometer scales, file information, and color registration marks are included in the PDF.

Sub Test()

With ActiveDocument.PDFSettings

.CropMarks = True

.DensitometerScales = True

.FileInformation = True

.RegistrationMarks = True

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.SetEmbedFile

Property SetEmbedFile As Boolean

PDFVBASettings

Description

The SetEmbedFile property determines whether external files are embedded when publishing to PDF.

Write-Only

Example

The following example publishes the active document to PDF and embeds file C:\Test.dat.

Sub Test()

With ActiveDocument.PDFSettings

.SetEmbedFile = True

.SetEmbedFilename = "C:\Test.dat"

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.SetEmbedFilename

Property SetEmbedFilename As String

PDFVBASettings

Description

The SetEmbedFilename property specifies which external files are embedded when publishing to PDF. In order to embed external files, the SetEmbedFile property must be set to True.

Write-Only

Example

The following example publishes the active document to PDF and embeds file C:\Test.dat.

Sub Test()

With ActiveDocument.PDFSettings

.SetEmbedFile = True

.SetEmbedFilename = "C:\Test.dat"

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.SetEncoding

Property SetEncoding(ByVal pdfEncodingType)

PDFVBASettings

Description

The SetEncoding property specifies the data encoding to be used when publishing to PDF.

Write-Only

Parameters	Description

pdfEncodingType	[in]

Example

The following example publishes the document to PDF using ASCII 85 data encoding.

Sub Test()

ActiveDocument.PDFSettings.SetEncoding = pdfASCII85

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.SpotColors

Property SpotColors As Boolean

PDFVBASettings

Description

The SpotColors property determines whether spot colors are preserved.

Example

The following example sets options for publishing the active document to PDF. Complex fills are rendered as bitmaps; halftone screens and overprints are included, while OPI links and spot colors are not maintained.

Sub Test()

With ActiveDocument.PDFSettings

.ComplexFillsAsBitmaps = True

.Halftones = True

.MaintainOPILinks = False

.Overprints = True

.SpotColors = False

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.Startup

Property Startup As pdfDisplayOnStart

PDFVBASettings

Description

The Startup property sets the default viewing mode for the PDF when opened in Adobe Acrobat Reader.

Example

The following example publishes the active document to PDF and specifies the thumbnail view as the default viewing mode.

Sub Test()

With ActiveDocument.PDFSettings

.Thumbnails = True

.Startup = pdfThumbnails

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.Subject

Property Subject As String

PDFVBASettings

Description

The Subject property specifies a subject with a PDF.

Example

The following example publishes the active document to PDF, and specifies the file's author, subject, and keywords.

Sub Test()

With ActiveDocument.PDFSettings

.Author = "Graphix Design, Inc"

.Keywords = "Animals, Farm, Bulls"

.Subject = "Animal Farms"

End With

ActiveDocument.PublishToPDF "C:\MyFarm.pdf"

End Sub

 Related Topics


PDFVBASettings.SubsetFonts

Property SubsetFonts As Boolean

PDFVBASettings

Description

The SubsetFonts property determines whether fonts are subsetted in the document when publishing to PDF. You can use the SubsetPct property to set the maximum percentage of the character set used.

Example

The following example publishes the document to PDF. All the document's fonts are converted to Type 1 and embedded in the PDF file along with the base 14 fonts. Fonts are subset if less than 80% of their character set is used.

Sub Test()

With ActiveDocument.PDFSettings

.EmbedBaseFonts = True

.EmbedFonts = True

.SubsetFonts = True

.SubsetPct = 80

.TextAsCurves = False

.TrueTypeToType1 = True

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.SubsetPct

Property SubsetPct As Long

PDFVBASettings

Description

The SubsetPct property sets the maximum percentage of the character set used. If the percentage of the character set used in the document is less than this value, only the characters that are used are embedded. Otherwise, the whole font is embedded.

In order to apply the SubsetPct property, the SubsetFonts property must be set to True.

Example

The following example publishes the document to PDF. All the document's fonts are converted to Type 1 and embedded in the PDF file along with the base 14 fonts. Fonts are subset if less than 80% of their character set is used.

Sub Test()

With ActiveDocument.PDFSettings

.EmbedBaseFonts = True

.EmbedFonts = True

.SubsetFonts = True

.SubsetPct = 80

.TextAsCurves = False

.TrueTypeToType1 = True

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.TextAsCurves

Property TextAsCurves As Boolean

PDFVBASettings

Description

The TextAsCurves property determines whether text is exported as curves when publishing to PDF.

Example

The following example publishes the document to PDF. All the document's fonts are converted to Type 1 and embedded in the PDF file along with the base 14 fonts. Fonts are subset if less than 80% of their character set is used.

Sub Test()

With ActiveDocument.PDFSettings

.EmbedBaseFonts = True

.EmbedFonts = True

.SubsetFonts = True

.SubsetPct = 80

.TextAsCurves = False

.TrueTypeToType1 = True

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.Thumbnails

Property Thumbnails As Boolean

PDFVBASettings

Description

The Thumbnails property determines whether thumbnails are included when publishing to PDF.

Example

The following example publishes the active document to PDF. The resulting document includes bookmarks, hyperlinks, and thumbnails.

Sub Test()

With ActiveDocument.PDFSettings

.Bookmarks = True

.Hyperlinks = True

.Thumbnails = True

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.TrueTypeToType1

Property TrueTypeToType1 As Boolean

PDFVBASettings

Description

The TrueTypeToType1 property determines whether TrueType fonts are converted to Type 1 fonts.

Example

The following example publishes the document to PDF. All the document's fonts are converted to Type 1 and embedded in the PDF file along with the base 14 fonts. Fonts are subset if less than 80% of their character set is used.

Sub Test()

With ActiveDocument.PDFSettings

.EmbedBaseFonts = True

.EmbedFonts = True

.SubsetFonts = True

.SubsetPct = 80

.TextAsCurves = False

.TrueTypeToType1 = True

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.UseColorProfile

Property UseColorProfile As Boolean

PDFVBASettings

Description

The UseColorProfile property determines whether a color profile is used when publishing to PDF.

You can use the ColorProfile property to specify the color profile.

Example

The following example publishes the active document to PDF. All objects are exported using the RGB color model, and the color profile of the composite printer is applied.

Sub Test()

With ActiveDocument.PDFSettings

.ColorMode = pdfRGB

.UseColorProfile = True

.ColorProfile = pdfCompositeProfile

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.Load

Function Load(ByVal SettingName As String) As Boolean

PDFVBASettings

Description

The Load method loads the settings from a specified preset file. A Boolean value is returned.

Parameters	Description

SettingName	Specifies the name of the setting as a string enclosed by quotation marks [in]

Return value

Returns Boolean

Example

The following example loads the "PDF for Document Distribution" publishing style and uses it to publish the active document to PDF.

Sub Test()

ActiveDocument.PDFSettings.Load "PDF for Document Distribution"

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.Reset

Sub Reset()

PDFVBASettings

Description

The Reset method resets all the PDF settings of the document to their default values.

Example

The following example applies the default settings to publish the active document to PDF.All objects are published using the CMYK color model.

Sub Test()

With ActiveDocument.PDFSettings

.Reset

.ColorMode = pdfCMYK

End With

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


PDFVBASettings.Save

Function Save(ByVal SettingName As String) As Boolean

PDFVBASettings

Description

The Save method saves the settings to a specified preset file. A Boolean value is returned.

Parameters	Description

SettingName	Specifies the name of the setting as a string enclosed by quotation marks [in]

Return value

Returns Boolean

 Related Topics


PDFVBASettings.ShowDialog

Function ShowDialog() As Boolean

PDFVBASettings

Description

The ShowDialog method displays the Publish To PDF dialog box. A Boolean value is returned.

Return value

Returns Boolean

Example

The following example displays the Publish To PDF dialog box. If the user chooses a bitmap compression method other than JPEG, a warning message is shown and JPEG compression is applied.

Sub Test()

Dim ps As PDFVBASettings

Set ps = ActiveDocument.PDFSettings

ps.Reset

If ps.ShowDialog Then Exit Sub

If ps.BitmapCompression <> pdfJPEG Then

MsgBox "You must use JPEG bitmap compression."

ps.BitmapCompression = pdfJPEG

End If

ps.JPEGQualityFactor = 150

ActiveDocument.PublishToPDF "C:\MyDocument.pdf"

End Sub

 Related Topics


Polygon properties

Polygon     Legend

      Sharpness
      Sides
      Type


Polygon

Class Polygon

Properties     Referenced By

The Polygon class represents the polygon-specific properties of the Shape object.

 Related Topics


Polygon.Sharpness

Property Sharpness As Long

Polygon

Description

The Sharpness property returns or sets the sharpness of a star-shaped polygon. The maximum value of this property is determined by the number of sides that the star contains.

Example

The following example sets the sharpness of the currently selected polygon.

Sub Test()

ActiveShape.Polygon.Sharpness = 2

End Sub

 Related Topics


Polygon.Sides

Property Sides As Long

Polygon

Description

The Sides property returns or sets the number of sides for a polygon.

Example

The following example displays the number of polygons with a different number of sides exsit in the current document.

Sub Test()

Dim s As Shape

Dim str As String

Dim cnt(3 To 10) As Long, n As Long

For n = 3 To 10

cnt(n) = 0

Next n

For Each s In ActivePage.Shapes

If s.Type = cdrPolygonShape Then

n = s.Polygon.Sides

If n > 9 Then n = 10

cnt(n) = cnt(n) + 1

End If

Next s

str = "The document contains" & vbCr & _

"the following polygons:" & vbCr & vbCr & _

"Sides" & vbTab & "Count"

For n = 3 To 9

str = str & vbCr & n & vbTab & cnt(n)

Next n

If cnt(10) Then

str = str & vbCr & "Other" & vbTab & cnt(10)

End If

MsgBox str

End Sub

 Related Topics


Polygon.Type

Property Type As cdrPolygonType

Polygon

Description

The Type property returns or sets the type of polygon.

This property returns a value of cdrPolygonType.

Example

The following code converts all polygons to stars provided that this is possible; that is, the polygon has more than four sides.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrPolygonShape Then

If s.Polygon.Type = cdrPolygon And s.Polygon.Sides > 4 Then

s.Polygon.Type = cdrStar

s.Polygon.Sharpness = 1

End If

End If

Next s

End Sub

 Related Topics


PostScriptFill properties

PostScriptFill     Legend

    Index
    Name
      Properties


PostScriptFill methods

PostScriptFill     Legend

   Select
   SetProperties


PostScriptFill

Class PostScriptFill

Properties     Methods     Referenced By

The PostScriptFill class represents PostScript fill properties.

 Related Topics


PostScriptFill.Index

Property Index As Long

PostScriptFill

Description

The Index property returns the index number associated with a PostScript fill.

Read-Only

Example

The following example applies the sixth available PostScript fill to a rectangle and displays its name.

Sub Test()

Dim s As Shape

Dim pf As PostScriptFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPostscriptFill(6)

MsgBox pf.Name & " #" & pf.Index

End Sub

 Related Topics


PostScriptFill.Name

Property Name As String

PostScriptFill

Description

The Name property returns the name of a PostScript fill.

Read-Only

Example

The following example applies the sixth available PostScript fill to a rectangle and displays its name.

Sub Test()

Dim s As Shape

Dim pf As PostScriptFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPostscriptFill(6)

MsgBox pf.Name & " #" & pf.Index

End Sub

 Related Topics


PostScriptFill.Properties

Property Properties(ByVal Index As Long) As Long

PostScriptFill

Description

The Properties property returns or sets a specified property of a PostScript fill by referencing the index number of the property.

Parameters	Description

Index	Specifies a property of a PostScript fill. For example, The "Bricks" postscript fill has four properties. PostScriptFill.Properties(2) returns the line width of the fill. [in]

Example

The following example applies the "Birds" pattern to a rectangle. It then changes the frequency value to 4 and background gray level to 50%.

Sub Test()

Dim s As Shape

Dim pf As PostScriptFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPostscriptFill("Birds")

pf.Properties(1) = 4

pf.Properties(4) = 50

End Sub

 Related Topics


PostScriptFill.Select

Sub Select(ByVal IndexOrName As Variant)

PostScriptFill

Description

The Select method chooses a specified PostScript fill by referencing the fill's name or index number

Parameters	Description

IndexOrName	Specifies the index or name of a PostScript fill [in]

Example

The following example replaces the "Birds" pattern with the "ColorBubbles" for all shapes on the page.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrPostscriptFill Then

If s.Fill.PostScript.Name = "Birds" Then

s.Fill.PostScript.Select "ColorBubbles"

End If

End If

Next s

End Sub

 Related Topics


PostScriptFill.SetProperties

Sub SetProperties(ByVal Param1 As Long, [ByVal Param2 As Long = 0], [ByVal Param3 As Long = 0], [ByVal Param4 As Long = 0], [ByVal Param5 As Long = 0])

PostScriptFill

Description

The SetProperties method allows you to set all the properties of a PostScript fill at the same time.

The SetProperties method has placeholders for a maximum of five PostScript fill properties.

Parameters	Description

Param1	References the first property value of a PostScript fill object. For example, the first property of the "Bars" PostScript fill is "Width". [in]

Param2	References the second property value of a PostScript fill object. For example, the Param2 value of the "Bars" fill references the "Spacing (%)" of the fill. [in]
Optional
Default value = 0

Param3	References the third property value of a PostScript fill object. For example, the Param3 value of the "Bars" fill references the "Maximum gray" value of the fill. [in]
Optional
Default value = 0

Param4	References the fourth property value of a PostScript fill object. For example, the Param4 value of the "Bars" fill references the "Minimum gray" value of the fill. [in]
Optional
Default value = 0

Param5	References the fifth property value of a PostScript fill object. For example, the Param5 value of the "Checks" fill references the "Line width" value of the fill. [in]
Optional
Default value = 0

Example

The following example applies applies the "ColorBubbles" pattern to a rectangle and specifies the following fill properties: Number of circles = 10, Max size=300, Min Size=100, Line Width = 26, and Random Seed = 10.

Sub Test()

Dim s As Shape

Dim pf As PostScriptFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set pf = s.Fill.ApplyPostscriptFill("ColorBubbles")

pf.SetProperties 10, 300, 100, 26, 10

End Sub

 Related Topics


PowerClip properties

PowerClip     Legend

    Application
      ContentsLocked
    Parent
    Shapes


PowerClip methods

PowerClip     Legend

   EnterEditMode
   ExtractShapes
   LeaveEditMode


PowerClip

Class PowerClip

Properties     Methods     Referenced By

The PowerClip class represents properties for a PowerClip container.

 Related Topics


PowerClip.Application

Property Application As Application

PowerClip

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


PowerClip.ContentsLocked

Property ContentsLocked As Boolean

PowerClip

Description

The ContentsLocked property determines whether the contents of a PowerClip are locked to its container. If the contents are locked, moving the container will move the shapes inside the PowerClip.

If the ContentsLocked property is True, the PowerClip contents are locked.

Example

The following example creates 150 randomly colored circles, places them inside a text shape, and ensures that the contents of the PowerClip are attached to the text.

Sub Test()

Dim sr As New ShapeRange

Dim s As Shape, n As Long

For n = 1 To 150

Set s = ActiveLayer.CreateEllipse2(Rnd() * 4, Rnd() * 2, Rnd() * 0.3)

s.Fill.UniformColor.RGBAssign Rnd() * 256, Rnd() * 256, Rnd() * 256

sr.Add s

Next n

Set s = ActiveLayer.CreateArtisticText(0, 0, "Clip")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

sr.AddToPowerClip s

s.PowerClip.ContentsLocked = True

End Sub

 Related Topics


PowerClip.Parent

Property Parent As Shape

PowerClip

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


PowerClip.Shapes

Property Shapes As Shapes

PowerClip

Description

The Shapes property returns the Shapes containing all the shapes in the PowerClip.

Read-Only

Example

The following example fills all rectangles placed inside a PowerClips with red.

Sub Test()

Dim s As Shape, sp As Shape

Dim pwc As PowerClip

For Each s In ActivePage.Shapes

Set pwc = Nothing

On Error Resume Next

Set pwc = s.PowerClip

On Error GoTo 0

If Not pwc Is Nothing Then

For Each sp In pwc.Shapes

If sp.Type = cdrRectangleShape Then

sp.Fill.UniformColor.RGBAssign 255, 0, 0

End If

Next sp

End If

Next s

End Sub

 Related Topics


PowerClip.EnterEditMode

Sub EnterEditMode()

PowerClip

Description

The EnterEditMode method changes the application's user interface into the PowerClip editing mode. (The contents of the PowerClip are displayed on the screen, while the container displays as an object which cannot be edited in Wireframe mode.)

Example

The following example adds 20 vertical lines to every PowerClip on the page.

Sub Test()

Const NumLines As Long = 20

Dim s As Shape

Dim pwc As PowerClip

Dim x As Double, y As Double, sx As Double, sy As Double

Dim xx As Double

Dim n As Long

For Each s In ActivePage.Shapes

Set pwc = Nothing

On Error Resume Next

Set pwc = s.PowerClip

On Error GoTo 0

If Not pwc Is Nothing Then

s.CreateSelection

s.GetBoundingBox x, y, sx, sy

pwc.EnterEditMode

For n = 1 To NumLines

xx = x + n * sx / (NumLines + 1)

ActiveLayer.CreateLineSegment xx, y, xx, y + sy

Next n

pwc.LeaveEditMode

End If

Next s

End Sub

 Related Topics


PowerClip.ExtractShapes

Function ExtractShapes() As ShapeRange

PowerClip

Description

The ExtractShapes method removes all shapes from its container.

By extracting the contents from a PowerClip object, the container and contents objects return to being separate objects.

Return value

Returns ShapeRange

Example

The following example extracts all shapes from all PowerClip containers on the active page.

Sub Test()

Dim s As Shape

Dim pwc As PowerClip

For Each s In ActivePage.Shapes

Set pwc = Nothing

On Error Resume Next

Set pwc = s.PowerClip

On Error GoTo 0

If Not pwc Is Nothing Then

s.CreateSelection

pwc.ExtractShapes

End If

Next s

End Sub

 Related Topics


PowerClip.LeaveEditMode

Sub LeaveEditMode()

PowerClip

Description

The LeaveEditMode method disables editing of the contents of a PowerClip by leaving the PowerClip editing mode.

Example

The following example adds 20 vertical lines to every PowerClip on the page.

Sub Test()

Const NumLines As Long = 20

Dim s As Shape

Dim pwc As PowerClip

Dim x As Double, y As Double, sx As Double, sy As Double

Dim xx As Double

Dim n As Long

For Each s In ActivePage.Shapes

Set pwc = Nothing

On Error Resume Next

Set pwc = s.PowerClip

On Error GoTo 0

If Not pwc Is Nothing Then

s.CreateSelection

s.GetBoundingBox x, y, sx, sy

pwc.EnterEditMode

For n = 1 To NumLines

xx = x + n * sx / (NumLines + 1)

ActiveLayer.CreateLineSegment xx, y, xx, y + sy

Next n

pwc.LeaveEditMode

End If

Next s

End Sub

 Related Topics


PrintDocuments properties

PrintDocuments     Legend

    Count


PrintDocuments

Class PrintDocuments

Properties     Referenced By

PrintDocuments Class

 Related Topics


PrintDocuments.Count

Property Count As Long

PrintDocuments

Description

The Count property returns the total number of documents in the PrintDocuments collection.

Read-Only

 Related Topics


Printer properties

Printer     Legend

    ColorEnabled
    Default
    Description
    Name
    Port
    PostScriptEnabled
    Ready
    Type


Printer methods

Printer     Legend

   ShowDialog


Printer

Class Printer

Properties     Methods     Referenced By

The Printer class represents a specified printer on a user's system.

 Related Topics


Printer.ColorEnabled

Property ColorEnabled As Boolean

Printer

Description

The ColorEnabled property returns whether the printer is able to print in color.

Read-Only

Example

The following example lists the model names of printers which are able to print in color.

Sub Test()

Dim intCounter As Integer

Dim Prn As Printer

Dim s As String

For intCounter = 1 To Printers.Count

Set Prn = Printers(intCounter)

If Prn.ColorEnabled = True Then

s = s & Prn.Type & vbCr

End If

Next intCounter

MsgBox "The following printers are able to print in color: " & vbCr & s

Set Prn = Nothing

End Sub

 Related Topics


Printer.Default

Property Default As Boolean

Printer

Description

The Default property returns whether the specified printer is the default printer.

Read-Only

Example

The following example displays a message box with the model name of the default printer.

Sub Test()

Dim intCounter As Integer, Prn As Printer

For intCounter = 1 To Printers.Count

Set Prn = Printers.Item(intCounter)

If Prn.Default = True Then

MsgBox "The default printer is: " & Prn.Type

End If

Next intCounter

End Sub

 Related Topics


Printer.Description

Property Description As String

Printer

Description

The Description property returns the printer's description.

Read-Only

Example

The following example lists the model names and descriptions of all installed printers.

Sub Test()

Dim intCounter As Integer

Dim Prn As Printer

Dim s As String

For intCounter = 1 To Printers.Count

Set Prn = Printers(intCounter)

If Prn.Description <> "" Then

s = s & Prn.Type & " - " & Prn.Description & vbCr

End If

Next intCounter

MsgBox "The following printers are installed on your system: " & vbCr & vbCr & s

Set Prn = Nothing

End Sub

 Related Topics


Printer.Name

Property Name As String

Printer

Description

The Name property returns the printer's name.

Read-Only

Example

The following example lists the names of all installed printers.

Sub Test()

Dim intCounter As Integer

Dim Prn As Printer

Dim s As String

For intCounter = 1 To Printers.Count

Set Prn = Printers(intCounter)

s = s & Prn.Name & vbCr

Next intCounter

MsgBox "The following printers are installed on your system: " & vbCr & vbCr & s

Set Prn = Nothing

End Sub

 Related Topics


Printer.Port

Property Port As String

Printer

Description

The Port property returns the name of the port (for example, LPT1) to which the printer prints.

Read-Only

Example

The following example displays the port of the default printer.

Sub Test()

MsgBox "The default printer prints to: " & Printers.Default.Port

End Sub

 Related Topics


Printer.PostScriptEnabled

Property PostScriptEnabled As Boolean

Printer

Description

The PostScriptEnabled property returns whether the printer is able to print PostScript.

Read-Only

Example

The following example displays a message box for each printer that is able to print PostScript.

Sub Test()

Dim intCounter As Integer

Dim Prn As Printer

For intCounter = 1 To Printers.Count

Set Prn = Printers(intCounter)

If Prn.PostScriptEnabled = True Then

MsgBox "The " & Prn.Type & " is able to print PostScript."

End If

Next intCounter

Set Prn = Nothing

End Sub

 Related Topics


Printer.Ready

Property Ready As Boolean

Printer

Description

The Ready property returns the ready state of the printer.

Read-Only

Example

The following example lists the printers that are not ready to print.

Sub Test()

Dim intCounter As Integer

Dim Prn As Printer

Dim s As String

For intCounter = 1 To Printers.Count

Set Prn = Printers(intCounter)

If Prn.Ready = False Then

s = s & Prn.Type & vbCr

End If

Next intCounter

MsgBox "The following printers are not ready: " & vbCr & vbCr & s

Set Prn = Nothing

End Sub

 Related Topics


Printer.Type

Property Type As String

Printer

Description

The Type property returns the printer's model name.

Read-Only

Example

The following example displays whether the HP LaserJet 5P/5MP PostScript printer is installed.

Sub Test()

Dim intCounter As Integer

Dim Prn As Printer

For intCounter = 1 To Printers.Count

Set Prn = Printers(intCounter)

If Prn.Type = "HP LaserJet 5P/5MP PostScript" Then

MsgBox "The " & Prn.Type & " printer is installed."

Exit For

End If

Next intCounter

Set Prn = Nothing

End Sub

 Related Topics


Printer.ShowDialog

Sub ShowDialog()

Printer

Description

The ShowDialog method shows the printer's Properties dialog box.

Example

The following example displays the Properties dialog box for the default printer.

Sub Test()

Printers.Default.ShowDialog

End Sub

 Related Topics


PrintJob properties

PrintJob     Legend

    Documents
    Pages
    Settings


PrintJob methods

PrintJob     Legend

   AddDocument
   Clear
   PrintOut


PrintJob

Class PrintJob

Properties     Methods     Referenced By

The PrintJob class represents a composite print job. You can use this object to create complex print jobs consisting of pages from different documents.

This class is reserved for future development.

 Related Topics


PrintJob.Documents

Property Documents As PrintDocuments

PrintJob

Description

The Documents property returns the collection of documents included in the print job.

Read-Only

This property is reserved for future development.

 Related Topics


PrintJob.Pages

Property Pages As PrintPages

PrintJob

Description

The Pages property returns a collection of all pages included in the print job.

This property is reserved for future development.

Read-Only

 Related Topics


PrintJob.Settings

Property Settings As PrintSettings

PrintJob

Description

The Settings property returns a PrintSettings object which represents the printing options specified for the print job.

Read-Only

Example

The following example displays the Print dialog box populated with the options for the print job.

Sub Test()

PrintJob.Settings.ShowDialog

End Sub

 Related Topics


PrintJob.AddDocument

Sub AddDocument(ByVal Document As Document, [ByVal PageRange As String])

PrintJob

Description

The AddDocument function adds a document to a print job.

This method is reserved for future development.

Parameters	Description

Document	[in]

PageRange	[in]
Optional

 Related Topics


PrintJob.Clear

Sub Clear()

PrintJob

Description

The Clear method clears a print job by removing any pages that were added to it.

Example

The following example clears the print job.

Sub Test()

PrintJob.Clear

End Sub

 Related Topics


PrintJob.PrintOut

Sub PrintOut()

PrintJob

Description

The PrintOut method sends the pages added to the print job to a printer.

This method is reserved for future development.

 Related Topics


PrintOptions properties

PrintOptions     Legend

      AppInfo
      BitmapColorMode
      ColorMode
      ColorResolution
      DownsampleColor
      DownsampleGray
      DownsampleMono
      DriverInfo
      FontInfo
      FountainSteps
      GrayResolution
      JobInformation
      LinkInfo
      MarksToPage
      MonoResolution
      PrintBitmaps
      PrintJobInfo
      PrintText
      PrintVectors
      RasterizePage
      RasterizeResolution
      SepsInfo
      TextInBlack
      UseColorProfile


PrintOptions

Class PrintOptions

Properties     Referenced By

The PrintOptions class represents the application's print options.

 Related Topics


PrintOptions.AppInfo

Property AppInfo As Boolean

PrintOptions

Description

The AppInfo property determines whether application information is printed on the job information sheet.

Example

The following example prints the job information sheet with application information, driver information, and font information.

Sub Test()

Dim DrawPrintOptions As PrintOptions

Set DrawPrintOptions = ActiveDocument.PrintSettings.Options

With DrawPrintOptions

.JobInformation = True

.AppInfo = True

.DriverInfo = True

.PrintJobInfo = False

.FontInfo = True

.SepsInfo = False

End With

'print the document

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintOptions.BitmapColorMode

Property BitmapColorMode As PrnBitmapColorMode

PrintOptions

Description

The BitmapColorMode returns or sets how color bitmaps are printed. You can print bitmaps in CMYK, RGB, or grayscale.

Example

The following example displays the current BitmapColorMode setting.

Sub Test()

Select Case ActiveDocument.PrintSettings.Options.BitmapColorMode

Case prnBitmapCMYK

MsgBox "The current bitmap color mode is CMYK", vbOKOnly, "Current bitmap color mode"

Case prnBitmapGrayscale

MsgBox "The current bitmap color mode is Grayscale", vbOKOnly, "Current bitmap color mode"

Case prnBitmapRGB

MsgBox "The current bitmap color mode is RGB", vbOKOnly, "Current bitmap color mode"

Case Else

MsgBox "The current bitmap color mode is Unknown", vbOKOnly, "Current bitmap color mode"

End Select

End Sub

 Related Topics


PrintOptions.ColorMode

Property ColorMode As PrnColorMode

PrintOptions

Description

The ColorMode property returns or sets how colors are printed. You can print colors in full color, black and white, or grayscale.

Example

The following example changes the ColorMode setting from the default (Full color) to Grayscale.

Sub Test()

ActiveDocument.PrintSettings.Options.ColorMode = prnModeGrayscale

End Sub

 Related Topics


PrintOptions.ColorResolution

Property ColorResolution As Long

PrintOptions

Description

The ColorResolution property returns or sets the resolution of color bitmaps for printing.

Example

The following example activates downsampling for color, grayscale, and monochrome bitmaps. It then sets the resolution and prints the document.

Sub Test()

Dim DrawPrintOptions As PrintOptions

Set DrawPrintOptions = ActiveDocument.PrintSettings.Options

With DrawPrintOptions

'set all downsampling to True

.DownsampleColor = True

.DownsampleGray = True

.DownsampleMono = True

'set the resolution

.ColorResolution = 96

.GrayResolution = 150

.MonoResolution = 600

End With

'print the document

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintOptions.DownsampleColor

Property DownsampleColor As Boolean

PrintOptions

Description

The DownsampleColor property returns or sets the resolution of color bitmaps for printing.

Example

The following example saves the current downsampling settings, changes the settings, and prints the document. The saved settings are then restored.

Sub Test()

Dim bDownSampleColor As Boolean

Dim bDownSampleGray As Boolean

Dim bDownSampleMono As Boolean

Dim DrawPrintOptions As PrintOptions

Set DrawPrintOptions = ActiveDocument.PrintSettings.Options

With DrawPrintOptions

'save the current setting

bDownSampleColor = .DownsampleColor

bDownSampleGray = .DownsampleGray

bDownSampleMono = .DownsampleMono

'change the setting

.DownsampleColor = True

.DownsampleGray = True

.DownsampleMono = False

End With

'print the document

ActiveDocument.PrintOut

'restore the downsample setting

With DrawPrintOptions

.DownsampleColor = bDownSampleColor

.DownsampleGray = bDownSampleGray

.DownsampleMono = bDownSampleMono

End With

End Sub

 Related Topics


PrintOptions.DownsampleGray

Property DownsampleGray As Boolean

PrintOptions

Description

The DownsampleGray property returns or sets the resolution of grayscale bitmaps for printing.

Example

The following example saves the current downsampling settings, changes the settings, and prints the document. The saved settings are then restored.

Sub Test()

Dim bDownSampleColor As Boolean

Dim bDownSampleGray As Boolean

Dim bDownSampleMono As Boolean

Dim DrawPrintOptions As PrintOptions

Set DrawPrintOptions = ActiveDocument.PrintSettings.Options

With DrawPrintOptions

'save the current setting

bDownSampleColor = .DownsampleColor

bDownSampleGray = .DownsampleGray

bDownSampleMono = .DownsampleMono

'change the setting

.DownsampleColor = True

.DownsampleGray = True

.DownsampleMono = False

End With

'print the document

ActiveDocument.PrintOut

'restore the downsample setting

With DrawPrintOptions

.DownsampleColor = bDownSampleColor

.DownsampleGray = bDownSampleGray

.DownsampleMono = bDownSampleMono

End With

End Sub

 Related Topics


PrintOptions.DownsampleMono

Property DownsampleMono As Boolean

PrintOptions

Description

The DownsampleMono property returns or sets the resolution of monochrome bitmaps for printing.

Example

The following example saves the current downsampling settings, changes the settings, and prints the document. The saved settings are then restored.

Sub Test()

Dim bDownSampleColor As Boolean

Dim bDownSampleGray As Boolean

Dim bDownSampleMono As Boolean

Dim DrawPrintOptions As PrintOptions

Set DrawPrintOptions = ActiveDocument.PrintSettings.Options

With DrawPrintOptions

'save the current setting

bDownSampleColor = .DownsampleColor

bDownSampleGray = .DownsampleGray

bDownSampleMono = .DownsampleMono

'change the setting

.DownsampleColor = True

.DownsampleGray = True

.DownsampleMono = False

End With

'print the document

ActiveDocument.PrintOut

'restore the downsample setting

With DrawPrintOptions

.DownsampleColor = bDownSampleColor

.DownsampleGray = bDownSampleGray

.DownsampleMono = bDownSampleMono

End With

End Sub

 Related Topics


PrintOptions.DriverInfo

Property DriverInfo As Boolean

PrintOptions

Description

The DriverInfo property determines whether driver and device information is printed on the job information sheet.

Example

The following example prints the job information sheet with application information, driver information, and font information.

Sub Test()

Dim DrawPrintOptions As PrintOptions

Set DrawPrintOptions = ActiveDocument.PrintSettings.Options

With DrawPrintOptions

.JobInformation = True

.AppInfo = True

.DriverInfo = True

.PrintJobInfo = False

.FontInfo = True

.SepsInfo = False

End With

'print the document

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintOptions.FontInfo

Property FontInfo As Boolean

PrintOptions

Description

The FontInfo property determines whether font information is printed on the job information sheet.

Example

The following example prints the job information sheet with application information, driver information, and font information.

Sub Test()

Dim DrawPrintOptions As PrintOptions

Set DrawPrintOptions = ActiveDocument.PrintSettings.Options

With DrawPrintOptions

.JobInformation = True

.AppInfo = True

.DriverInfo = True

.PrintJobInfo = False

.FontInfo = True

.SepsInfo = False

End With

'print the document

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintOptions.FountainSteps

Property FountainSteps As Long

PrintOptions

Description

The FountainSteps property returns or sets the number of steps to use when printing fountain fills.

Example

The following example displays the current value for the FountainSteps property, changes the value to 256, and displays the new value.

Sub Test()

MsgBox "Fountain fills will print using " & _

ActiveDocument.PrintSettings.Options.FountainSteps & " steps."

ActiveDocument.PrintSettings.Options.FountainSteps = 256

MsgBox "Fountain fills will now print using " & _

ActiveDocument.PrintSettings.Options.FountainSteps & " steps."

End Sub

 Related Topics


PrintOptions.GrayResolution

Property GrayResolution As Long

PrintOptions

Description

The GrayResolution property returns or sets the resolution of grayscale bitmaps for printing.

Example

The following example activates downsampling for color, grayscale, and monochrome bitmaps. It then sets the resolution and prints the document.

Sub Test()

Dim DrawPrintOptions As PrintOptions

Set DrawPrintOptions = ActiveDocument.PrintSettings.Options

With DrawPrintOptions

'set all downsampling to True

.DownsampleColor = True

.DownsampleGray = True

.DownsampleMono = True

'set the resolution

.ColorResolution = 96

.GrayResolution = 150

.MonoResolution = 600

End With

'print the document

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintOptions.JobInformation

Property JobInformation As Boolean

PrintOptions

Description

The JobInformation property determines whether the job information sheet is printed.

Example

The following example prints the job information sheet with application information, driver information, and font information.

Sub Test()

Dim DrawPrintOptions As PrintOptions

Set DrawPrintOptions = ActiveDocument.PrintSettings.Options

With DrawPrintOptions

.JobInformation = True

.AppInfo = True

.DriverInfo = True

.PrintJobInfo = False

.FontInfo = True

.SepsInfo = False

End With

'print the document

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintOptions.LinkInfo

Property LinkInfo As Boolean

PrintOptions

Description

The LinkInfo property determines whether information about OPI linked images is printed on the job information sheet.

Example

The following example prints the job information sheet with application information, driver information, and font information.

Sub Test()

Dim DrawPrintOptions As PrintOptions

Set DrawPrintOptions = ActiveDocument.PrintSettings.Options

With DrawPrintOptions

.JobInformation = True

.AppInfo = True

.DriverInfo = True

.PrintJobInfo = False

.FontInfo = True

.SepsInfo = False

.LinkInfo = False

End With

'print the document

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintOptions.MarksToPage

Property MarksToPage As Boolean

PrintOptions

Description

The MarksToPage property fits the printer's marks to the printable page.

Example

The following example disables the MarksToPage setting, enables registration marks, creates a rectangle, and prints the document. It then enables the MarksToPage setting and prints the document again.

Sub Test()

Dim s As Shape

With ActiveDocument

.PrintSettings.Options.MarksToPage = False

.PrintSettings.Prepress.RegistrationMarks = True

Set s = .ActiveLayer.CreateRectangle(2, 6, 8, 8)

.PrintOut

.PrintSettings.Options.MarksToPage = True

.PrintSettings.Prepress.RegistrationMarks = True

.PrintOut

End With

End Sub

 Related Topics


PrintOptions.MonoResolution

Property MonoResolution As Long

PrintOptions

Description

The MonoResolution property returns or sets the resolution of monochrome bitmaps for printing.

Example

The following example activates downsampling for color, grayscale, and monochrome bitmaps. It then sets the resolution and prints the document.

Sub Test()

Dim DrawPrintOptions As PrintOptions

Set DrawPrintOptions = ActiveDocument.PrintSettings.Options

With DrawPrintOptions

'set all downsampling to True

.DownsampleColor = True

.DownsampleGray = True

.DownsampleMono = True

'set the resolution

.ColorResolution = 96

.GrayResolution = 150

.MonoResolution = 600

End With

'print the document

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintOptions.PrintBitmaps

Property PrintBitmaps As Boolean

PrintOptions

Description

The PrintBitmaps property returns or sets whether bitmaps are printed.

Example

The following example creates a rectangle, fills the rectangle, and converts it to a bitmap. It then creates another rectangle, sets bitmaps to not print and sets vectors to print before printing the document.

Sub Test()

Dim s As Shape

With ActiveDocument

 Set s = .ActiveLayer.CreateRectangle(2, 6, 8, 8)

 s.Fill.UniformColor.RGBAssign 255, 0, 0

 s.ConvertToBitmap , , , , 96

 Set s = .ActiveLayer.CreateRectangle(4, 6, 8, 2)

 .PrintSettings.Options.PrintBitmaps = False

 .PrintSettings.Options.PrintVectors = True

 .PrintOut

End With

End Sub

 Related Topics


PrintOptions.PrintJobInfo

Property PrintJobInfo As Boolean

PrintOptions

Description

The PrintJobInfo property determines whether information about the print job is printed on the job information sheet.

Example

The following example prints the job information sheet with application information, driver information, and font information.

Sub Test()

Dim DrawPrintOptions As PrintOptions

Set DrawPrintOptions = ActiveDocument.PrintSettings.Options

With DrawPrintOptions

.JobInformation = True

.AppInfo = True

.DriverInfo = True

.PrintJobInfo = False

.FontInfo = True

.SepsInfo = False

End With

'print the document

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintOptions.PrintText

Property PrintText As Boolean

PrintOptions

Description

The PrintText property returns or sets whether text is printed.

Example

The following example creates a text string and adds a uniform fill to it. The text is then set to print in black, and the document is printed.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(4, 5, "Some Text String")

s.Fill.UniformColor.RGBAssign 255, 0, 0

With ActiveDocument.PrintSettings.Options

.PrintText = True

.TextInBlack = True

End With

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintOptions.PrintVectors

Property PrintVectors As Boolean

PrintOptions

Description

The PrintVectors property returns or sets whether vectors are printed.

Example

The following example creates a rectangle, fills the rectangle, and converts it to a bitmap. It then creates another rectangle, sets bitmaps to not print and sets vectors to print before printing the document.

Sub Test()

Dim s As Shape

With ActiveDocument

 Set s = .ActiveLayer.CreateRectangle(2, 6, 8, 8)

 s.Fill.UniformColor.RGBAssign 255, 0, 0

 s.ConvertToBitmap , , , , 96

 Set s = .ActiveLayer.CreateRectangle(4, 6, 8, 2)

 .PrintSettings.Options.PrintBitmaps = False

 .PrintSettings.Options.PrintVectors = True

 .PrintOut

End With

End Sub

 Related Topics


PrintOptions.RasterizePage

Property RasterizePage As Boolean

PrintOptions

Description

The RasterizePage property returns or sets whether a document ir printed as a bitmap.

Example

The following example sets each page to print as a bitmap, sets the resolution of the bitmap to 300 dpi, and then prints the document.

Sub Test()

With ActiveDocument.PrintSettings.Options

.RasterizePage = True

.RasterizeResolution = 300

End With

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintOptions.RasterizeResolution

Property RasterizeResolution As Long

PrintOptions

Description

The RasterizeResolution property returns or sets the resolution of the bitmap. This property is used in conjunction with the RasterizePage property which allows users to print a document as a bitmap.

Example

The following example sets each page to print as a bitmap, sets the resolution of the bitmap to 300 dpi, and then prints the document.

Sub Test()

With ActiveDocument.PrintSettings.Options

.RasterizePage = True

.RasterizeResolution = 300

End With

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintOptions.SepsInfo

Property SepsInfo As Boolean

PrintOptions

Description

The SepsInfo property determines whether information about print separations is printed on the job information sheet.

Example

The following example prints the job information sheet with application information, driver information, and font information.

Sub Test()

Dim DrawPrintOptions As PrintOptions

Set DrawPrintOptions = ActiveDocument.PrintSettings.Options

With DrawPrintOptions

.JobInformation = True

.AppInfo = True

.DriverInfo = True

.PrintJobInfo = False

.FontInfo = True

.SepsInfo = False

End With

'print the document

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintOptions.TextInBlack

Property TextInBlack As Boolean

PrintOptions

Description

The TextInBlack property returns or sets whether all text prints in black.

Example

The following example creates a text string and adds a uniform fill to it. The text is then set to print in black, and the document is printed.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(4, 5, "Some Text String")

s.Fill.UniformColor.RGBAssign 255, 0, 0

With ActiveDocument.PrintSettings.Options

.PrintText = True

.TextInBlack = True

End With

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintOptions.UseColorProfile

Property UseColorProfile As Boolean

PrintOptions

Description

The UseColorProfile property returns or sets whether to use the selected color profile. Using a color profile reproduces colors more accurately.

This setting does not affect grayscale output.

Example

The following example creates a rectangle, fills it, and prints the document. The color profile is applied, and the document is printed again.

Sub Test()

Dim s As Shape

With ActiveDocument

.PrintSettings.Options.UseColorProfile = False

Set s = .ActiveLayer.CreateRectangle(2, 6, 8, 8)

s.Fill.UniformColor.RGBAssign 255, 255, 0

.PrintOut

.PrintSettings.Options.UseColorProfile = True

.PrintOut

End With

End Sub

 Related Topics


PrintPages properties

PrintPages     Legend

    Count


PrintPages

Class PrintPages

Properties     Referenced By

The PrintPages class represents the collection of all pages included in the print job.

 Related Topics


PrintPages.Count

Property Count As Long

PrintPages

Description

The Count property returns the number of pages in the collection.

Read-Only

 Related Topics


PrintPostScript properties

PrintPostScript     Legend

      AutoIncreaseFlatness
      AutoIncreaseFountainSteps
      ConformToDSC
      DownloadType1
      Flatness
      JPEGCompression
      JPEGQuality
      Level
      MaintainOPILinks
      MaxPointsPerCurve
      OptimizeFountainFills
      PDFBookmarks
      PDFHyperlinks
      PDFStartup
      ResolveDCSLinks
      ScreenFrequency
      TrueTypeToType1


PrintPostScript

Class PrintPostScript

Properties     Referenced By

The PrintPostScript class represents the PostScript settings in the print engine.

 Related Topics


PrintPostScript.AutoIncreaseFlatness

Property AutoIncreaseFlatness As Boolean

PrintPostScript

Description

When the AutoIncreaseFlatness property is set to True, the print engine increases the flatness of an object in increments of two.

Example

The following example creates a curve, sets the AutoIncreaseFlatness property to True, and prints the document.

Sub Test()

Dim s As Shape

Dim c As Curve

Set c = CreateCurve(ActiveDocument)

With c.CreateSubPath(0.492835, 10.327087)

.AppendCurveSegment 1.065118, 9.879213, 0.189492, -23.198591, 0.646929, 0#

.AppendCurveSegment 1.313937, 9.381575, 0.497638, 180#, 0.225315, 173.659808

.AppendCurveSegment 1.363701, 9.05811, 0.15135, -9.462322, 0.12687, 11.309932

.AppendCurveSegment 0.791417, 8.859055, 0.078681, -161.565051, 0.174173, 90#

.AppendCurveSegment 1.438346, 8.560472, 0.348346, -90#, 0.248819, 90#

.AppendCurveSegment 0.890945, 8.386299, 0.323465, -90#, 0.223937, 0#

.AppendCurveSegment 1.139764, 8.062835, 0.373228, 180#, 0.124409, 180#

.AppendCurveSegment 1.413465, 7.490551, 0.750177, -5.710593, 0.497638, 90#

.AppendCurveSegment 1.911102, 7.391024, 0.099528, -90#, 0.102591, 104.036243

.AppendCurveSegment 1.811575, 6.793858, 0.338429, -72.897271, 0.380618, 168.690068

.AppendCurveSegment 2.209685, 7.117323, 0.537126, -13.392498, 0.278185, -116.565051

.AppendCurveSegment 3.478661, 6.768976, 0.556374, 63.434949, 0.746457, 90#

.AppendCurveSegment 2.981024, 6.669449, 0.174173, -90#, 0.099528, 0#

.AppendCurveSegment 2.682441, 7.21685, 0.200602, 172.874984, 0#, 0#

End With

Set s = ActiveLayer.CreateCurve(c)

With ActiveDocument.PrintSettings.PostScript

.AutoIncreaseFlatness = True

End With

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintPostScript.AutoIncreaseFountainSteps

Property AutoIncreaseFountainSteps As Boolean

PrintPostScript

Description

The AutoIncreaseFlatness property controls whether the print engine increases the number of fountain steps to reduce banding. When this property is set to True, the print engine makes the increase if it is necessary.

Example

The following example creates a rectangle and fills it with a a conical fountain fill. After it sets AutoIncreaseFountainSteps to True, the document is printed.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(2, 4, 6, 8)

s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(0, 255, 0), cdrConicalFountainFill, , 4

With ActiveDocument

.PrintSettings.PostScript.AutoIncreaseFountainSteps = True

.PrintOut

End With

End Sub

 Related Topics


PrintPostScript.ConformToDSC

Property ConformToDSC As Boolean

PrintPostScript

Description

The ConformtoDSC property ensures that a PostScript file conforms to the Document Structuring Convention.

Example

The following example saves the current value of the ConformToDSC property and sets it to True. After it prints the document, it restores the saved value.

Sub Test()

Dim bConformToDSC As Boolean

'save current value

With ActiveDocument.PrintSettings.PostScript

bConformToDSC = .ConformToDSC

'set new value

.ConformToDSC = True

End With

'print document

ActiveDocument.PrintOut

'restore saved value

With ActiveDocument.PrintSettings.PostScript

.ConformToDSC = bConformToDSC

End With

End Sub

 Related Topics


PrintPostScript.DownloadType1

Property DownloadType1 As Boolean

PrintPostScript

Description

The DownloadType1 property controls the download of Type 1 fonts to a PostScript printer. If fonts are not downloaded to the printer (and they are not already installed on the printer), the fonts print as curves or bitmaps.

Example

The following example creates text strings in different fonts and prints them. The fonts are downloaded to the printer (if it is PostScript), and the document is printed again.

Sub Test()

Dim s As Shape

Dim n As Integer

Dim dLeft As Double

Dim dBottom As Double

dLeft = 0.25

dBottom = ActivePage.SizeHeight - 0.4

For n = 1 To FontList.Count Step 5

Set s = ActiveLayer.CreateArtisticText(dLeft, dBottom, "Some Text String")

s.Text.FontProperties.Name = FontList(n)

dBottom = dBottom - 0.4

Next n

With ActiveDocument

.PrintSettings.PostScript.DownloadType1 = False

.PrintSettings.PostScript.TrueTypeToType1 = False

.PrintOut

.PrintSettings.PostScript.DownloadType1 = True

.PrintSettings.PostScript.TrueTypeToType1 = True

.PrintOut

End With

End Sub

 Related Topics


PrintPostScript.Flatness

Property Flatness As Long

PrintPostScript

Description

The Flatness property specifies the flatness of a curve.

Example

The following example creates a curve, sets the printing flatness of the curve to 5, and prints the active document.

Sub Test()

Dim s As Shape

Dim c As Curve

Set c = CreateCurve(ActiveDocument)

With c.CreateSubPath(0.492835, 10.327087)

.AppendCurveSegment 1.065118, 9.879213, 0.189492, -23.198591, 0.646929, 0#

.AppendCurveSegment 1.313937, 9.381575, 0.497638, 180#, 0.225315, 173.659808

.AppendCurveSegment 1.363701, 9.05811, 0.15135, -9.462322, 0.12687, 11.309932

.AppendCurveSegment 0.791417, 8.859055, 0.078681, -161.565051, 0.174173, 90#

.AppendCurveSegment 1.438346, 8.560472, 0.348346, -90#, 0.248819, 90#

.AppendCurveSegment 0.890945, 8.386299, 0.323465, -90#, 0.223937, 0#

.AppendCurveSegment 1.139764, 8.062835, 0.373228, 180#, 0.124409, 180#

.AppendCurveSegment 1.413465, 7.490551, 0.750177, -5.710593, 0.497638, 90#

.AppendCurveSegment 1.911102, 7.391024, 0.099528, -90#, 0.102591, 104.036243

.AppendCurveSegment 1.811575, 6.793858, 0.338429, -72.897271, 0.380618, 168.690068

.AppendCurveSegment 2.209685, 7.117323, 0.537126, -13.392498, 0.278185, -116.565051

.AppendCurveSegment 3.478661, 6.768976, 0.556374, 63.434949, 0.746457, 90#

.AppendCurveSegment 2.981024, 6.669449, 0.174173, -90#, 0.099528, 0#

.AppendCurveSegment 2.682441, 7.21685, 0.200602, 172.874984, 0#, 0#

End With

Set s = ActiveLayer.CreateCurve(c)

With ActiveDocument.PrintSettings.PostScript

.Flatness = 5

End With

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintPostScript.JPEGCompression

Property JPEGCompression As Boolean

PrintPostScript

Description

The JPEGCompression property returns or sets whether bitmaps are compressed for a print job. You can use the JPEGQuality property to specify the quality of the compression.

Example

The following example creates a rectangle, an ellipse, and a polygon. It fills each of them with a texture fill and converts them to bitmaps. Before the document is printed, it disables JPEG compression. It then enables JPEG compression, sets the quality of the compression, and prints the document again.

Sub Test()

Dim shRect As Shape

Set shRect = ActiveLayer.CreateRectangle(1.114882, 10.078268, 3.030787, 8.485827, 0, 0, 0, 0)

Dim shEllipse As Shape

Set shEllipse = ActiveLayer.CreateEllipse(4.075827, 7.540315, 6.016614, 5.375591, 90#, 90#, False)

Dim shPolygon As Shape

Set shPolygon = ActiveLayer.CreatePolygon(5.842445, 2.912283, 7.758343, 0.44898, 5, 1, 1, False, 50, 100)

With shPolygon.Fill.ApplyTextureFill("Alien Eyes", "Samples 9")

.SetProperties 3281, 2, 0, 150, 25, 1, CreateRGBColor(25, 0, 73), CreateRGBColor(229, 255, 0), 0

.MaximumTileWidth = 2049

.TransformWithShape = True

.MirrorFill = False

.TileOffsetType = cdrTileOffsetRow

.TileOffset = 0

.Resolution = 300

.RotationAngle = 0#

.SkewAngle = 0#

.TileHeight = 2.228083

.TileWidth = 1.822134

.OriginX = 0#

.OriginY = 0#

End With

shPolygon.ConvertToBitmap , , , False, 150

With shEllipse.Fill.ApplyTextureFill("Disco Nightmare", "Samples 9")

.SetProperties 4641, 0, 100, 0, 100, CreateRGBColor(51, 0, 204), CreateRGBColor(255, 102, 0), 0

.MaximumTileWidth = 2049

.TransformWithShape = True

.MirrorFill = False

.TileOffsetType = cdrTileOffsetRow

.TileOffset = 0

.Resolution = 300

.RotationAngle = 0#

.SkewAngle = 0#

.TileHeight = 2.164724

.TileWidth = 1.940787

.OriginX = 0#

.OriginY = 0#

End With

shEllipse.ConvertToBitmap , , , False, 150

With shRect.Fill.ApplyTextureFill("Solder", "Samples 9")

.SetProperties 19195, 60, 0, 75, 25, 100, 50, 50, CreateRGBColor(25, 25, 255), CreateRGBColor(0, 0, 0), CreateRGBColor(255, 255, 255), 0

.MaximumTileWidth = 2049

.TransformWithShape = True

.MirrorFill = False

.TileOffsetType = cdrTileOffsetRow

.TileOffset = 0

.Resolution = 300

.RotationAngle = 0#

.SkewAngle = 0#

.TileHeight = 2.662362

.TileWidth = 1.84126

.OriginX = 0.000008

.OriginY = 0.000004

End With

shRect.ConvertToBitmap , , , False, 150

With ActiveDocument

.PrintSettings.PostScript.JPEGCompression = False

.PrintOut

.PrintSettings.PostScript.JPEGCompression = True

.PrintSettings.PostScript.JPEGQuality = 100

.PrintOut

End With

End Sub

 Related Topics


PrintPostScript.JPEGQuality

Property JPEGQuality As Long

PrintPostScript

Description

The JPEGQuality property returns or sets the quality of compressed bitmaps in a print job. In order to use this property, you must enable the JPEGCompression property which allows for the compression.

Example

The following example creates a rectangle, an ellipse, and a polygon. It fills each of them with a texture fill and converts them to bitmaps. Before the document is printed, it disables JPEG compression. It then enables JPEG compression, sets the quality of the compression, and prints the document again.

Sub Test()

Dim shRect As Shape

Set shRect = ActiveLayer.CreateRectangle(1.114882, 10.078268, 3.030787, 8.485827, 0, 0, 0, 0)

Dim shEllipse As Shape

Set shEllipse = ActiveLayer.CreateEllipse(4.075827, 7.540315, 6.016614, 5.375591, 90#, 90#, False)

Dim shPolygon As Shape

Set shPolygon = ActiveLayer.CreatePolygon(5.842445, 2.912283, 7.758343, 0.44898, 5, 1, 1, False, 50, 100)

With shPolygon.Fill.ApplyTextureFill("Alien Eyes", "Samples 9")

.SetProperties 3281, 2, 0, 150, 25, 1, CreateRGBColor(25, 0, 73), CreateRGBColor(229, 255, 0), 0

.MaximumTileWidth = 2049

.TransformWithShape = True

.MirrorFill = False

.TileOffsetType = cdrTileOffsetRow

.TileOffset = 0

.Resolution = 300

.RotationAngle = 0#

.SkewAngle = 0#

.TileHeight = 2.228083

.TileWidth = 1.822134

.OriginX = 0#

.OriginY = 0#

End With

shPolygon.ConvertToBitmap , , , False, 150

With shEllipse.Fill.ApplyTextureFill("Disco Nightmare", "Samples 9")

.SetProperties 4641, 0, 100, 0, 100, CreateRGBColor(51, 0, 204), CreateRGBColor(255, 102, 0), 0

.MaximumTileWidth = 2049

.TransformWithShape = True

.MirrorFill = False

.TileOffsetType = cdrTileOffsetRow

.TileOffset = 0

.Resolution = 300

.RotationAngle = 0#

.SkewAngle = 0#

.TileHeight = 2.164724

.TileWidth = 1.940787

.OriginX = 0#

.OriginY = 0#

End With

shEllipse.ConvertToBitmap , , , False, 150

With shRect.Fill.ApplyTextureFill("Solder", "Samples 9")

.SetProperties 19195, 60, 0, 75, 25, 100, 50, 50, CreateRGBColor(25, 25, 255), CreateRGBColor(0, 0, 0), CreateRGBColor(255, 255, 255), 0

.MaximumTileWidth = 2049

.TransformWithShape = True

.MirrorFill = False

.TileOffsetType = cdrTileOffsetRow

.TileOffset = 0

.Resolution = 300

.RotationAngle = 0#

.SkewAngle = 0#

.TileHeight = 2.662362

.TileWidth = 1.84126

.OriginX = 0.000008

.OriginY = 0.000004

End With

shRect.ConvertToBitmap , , , False, 150

With ActiveDocument

.PrintSettings.PostScript.JPEGCompression = False

.PrintOut

.PrintSettings.PostScript.JPEGCompression = True

.PrintSettings.PostScript.JPEGQuality = 100

.PrintOut

End With

End Sub

 Related Topics


PrintPostScript.Level

Property Level As PrnPostScriptLevel

PrintPostScript

Description

The Level property gets or sets the PostScript level.

Example

The following example displays the current PostScript level.

Sub Test()

MsgBox "The current PostScript level is level " & _

ActiveDocument.PrintSettings.PostScript.Level

End Sub

 Related Topics


PrintPostScript.MaintainOPILinks

Property MaintainOPILinks As Boolean

PrintPostScript

Description

The MaintainOPILinks property allows a Service Bureau to substitute high resolution images for the low resolution images in the file.

Example

The following example sets the MaintainOPILinks and ResolveDCSLinks properties to True, and prints the document to a file.

Sub Test()

With ActiveDocument

.PrintSettings.PostScript.MaintainOPILinks = True

.PrintSettings.PostScript.ResolveDCSLinks = True

.PrintSettings.FileName = "c:\Temp.ps"

.PrintSettings.PrintToFile = True

.PrintOut

End With

End Sub

 Related Topics


PrintPostScript.MaxPointsPerCurve

Property MaxPointsPerCurve As Long

PrintPostScript

Description

The MaxPointsPerCurve property returns or sets the maximum allowable number of control points per curve.

Example

The following example displays the current value of the MaxPointsPerCurve property. It then sets the value to one-half of the previous value and displays the new value.

Sub Test()

With ActiveDocument

MsgBox "The current value of MaxPointsPerCurve is " & _

.PrintSettings.PostScript.MaxPointsPerCurve

.PrintSettings.PostScript.MaxPointsPerCurve = .PrintSettings.PostScript.MaxPointsPerCurve / 2

MsgBox "The current value of MaxPointsPerCurve is " & _

.PrintSettings.PostScript.MaxPointsPerCurve

End With

End Sub

 Related Topics


PrintPostScript.OptimizeFountainFills

Property OptimizeFountainFills As Boolean

PrintPostScript

Description

The OptimizeFountainFills property determines whether the print engine decreases the number of fountain steps. When this property is set to True, the print engine makes the decrease if it is necessary.

Example

Creates a rectangle, fills it with a conical fountain fill with 256 steps, sets OptimizeFountainFills to True and prints the document.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(2, 4, 6, 8)

s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(0, 255, 0), cdrConicalFountainFill, , 256

With ActiveDocument

.PrintSettings.PostScript.OptimizeFountainFills = True

.PrintOut

End With

End Sub

 Related Topics


PrintPostScript.PDFBookmarks

Property PDFBookmarks As Boolean

PrintPostScript

Description

The PDFBookmarks property determines whether bookmarks are included in the resulting PDF file when a CorelDRAW PostScript file is distilled to a PDF file.

Example

The following example sets options for a PDF file which is distilled from a CorelDRAW PostScript file. The resulting PDF file will display the document outlines on startup in Adobe Acrobat. The file will also contain hyperlinks and bookmarks.

Sub TestPDF()

With ActiveDocument.PrintSettings.PostScript

.PDFStartup = prnPDFOutlines

.PDFBookmarks = True

.PDFHyperlinks = True

End With

End Sub

 Related Topics


PrintPostScript.PDFHyperlinks

Property PDFHyperlinks As Boolean

PrintPostScript

Description

The PDFHyperlinks property determines whether hyperlinks  are included in the resulting PDF file when a CorelDRAW PostScript file is distilled to a PDF file.

Example

The following example sets options for a PDF file which is distilled from a CorelDRAW PostScript file. The resulting PDF file will display the document outlines on startup in Adobe Acrobat. The file will also contain hyperlinks and bookmarks.

Sub TestPDF()

With ActiveDocument.PrintSettings.PostScript

.PDFStartup = prnPDFOutlines

.PDFBookmarks = True

.PDFHyperlinks = True

End With

End Sub

 Related Topics


PrintPostScript.PDFStartup

Property PDFStartup As PrnPDFStartup

PrintPostScript

Description

The PDFBookmarks property determines whether bookmarks are included in the resulting PDF file when a CorelDRAW PostScript file is distilled to a PDF file.

Example

The following example sets options for a PDF file which is distilled from a CorelDRAW PostScript file. The resulting PDF file will display the document outlines on startup in Adobe Acrobat. The file will also contain hyperlinks and bookmarks.

Sub TestPDF()

With ActiveDocument.PrintSettings.PostScript

.PDFStartup = prnPDFOutlines

.PDFBookmarks = True

.PDFHyperlinks = True

End With

End Sub

 Related Topics


PrintPostScript.ResolveDCSLinks

Property ResolveDCSLinks As Boolean

PrintPostScript

Description

The ResolveDCSLinks property allows a Service Bureau to substitute high resolution images for the low resolution images in the file.

Example

The following example sets the MaintainOPILinks and ResolveDCSLinks properties to True, and prints the document to a file.

Sub Test()

With ActiveDocument

.PrintSettings.PostScript.MaintainOPILinks = True

.PrintSettings.PostScript.ResolveDCSLinks = True

.PrintSettings.FileName = "c:\Temp.ps"

.PrintSettings.PrintToFile = True

.PrintOut

End With

End Sub

 Related Topics


PrintPostScript.ScreenFrequency

Property ScreenFrequency As Long

PrintPostScript

Description

The ScreenFrequency property returns or sets the basic halftone screen frequency of the print job in lines per inch (lpi).

Example

The following example sets the screen frequency to 120 lpi.

Sub Test()

With ActiveDocument.PrintSettings.PostScript

.ScreenFrequency = 120

End With

End Sub

 Related Topics


PrintPostScript.TrueTypeToType1

Property TrueTypeToType1 As Boolean

PrintPostScript

Description

The TrueTypeToType1 property controls the download of TrueType fonts to a PostScript printer. TrueType fonts are converted to Type 1 fonts so that they can be downloaded. If fonts are not downloaded to the printer (and they are not already installed on the printer), the fonts print as curves or bitmaps.

Example

The following example creates text strings in different fonts and prints them. The fonts are downloaded to the printer (if it is PostScript), and the document is printed again.

Sub Test()

Dim s As Shape

Dim n As Integer

Dim dLeft As Double

Dim dBottom As Double

dLeft = 0.25

dBottom = ActivePage.SizeHeight - 0.4

For n = 1 To FontList.Count Step 5

Set s = ActiveLayer.CreateArtisticText(dLeft, dBottom, "Some Text String")

s.Text.FontProperties.Name = FontList(n)

dBottom = dBottom - 0.4

Next n

With ActiveDocument

.PrintSettings.PostScript.DownloadType1 = False

.PrintSettings.PostScript.TrueTypeToType1 = False

.PrintOut

.PrintSettings.PostScript.DownloadType1 = True

.PrintSettings.PostScript.TrueTypeToType1 = True

.PrintOut

End With

End Sub

 Related Topics


PrintPrepress properties

PrintPrepress     Legend

      ColorCalibrationBar
      CropMarks
      Densities
      DensitometerScale
      ExteriorCropMarks
      FileInfo
      InfoWithinPage
      Invert
      JobName
      Mirror
      PageNumbers
      RegistrationMarks
      RegistrationStyle


PrintPrepress

Class PrintPrepress

Properties     Referenced By

The PrintPrepress class represents the prepess settings in the print engine.

 Related Topics


PrintPrepress.ColorCalibrationBar

Property ColorCalibrationBar As Boolean

PrintPrepress

Description

The ColorCalibrationBar property prints a bar of six basic colors when set to True.

Example

The following example creates a new document containing four rectangles. Each rectangle is filled with a different color (cyan, magenta, yellow, or black). A calibration bar is added, and then the document is printed.

Sub PrePressColorCalibrationBar()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

Set s = ActiveLayer.CreateRectangle(0.667008, 10.302205, 2.906378, 8.062835, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(4.77252, 10.351969, 6.987008, 8.13748, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(0.990472, 6.569921, 3.105433, 4.454961, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(4.872047, 6.81874, 7.01189, 4.678898, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 0, 0, 100

s.Outline.Type = cdrNoOutline

With doc

With .PrintSettings

.Options.MarksToPage = True

.Prepress.ColorCalibrationBar = True

End With

.PrintOut

End With

End Sub

 Related Topics


PrintPrepress.CropMarks

Property CropMarks As Boolean

PrintPrepress

Description

The CropMarks property determines whether crop and fold marks that reside within the page are printed.

Example

The following example creates a new document containing two rectangles. Each rectangle is filled with a different color (cyan and magenta). The document and any crop marks that appear within the page are then printed.

Sub Test()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

Set s = ActiveLayer.CreateRectangle(0.667008, 10.302205, 2.906378, 8.062835, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(4.77252, 10.351969, 6.987008, 8.13748, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

With doc

With .PrintSettings

.Prepress.CropMarks = True

.Prepress.ExteriorCropMarks = False

.Options.MarksToPage = True

End With

   .PrintOut

End With

End Sub

 Related Topics


PrintPrepress.Densities

Property Densities(ByVal Index As Long) As Long

PrintPrepress

Description

The Densities property returns or sets the density of the squares in the densitometer scale.

Parameters	Description

Index	Specifies a square in the densitometer scale [in]

Example

The following example creates a new document containing four shapes of a different color. It sets the density of the second square in the densitometer scale to 15. When the document is printed, the densitometer scale is also printed.

Sub DensityTest()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

Set s = ActiveLayer.CreateEllipse(0.766535, 9.928976, 3.180079, 7.515433, 90#, 90#, False)

s.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreatePolygon(5.643386, 9.953858, 8.355512, 7.241732, 5, 1, 1, False, 50, 100)

s.Move -0.870866, 0.174173

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateGridBoxes(1.388583, 5.699055, 3.279606, 3.658748, 4, 3)

s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

Set s = ActiveLayer.CreateRectangle(5.295039, 5.723937, 7.061654, 3.957323, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 0, 0, 100

s.Outline.Type = cdrNoOutline

With doc

With .PrintSettings

.Prepress.Densities(1) = 15

.Prepress.DensitometerScale = True

.Options.MarksToPage = True

End With

   .PrintOut

End With

End Sub

 Related Topics


PrintPrepress.DensitometerScale

Property DensitometerScale As Boolean

PrintPrepress

Description

The DensitometerScale property returns or sets whether a densitometer scale is printed in the document.

Example

The following example creates a new document containing four shapes of a different color. It sets the density of the second square in the densitometer scale to 15. When the document is printed, the densitometer scale is also printed.

Sub DensityTest()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

Set s = ActiveLayer.CreateEllipse(0.766535, 9.928976, 3.180079, 7.515433, 90#, 90#, False)

s.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreatePolygon(5.643386, 9.953858, 8.355512, 7.241732, 5, 1, 1, False, 50, 100)

s.Move -0.870866, 0.174173

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateGridBoxes(1.388583, 5.699055, 3.279606, 3.658748, 4, 3)

s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

Set s = ActiveLayer.CreateRectangle(5.295039, 5.723937, 7.061654, 3.957323, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 0, 0, 100

s.Outline.Type = cdrNoOutline

With doc

With .PrintSettings

.Prepress.Densities(1) = 15

.Prepress.DensitometerScale = True

.Options.MarksToPage = True

End With

   .PrintOut

End With

End Sub

 Related Topics


PrintPrepress.ExteriorCropMarks

Property ExteriorCropMarks As Boolean

PrintPrepress

Description

The ExteriorCropMarks property determines whether crop and fold marks that reside outside the page are printed.

Example

The following example creates a new document containing two rectangles. Each rectangle is filled with a different color (cyan and magenta). The document and any crop marks that appear within the page are then printed.

Sub Test()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

Set s = ActiveLayer.CreateRectangle(0.667008, 10.302205, 2.906378, 8.062835, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(4.77252, 10.351969, 6.987008, 8.13748, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

With doc

With .PrintSettings

.Prepress.CropMarks = True

.Prepress.ExteriorCropMarks = False

.Options.MarksToPage = True

End With

   .PrintOut

End With

End Sub

 Related Topics


PrintPrepress.FileInfo

Property FileInfo As Boolean

PrintPrepress

Description

The FileInfo property specifies whether the file information is printed.

Example

The following example creates a new document and adds three pages to it. It specifies that file information is to be printed, along with the job name and page numbers. As it iterates through the pages of the document, it adds text to each page and then prints the entire document.

Sub Test()

Dim doc As Document

Dim page As page

Set doc = CreateDocument

With doc

.AddPages 3

With .PrintSettings.Prepress

.FileInfo = True

.JobName = "Test of VBA methods"

.PageNumbers = True

.InfoWithinPage = True

End With

For Each page In doc.Pages

page.ActiveLayer.CreateArtisticText page.SizeWidth / 2, page.SizeHeight / 2, "This is page " & page.Index

Next page

.PrintOut

End With

End Sub

 Related Topics


PrintPrepress.InfoWithinPage

Property InfoWithinPage As Boolean

PrintPrepress

Description

The InfoWithinPage property specifies whether the file information is positioned within the page when printed.

Example

The following example creates a new document and adds three pages to it. It specifies that file information is to be printed, along with the job name and page numbers. As it iterates through the pages of the document, it adds text to each page and then prints the entire document.

Sub Test()

Dim doc As Document

Dim page As page

Set doc = CreateDocument

With doc

.AddPages 3

With .PrintSettings.Prepress

.FileInfo = True

.JobName = "Test of VBA methods"

.PageNumbers = True

.InfoWithinPage = True

End With

For Each page In doc.Pages

page.ActiveLayer.CreateArtisticText page.SizeWidth / 2, page.SizeHeight / 2, "This is page " & page.Index

Next page

.PrintOut

End With

End Sub

 Related Topics


PrintPrepress.Invert

Property Invert As Boolean

PrintPrepress

Description

The Invert property determines whether the print job produces negative images on film.

Example

The following example sets the Invert property to True and prints the document.

Sub Test()

With ActiveDocument

.PrintSettings.Prepress.Invert = True

.PrintOut

End With

End Sub

 Related Topics


PrintPrepress.JobName

Property JobName As String

PrintPrepress

Description

The JobName property specifies whether the job name is printed.

Example

The following example creates a new document and adds three pages to it. It specifies that file information is to be printed, along with the job name and page numbers. As it iterates through the pages of the document, it adds text to each page and then prints the entire document.

Sub Test()

Dim doc As Document

Dim page As page

Set doc = CreateDocument

With doc

.AddPages 3

With .PrintSettings.Prepress

.FileInfo = True

.JobName = "Test of VBA methods"

.PageNumbers = True

.InfoWithinPage = True

End With

For Each page In doc.Pages

page.ActiveLayer.CreateArtisticText page.SizeWidth / 2, page.SizeHeight / 2, "This is page " & page.Index

Next page

.PrintOut

End With

End Sub

 Related Topics


PrintPrepress.Mirror

Property Mirror As Boolean

PrintPrepress

Description

The Mirror property determines whether the film emulsion faces down.

Example

The following example prints the document with the emulsion facing up, and then prints the document again with the emulsion facing down.

Sub Test()

With ActiveDocument

.PrintSettings.Prepress.Mirror = False

.PrintOut

.PrintSettings.Prepress.Mirror = True

.PrintOut

End With

End Sub

 Related Topics


PrintPrepress.PageNumbers

Property PageNumbers As Boolean

PrintPrepress

Description

The PageNumbers property specifies whether the page numbers are printed.

Example

The following example creates a new document and adds three pages to it. It specifies that file information is to be printed, along with the job name and page numbers. As it iterates through the pages of the document, it adds text to each page and then prints the entire document.

Sub Test()

Dim doc As Document

Dim page As page

Set doc = CreateDocument

With doc

.AddPages 3

With .PrintSettings.Prepress

.FileInfo = True

.JobName = "Test of VBA methods"

.PageNumbers = True

.InfoWithinPage = True

End With

For Each page In doc.Pages

page.ActiveLayer.CreateArtisticText page.SizeWidth / 2, page.SizeHeight / 2, "This is page " & page.Index

Next page

.PrintOut

End With

End Sub

 Related Topics


PrintPrepress.RegistrationMarks

Property RegistrationMarks As Boolean

PrintPrepress

Description

The RegistrationMarks property determines whether registration marks are printed. You can use the RegistrationStyle property to choose the style of the registration marks.

Example

The following example specifies that Corel registration marks print within the page. It displays the Print dialog box and then prints the document.

Sub Test()

With ActiveDocument

With .PrintSettings.Prepress

.RegistrationMarks = True

.RegistrationStyle = prnCorel

End With

.PrintSettings.Options.MarksToPage = True

.PrintSettings.ShowDialog

.PrintOut

End With

End Sub

 Related Topics


PrintPrepress.RegistrationStyle

Property RegistrationStyle As PrnRegistrationStyle

PrintPrepress

Description

The RegistrationStyle property determines the style of the registration marks that are printed. In order to print the registration marks, you must enable the RegistrationMarks property.

Example

The following example specifies that Corel registration marks print within the page. It displays the Print dialog box and then prints the document.

Sub Test()

With ActiveDocument

With .PrintSettings.Prepress

.RegistrationMarks = True

.RegistrationStyle = prnCorel

End With

.PrintSettings.Options.MarksToPage = True

.PrintSettings.ShowDialog

.PrintOut

End With

End Sub

 Related Topics


PrintSeparations properties

PrintSeparations     Legend

      AdvancedSettings
      AlwaysOverprintBlack
      AutoSpreadAmount
      AutoSpreadFixed
      AutoSpreading
      AutoSpreadTextAbove
      BasicScreen
      EmptyPlates
      Enabled
      HalftoneType
      Hexachrome
      InColor
    Plates
      PreserveOverprints
      Resolution
      ScreenTechnology
      SpotToCMYK


PrintSeparations

Class PrintSeparations

Properties     Referenced By

The PrintSeparations class represents the separations settings in the print engine.

 Related Topics


PrintSeparations.AdvancedSettings

Property AdvancedSettings As Boolean

PrintSeparations

Description

The AdvancedSettings property determines whether advanced separations settings are used. These settings allow for greater control when printing separations.

Example

The following example iterates through the SystemPrinters collection until it finds the specified printer. It enables print separations and sets advanced settings. The Print dialog box is then displayed.

Sub Test()

Dim prn As Printer

Dim intCounter As Integer

For intCounter = 1 To Printers.Count

Set prn = Printers.Item(intCounter)

If prn.Name = "Device Independent PostScript File" Then

Exit For

End If

Next intCounter

With ActiveDocument

With .PrintSettings

Set .Printer = prn

With .Separations

.Enabled = True

.AdvancedSettings = True

.ScreenTechnology = "RT Screening - Lino 330"

.Resolution = 1270

.BasicScreen = "109"

End With

.ShowDialog

End With

End With

End Sub

 Related Topics


PrintSeparations.AlwaysOverprintBlack

Property AlwaysOverprintBlack As Boolean

PrintSeparations

Description

The AlwaysOverprintBlack property determines whether black will always be overprinted.

Example

The following example creates a new document and inserts two overlapping rectangles. Uniform fills of different colors (cyan and magenta) are applied to the rectangles, and an outline of 24pt is added to the overlying rectangle. Before the document is printed, separations are enabled.

Sub Test()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

With doc

Set s = .ActiveLayer.CreateRectangle(2.209685, 8.809291, 5.742913, 6.196693, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s.Outline.Type = cdrNoOutline

Set s = .ActiveLayer.CreateRectangle(3.578189, 7.838898, 7.285591, 5.251181, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Width = 0.333335

With .PrintSettings.Separations

.Enabled = True

.AlwaysOverprintBlack = False

End With

.PrintOut

End With

End Sub

 Related Topics


PrintSeparations.AutoSpreadAmount

Property AutoSpreadAmount As Double

PrintSeparations

Description

The AutoSpreadAmount property returns or sets the maximum width of an outline for auto-spreading.

Example

The following example iterates through the SystemPrinters collection until it finds the specified printer. In a new document, it creates five shapes. It then enables print separations and auto-spreading. The Print dialog box is then displayed.

Sub Test()

Dim doc As Document

Dim s As Shape

Dim prn As Printer

Dim intCounter As Integer

For intCounter = 1 To Printers.Count

Set prn = Printers.Item(intCounter)

If prn.Name = "Device Independent PostScript File" Then

Exit For

End If

Next intCounter

Set doc = CreateDocument

With doc

Set s = .ActiveLayer.CreateEllipse(0.592362, 10.426614, 7.534409, 7.366142, 90#, 90#, False)

s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s.Outline.Type = cdrNoOutline

Set s = .ActiveLayer.CreateArtisticText(1.25, 8.85, "This is a test of text")

s.Text.FontProperties.Size = 48

Set s = .ActiveLayer.CreateRectangle(1.712047, 6.321102, 5.668268, 4.654016, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

Set s = .ActiveLayer.CreateRectangle(3.926535, 5.599528, 7.335354, 3.459685, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

Set s = .ActiveLayer.CreateRectangle(0.642126, 5.276063, 5.071102, 2.215591, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 100, 100, 0, 0

s.Outline.Type = cdrNoOutline

With .PrintSettings

Set .Printer = prn

With .Separations

.Enabled = True

.AutoSpreadAmount = 3527.77778

.AutoSpreading = True

.AutoSpreadTextAbove = 254000

End With

.ShowDialog

End With

End With

End Sub

 Related Topics


PrintSeparations.AutoSpreadFixed

Property AutoSpreadFixed As Boolean

PrintSeparations

Description

The AutoSpreadFixed property returns or sets outlines of equal width for auto-spreading.

Example

The following example displays the current value of the AutoSpreadFixed property.

Sub Test()

With ActiveDocument

MsgBox "The current value for AutoSpreadFixed is " & _

.PrintSettings.Separations.AutoSpreadFixed

End With

End Sub

 Related Topics


PrintSeparations.AutoSpreading

Property AutoSpreading As Boolean

PrintSeparations

Description

The AutoSpreading property determines whether auto-spreading is enabled.

Example

The following example iterates through the SystemPrinters collection until it finds the specified printer. In a new document, it creates five shapes. It then enables separations and auto-spreading. The Print dialog box is then displayed.

Sub Test()

Dim doc As Document

Dim s As Shape

Dim prn As Printer

Dim intCounter As Integer

For intCounter = 1 To Printers.Count

Set prn = Printers.Item(intCounter)

If prn.Name = "Device Independent PostScript File" Then

Exit For

End If

Next intCounter

Set doc = CreateDocument

With doc

Set s = .ActiveLayer.CreateEllipse(0.592362, 10.426614, 7.534409, 7.366142, 90#, 90#, False)

s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s.Outline.Type = cdrNoOutline

Set s = .ActiveLayer.CreateArtisticText(1.25, 8.85, "This is a test of text")

s.Text.FontProperties.Size = 48

Set s = .ActiveLayer.CreateRectangle(1.712047, 6.321102, 5.668268, 4.654016, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

Set s = .ActiveLayer.CreateRectangle(3.926535, 5.599528, 7.335354, 3.459685, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

Set s = .ActiveLayer.CreateRectangle(0.642126, 5.276063, 5.071102, 2.215591, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 100, 100, 0, 0

s.Outline.Type = cdrNoOutline

With .PrintSettings

Set .Printer = prn

With .Separations

.Enabled = True

.AutoSpreadAmount = 3527.77778

.AutoSpreading = True

.AutoSpreadTextAbove = 254000

End With

.ShowDialog

End With

End With

End Sub

 Related Topics


PrintSeparations.AutoSpreadTextAbove

Property AutoSpreadTextAbove As Double

PrintSeparations

Description

The AutoSpreadTextAbove property returns or sets the minimum width of an outline for auto-spreading.

Example

The following example iterates through the SystemPrinters collection until it finds the specified printer. In a new document, it creates five shapes. It then enables separations and auto-spreading. The Print dialog box is then displayed.

Sub Test()

Dim doc As Document

Dim s As Shape

Dim prn As Printer

Dim intCounter As Integer

For intCounter = 1 To Printers.Count

Set prn = Printers.Item(intCounter)

If prn.Name = "Device Independent PostScript File" Then

Exit For

End If

Next intCounter

Set doc = CreateDocument

With doc

Set s = .ActiveLayer.CreateEllipse(0.592362, 10.426614, 7.534409, 7.366142, 90#, 90#, False)

s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s.Outline.Type = cdrNoOutline

Set s = .ActiveLayer.CreateArtisticText(1.25, 8.85, "This is a test of text")

s.Text.FontProperties.Size = 48

Set s = .ActiveLayer.CreateRectangle(1.712047, 6.321102, 5.668268, 4.654016, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

Set s = .ActiveLayer.CreateRectangle(3.926535, 5.599528, 7.335354, 3.459685, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

Set s = .ActiveLayer.CreateRectangle(0.642126, 5.276063, 5.071102, 2.215591, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 100, 100, 0, 0

s.Outline.Type = cdrNoOutline

With .PrintSettings

Set .Printer = prn

With .Separations

.Enabled = True

.AutoSpreadAmount = 3527.77778

.AutoSpreading = True

.AutoSpreadTextAbove = 254000

End With

.ShowDialog

End With

End With

End Sub

 Related Topics


PrintSeparations.BasicScreen

Property BasicScreen As String

PrintSeparations

Description

The BasicScreen property returns or sets the basic screen used for printing separations.

In order to use this property, the AdvancedSettings property must be set to True.

Example

The following example iterates through the SystemPrinters collection until it finds the specified printer. It then enables print separations and sets advanced settings. The Print dialog box is then displayed.

Sub Test()

Dim prn As Printer

Dim intCounter As Integer

For intCounter = 1 To Printers.Count

Set prn = Printers.Item(intCounter)

If prn.Name = "Device Independent PostScript File" Then

Exit For

End If

Next intCounter

With ActiveDocument

With .PrintSettings

Set .Printer = prn

With .Separations

.Enabled = True

.AdvancedSettings = True

.ScreenTechnology = "RT Screening - Lino 330"

.Resolution = 1270

.BasicScreen = "109"

End With

.ShowDialog

End With

End With

End Sub

 Related Topics


PrintSeparations.EmptyPlates

Property EmptyPlates As Boolean

PrintSeparations

Description

The EmptyPlates property determines whether all plates, including empty ones, are printed.

Example

The following example creates two rectangles with uniform fills. It then enables print separations and prints all four plates.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(1.239291, 7.590079, 4.050945, 4.778425, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(2.607795, 6.395748, 5.344803, 3.65874, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

With ActiveDocument

With .PrintSettings

.Separations.Enabled = True

.Separations.EmptyPlates = True

.ShowDialog

End With

End With

End Sub

 Related Topics


PrintSeparations.Enabled

Property Enabled As Boolean

PrintSeparations

Description

The PrintSeparations property determines whether separations are printed.

Example

The following example enables separations and displays the Print dialog box.

Sub Test()

With ActiveDocument

With .PrintSettings

.Separations.Enabled = True

.ShowDialog

End With

End With

End Sub

 Related Topics


PrintSeparations.HalftoneType

Property HalftoneType As String

PrintSeparations

Description

The HalftoneType property returns the selected halftone type.

This property is reserved for future development.

 Related Topics


PrintSeparations.Hexachrome

Property Hexachrome As Boolean

PrintSeparations

Description

The Hexachrome property determines whether PANTONE Hexachrome process colors are used.

Example

The following example creates two rectangles with uniform fills. It then enables separations and Hexachrome colors. The Print dialog box is then displayed.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(1.239291, 7.590079, 4.050945, 4.778425, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(2.607795, 6.395748, 5.344803, 3.65874, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

With ActiveDocument

With .PrintSettings

.Separations.Enabled = True

.Separations.Hexachrome = True

.ShowDialog

End With

End With

End Sub

 Related Topics


PrintSeparations.InColor

Property InColor As Boolean

PrintSeparations

Description

The InColor property determines whether separations are printed in color.

Example

The following example iterates through the SystemPrinters collection until it finds the specified printer. It then enables color separations and displays the Print dialog box.

Sub Test()

Dim prn As Printer

Dim intCounter As Integer

For intCounter = 1 To Printers.Count

Set prn = Printers.Item(intCounter)

If prn.ColorEnabled Then

Exit For

End If

Next intCounter

With ActiveDocument

With .PrintSettings

Set .Printer = prn

.Separations.Enabled = True

.Separations.InColor = True

.ShowDialog

End With

End With

End Sub

 Related Topics


PrintSeparations.Plates

Property Plates As SeparationPlates

PrintSeparations

Description

The Plates property returns a reference to the SeparationPlates collection.

Read-Only

Example

The following example displays the number of items in the SeparationPlates collection.

Sub Test()

Dim Seps As SeparationPlates

With ActiveDocument

With .PrintSettings

Set Seps = .Separations.Plates

.Separations.Enabled = True

MsgBox "There are " & Seps.Count & " plates."

End With

End With

End Sub

 Related Topics


PrintSeparations.PreserveOverprints

Property PreserveOverprints As Boolean

PrintSeparations

Description

The PreserveOverprints property determines whether the document's overprint settings are maintained in the print job.

Example

The following example creates two overlapping rectangles with uniform fills. It then enables separations, sets the PreseveOverprints property to True, and prints the document.

Sub Test()

Dim s As Shape

Dim doc As Document

Set doc = CreateDocument

With doc

Set s = .ActiveLayer.CreateRectangle(2.110157, 9.605512, 5.69315, 6.94315, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

s.Outline.Type = cdrNoOutline

Set s = .ActiveLayer.CreateRectangle(3.428898, 8.859055, 7.111417, 5.89811, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Width = 0.33333

s.Outline.Color.CMYKAssign 0, 100, 0, 0

s.OverprintOutline = True

With .PrintSettings.Separations

.PreserveOverprints = True

.Enabled = True

End With

.PrintOut

End With

End Sub

 Related Topics


PrintSeparations.Resolution

Property Resolution As Long

PrintSeparations

Description

The Resolution property returns or sets the resolution used for printing separations.

In order to use this property, the AdvancedSettings property must be set to True.

Example

The following example iterates through the SystemPrinters collection until it finds the specified printer. It then enables separations and sets advanced settings. The Print dialog box is then displayed.

Sub Test()

Dim prn As Printer

Dim intCounter As Integer

For intCounter = 1 To Printers.Count

Set prn = Printers.Item(intCounter)

If prn.Name = "Device Independent PostScript File" Then

Exit For

End If

Next intCounter

With ActiveDocument

With .PrintSettings

Set .Printer = prn

With .Separations

.Enabled = True

.AdvancedSettings = True

.ScreenTechnology = "RT Screening - Lino 330"

.Resolution = 1270

.BasicScreen = "109"

End With

.ShowDialog

End With

End With

End Sub

 Related Topics


PrintSeparations.ScreenTechnology

Property ScreenTechnology As String

PrintSeparations

Description

The ScreenTechnology property returns or sets the screening technology used for printing separations.

In order to use this property, the AdvancedSettings property must be set to True.

Example

The following example iterates through the SystemPrinters collection until it finds the specified printer. It enables separations and sets advanced settings. The Print dialog box is then displayed.

Sub Test()

Dim prn As Printer

Dim intCounter As Integer

For intCounter = 1 To Printers.Count

Set prn = Printers.Item(intCounter)

If prn.Name = "Device Independent PostScript File" Then

Exit For

End If

Next intCounter

With ActiveDocument

With .PrintSettings

Set .Printer = prn

With .Separations

.Enabled = True

.AdvancedSettings = True

.ScreenTechnology = "RT Screening - Lino 330"

.Resolution = 1270

.BasicScreen = "109"

End With

.ShowDialog

End With

End With

End Sub

 Related Topics


PrintSeparations.SpotToCMYK

Property SpotToCMYK As Boolean

PrintSeparations

Description

The SpotToCMYK property determines whether spot colors are converted to process colors.

Example

The following example creates a new document containing four rectangles with Pantone fills. It then enables separations, converts Pantone colors to CMYK, and displays the Print dialog box.

Sub Test()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

With doc

Set s = .ActiveLayer.CreateRectangle(0.965591, 10.351969, 2.781969, 8.535591, 0, 0, 0, 0)

s.Fill.UniformColor.FixedAssign cdrPANTONECoated, 12

s.Outline.Type = cdrNoOutline

Set s = .ActiveLayer.CreateRectangle(4.747638, 10.327087, 6.564016, 8.510709, 0, 0, 0, 0)

s.Fill.UniformColor.FixedAssign cdrPANTONECoated, 60

s.Outline.Type = cdrNoOutline

Set s = .ActiveLayer.CreateRectangle(1.09, 7.067559, 2.93126, 5.226299, 0, 0, 0, 0)

s.Fill.UniformColor.FixedAssign cdrPANTONECoated, 120

s.Outline.Type = cdrNoOutline

Set s = .ActiveLayer.CreateRectangle(4.424173, 7.191969, 6.389843, 5.226299, 0, 0, 0, 0)

s.Fill.UniformColor.FixedAssign cdrPANTONECoated, 180

s.Outline.Type = cdrNoOutline

With .PrintSettings

With .Separations

.Enabled = True

.SpotToCMYK = True

End With

.ShowDialog

End With

End With

End Sub

 Related Topics


PrintSettings properties

PrintSettings     Legend

      Collate
      Copies
      FileMode
      FileName
      ForMac
    Options
      PageRange
    PostScript
      PPDFile
    Prepress
      Printer
      PrintRange
      PrintToFile
    Separations
    Trapping
      UsePPD


PrintSettings methods

PrintSettings     Legend

   Load
   Reset
   Save
   ShowDialog


PrintSettings

Class PrintSettings

Properties     Methods     Referenced By

The PrintSettings class represents the settings in the CorelDRAW print engine.

 Related Topics


PrintSettings.Collate

Property Collate As Boolean

PrintSettings

Description

The Collate property determines whether the pages of a document print together when you print several copies of a document. The number of copies to be printed is set by the Copies property.

Example

The following example creates a new document containing two pages. It adds the page number to each page and then prints three collated copies of the document.

Sub Test()

Dim doc As Document

Dim page As page

Set doc = CreateDocument

With doc

.AddPages 2

For Each page In .Pages

page.ActiveLayer.CreateArtisticText page.SizeWidth / 2, page.SizeHeight / 2, "This is page " & page.Index

Next page

.PrintSettings.Copies = 3

.PrintSettings.Collate = True

.PrintOut

End With

End Sub

 Related Topics


PrintSettings.Copies

Property Copies As Long

PrintSettings

Description

The Copies property returns or sets the number of copies of a document to be printed. You can ensure that the pages of the document print together by setting the Collate property.

Example

The following example creates a new document containing two pages. It adds the page number to each page and then prints three collated copies of the document.

Sub Test()

Dim doc As Document

Dim page As page

Set doc = CreateDocument

With doc

.AddPages 2

For Each page In .Pages

page.ActiveLayer.CreateArtisticText page.SizeWidth / 2, page.SizeHeight / 2, "This is page " & page.Index

Next page

.PrintSettings.Copies = 3

.PrintSettings.Collate = True

.PrintOut

End With

End Sub

 Related Topics


PrintSettings.FileMode

Property FileMode As PrnFileMode

PrintSettings

Description

The FileMode property returns or sets the output of pages or plates when printing to a file.

Example

The following example creates a new document containing three shapes and prints the document to a file.

Sub Test()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

Set s = ActiveLayer.CreateRectangle(1.114882, 10.078268, 3.030787, 8.485827, 0, 0, 0, 0)

Set s = ActiveLayer.CreateEllipse(4.075827, 7.540315, 6.016614, 5.375591, 90#, 90#, False)

Set s = ActiveLayer.CreatePolygon(5.842445, 2.912283, 7.758343, 0.44898, 5, 1, 1, False, 50, 100)

With doc

With .PrintSettings

.PrintToFile = True

.ForMac = False

.FileMode = prnSingleFile

.FileName = "C:\Temp.prn"

End With

.PrintOut

End With

End Sub

 Related Topics


PrintSettings.FileName

Property FileName As String

PrintSettings

Description

The FileName property returns or sets the name of a file which is printed to a file.

Example

The following example creates a new document containing three shapes and prints the document to a file.

Sub Test()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

Set s = ActiveLayer.CreateRectangle(1.114882, 10.078268, 3.030787, 8.485827, 0, 0, 0, 0)

Set s = ActiveLayer.CreateEllipse(4.075827, 7.540315, 6.016614, 5.375591, 90#, 90#, False)

Set s = ActiveLayer.CreatePolygon(5.842445, 2.912283, 7.758343, 0.44898, 5, 1, 1, False, 50, 100)

With doc

With .PrintSettings

.PrintToFile = True

.ForMac = False

.FileMode = prnSingleFile

.FileName = "C:\Temp.prn"

End With

.PrintOut

End With

End Sub

 Related Topics


PrintSettings.ForMac

Property ForMac As Boolean

PrintSettings

Description

The ForMac property determines whether a file is readable on a Macintosh computer when printing to a file.

Example

The following example creates a new document containing three shapes and prints the document to a file.

Sub Test()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

Set s = ActiveLayer.CreateRectangle(1.114882, 10.078268, 3.030787, 8.485827, 0, 0, 0, 0)

Set s = ActiveLayer.CreateEllipse(4.075827, 7.540315, 6.016614, 5.375591, 90#, 90#, False)

Set s = ActiveLayer.CreatePolygon(5.842445, 2.912283, 7.758343, 0.44898, 5, 1, 1, False, 50, 100)

With doc

With .PrintSettings

.PrintToFile = True

.ForMac = False

.FileMode = prnSingleFile

.FileName = "C:\Temp.prn"

End With

.PrintOut

End With

End Sub

 Related Topics


PrintSettings.Options

Property Options As PrintOptions

PrintSettings

Description

The Options property returns the PrintOptions object.

Read-Only

Example

The following example returns a reference to the PrintOptions object and displays the current color mode.

Sub Test()

Dim DrawPrnOptions As PrintOptions

Set DrawPrnOptions = ActiveDocument.PrintSettings.Options

With DrawPrnOptions

MsgBox "The current color mode is " & .ColorMode

End With

End Sub

 Related Topics


PrintSettings.PageRange

Property PageRange As String

PrintSettings

Description

The PageRange property specifies which pages to print. In order to use this property, the PrintRange property must be set to prnPageRange.

Example

The following example creates a new document containing four pages with page numbers. It then prints pages two and four.

Sub Test()

Dim doc As Document

Dim page As page

Dim DrwPrnSettings As PrintSettings

Set doc = CreateDocument

doc.AddPages 4

For Each page In doc.Pages

page.ActiveLayer.CreateArtisticText page.SizeWidth / 2, page.SizeHeight / 2, "This is page " & page.Index

Next page

Set DrwPrnSettings = ActiveDocument.PrintSettings

With DrwPrnSettings

.PrintRange = prnPageRange

.PageRange = "2,4"

End With

doc.PrintOut

End Sub

 Related Topics


PrintSettings.PostScript

Property PostScript As PrintPostScript

PrintSettings

Description

The PostScript property returns the PrintPostScript object which represents the PostScript print settings in the print engine.

Read-Only

Example

The following example displays the PostScript level of the current PostScript device.

Sub Test()

Dim DrwPostScriptSettings As PrintPostScript

Set DrwPostScriptSettings = ActiveDocument.PrintSettings.PostScript

With DrwPostScriptSettings

MsgBox "The current printing device is a PostScript level " & _

.Level & " device."

End With

End Sub

 Related Topics


PrintSettings.PPDFile

Property PPDFile As String

PrintSettings

Description

The PPDFile property specifies the name of the PPD (Postscript Printer Description) file. In order to use this property, the UsePPD property must be set to True.

Example

The following example prints the active document using the specified PPD file.

Sub Test()

With ActiveDocument.PrintSettings

.UsePPD = True

.PPDFile = "C:\WINNT4\system32\spool\drivers\w32x86\HPLJ5P_1.PPD"

End With

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintSettings.Prepress

Property Prepress As PrintPrepress

PrintSettings

Description

The Prepress property returns the PrintPrepress object which represents the prepress settings.

Read-Only

Example

The following example prints the active document with page numbers within the page.

Sub Test()

With ActiveDocument

.PrintSettings.Prepress.PageNumbers = True

.PrintSettings.Prepress.InfoWithinPage = True

.PrintOut

End With

End Sub

 Related Topics


PrintSettings.Printer

Property Printer As Printer

PrintSettings

Description

The Printer property returns a reference to the current Printer.

Example

The following example displays the name of the current printer.

Sub Test()

MsgBox "The current printer is:" & vbCr & _

ActiveDocument.PrintSettings.Printer.Name

End Sub

 Related Topics


PrintSettings.PrintRange

Property PrintRange As PrnPrintRange

PrintSettings

Description

The PrintRange property specifies whether to print a full document, a page, a selection, or a range of pages. If you choose to print a range of pages, you can specify the pages to print by using the PageRange property.

Example

The following example creates a new document containing four pages with page numbers. It then prints pages two and four.

Sub Test()

Dim doc As Document

Dim page As page

Dim DrwPrnSettings As PrintSettings

Set doc = CreateDocument

doc.AddPages 4

For Each page In doc.Pages

page.ActiveLayer.CreateArtisticText page.SizeWidth / 2, page.SizeHeight / 2, "This is page " & page.Index

Next page

Set DrwPrnSettings = ActiveDocument.PrintSettings

With DrwPrnSettings

.PrintRange = prnPageRange

.PageRange = "2,4"

End With

doc.PrintOut

End Sub

 Related Topics


PrintSettings.PrintToFile

Property PrintToFile As Boolean

PrintSettings

Description

The PrintToFile property determines whether a document is printed to a file.

Example

The following example creates a new document containing three shapes and prints the document to a file.

Sub Test()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

Set s = ActiveLayer.CreateRectangle(1.114882, 10.078268, 3.030787, 8.485827, 0, 0, 0, 0)

Set s = ActiveLayer.CreateEllipse(4.075827, 7.540315, 6.016614, 5.375591, 90#, 90#, False)

Set s = ActiveLayer.CreatePolygon(5.842445, 2.912283, 7.758343, 0.44898, 5, 1, 1, False, 50, 100)

With doc

With .PrintSettings

.PrintToFile = True

.ForMac = False

.FileMode = prnSingleFile

.FileName = "C:\Temp.prn"

End With

.PrintOut

End With

End Sub

 Related Topics


PrintSettings.Separations

Property Separations As PrintSeparations

PrintSettings

Description

The Separations property returns the PrintSeparations object.

Read-Only

Example

The following example creates a new document. Four rectangles, each filled with a different uniform color (cyan, yellow, magenta, or black) are created, and then separations are printed.

Sub Test()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

Set s = ActiveLayer.CreateRectangle(0.940709, 10.177795, 3.130315, 8.411181, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 0, 0, 100

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(1.139764, 5.201417, 3.553307, 3.111339, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(4.896929, 10.202677, 7.186063, 8.510709, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(5.245276, 5.450236, 7.683701, 3.285512, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

s.Outline.Type = cdrNoOutline

With doc

.PrintSettings.Separations.Enabled = True

.PrintOut

End With

End Sub

 Related Topics


PrintSettings.Trapping

Property Trapping As PrintTrapping

PrintSettings

Description

The Trapping property returns the PrintTrapping object.

Read-Only

Example

The following example displays the Print dialog box and then a message box with the current trapping width.

Sub Test()

With ActiveDocument.PrintSettings

.PostScript.Level = prnPSLevel3

.Separations.Enabled = False

.Trapping.Enabled = True

.ShowDialog

MsgBox "The current trapping width is " & Round((.Trapping.Width / 254000) * 72, 1) & " pt"

End With

End Sub

 Related Topics


PrintSettings.UsePPD

Property UsePPD As Boolean

PrintSettings

Description

The UsePPD property determines whether a PPD (Postscript Printer Description) file is used. If set to True, the PPDFile property can be used to specify the name of the file.

Example

The following example prints the active document using the specified PPD file.

Sub Test()

With ActiveDocument.PrintSettings

.UsePPD = True

.PPDFile = "C:\WINNT4\system32\spool\drivers\w32x86\HPLJ5P_1.PPD"

End With

ActiveDocument.PrintOut

End Sub

 Related Topics


PrintSettings.Load

Function Load(ByVal FileName As String) As Boolean

PrintSettings

Description

The Load method applies a saved print style.

Parameters	Description

FileName	Specifies the full path and filename of the saved print style [in]

Return value

Returns Boolean

Example

The following example creates a new document containing four rectangles, each filled with a different uniform color. It then creates and saves a new print style. After reverting to the default print style, it prints the document. It then loads the saved print style and prints the document again.

Sub Test()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

Set s = ActiveLayer.CreateRectangle(0.940709, 10.177795, 3.130315, 8.411181, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 0, 0, 100

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(1.139764, 5.201417, 3.553307, 3.111339, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(4.896929, 10.202677, 7.186063, 8.510709, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(5.245276, 5.450236, 7.683701, 3.285512, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

s.Outline.Type = cdrNoOutline

With doc

With .PrintSettings

.Separations.Enabled = True

.Copies = 5

.Save "c:\Seps.prs"

.Reset

End With

.PrintOut

With .PrintSettings

.Load "c:\Seps.prs"

End With

.PrintOut

End With

End Sub

 Related Topics


PrintSettings.Reset

Sub Reset()

PrintSettings

Description

The Reset method reverts to the default print style

Example

The following example creates a new document containing four rectangles, each filled with a different uniform color. It then creates and saves a new print style. After reverting to the default print style, it prints the document. It then loads the saved print style and prints the document again.

Sub Test()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

Set s = ActiveLayer.CreateRectangle(0.940709, 10.177795, 3.130315, 8.411181, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 0, 0, 100

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(1.139764, 5.201417, 3.553307, 3.111339, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(4.896929, 10.202677, 7.186063, 8.510709, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(5.245276, 5.450236, 7.683701, 3.285512, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

s.Outline.Type = cdrNoOutline

With doc

With .PrintSettings

.Separations.Enabled = True

.Copies = 5

.Save "c:\Seps.prs"

.Reset

End With

.PrintOut

With .PrintSettings

.Load "c:\Seps.prs"

End With

.PrintOut

End With

End Sub

 Related Topics


PrintSettings.Save

Function Save(ByVal FileName As String) As Boolean

PrintSettings

Description

The Save method saves a print style.

Parameters	Description

FileName	Specifies the full path and filename of the file containing the print settings [in]

Return value

Returns Boolean

Example

The following example creates a new document containing four rectangles, each filled with a different uniform color. It then creates and saves a new print style. After reverting to the default print style, it prints the document. It then loads the saved print style and prints the document again.

Sub Test()

Dim doc As Document

Dim s As Shape

Set doc = CreateDocument

Set s = ActiveLayer.CreateRectangle(0.940709, 10.177795, 3.130315, 8.411181, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 0, 0, 100

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(1.139764, 5.201417, 3.553307, 3.111339, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(4.896929, 10.202677, 7.186063, 8.510709, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 0, 100, 0, 0

s.Outline.Type = cdrNoOutline

Set s = ActiveLayer.CreateRectangle(5.245276, 5.450236, 7.683701, 3.285512, 0, 0, 0, 0)

s.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

s.Outline.Type = cdrNoOutline

With doc

With .PrintSettings

.Separations.Enabled = True

.Copies = 5

.Save "c:\Seps.prs"

.Reset

End With

.PrintOut

With .PrintSettings

.Load "c:\Seps.prs"

End With

.PrintOut

End With

End Sub

 Related Topics


PrintSettings.ShowDialog

Function ShowDialog() As Boolean

PrintSettings

Description

The ShowDialog method displays the Print dialog box.

Return value

Returns Boolean

Example

The following example displays the Print dialog box for the first file in the specified folder, and then prints the CorelDRAW (CDR) files contained in the folder.

Sub Test()

Dim ldDocument As Document

Dim lcFolder As String

Dim lcFileName As String

Dim lcFullName As String

Dim Prn As CorelDRAW.Printer

Dim nCopies As Long

Dim bFirst As Boolean

lcFolder = "k:\cdrs\"

lcFileName$ = Dir(lcFolder & "*.cdr")

bFirst = True

While lcFileName$ <> ""

lcFullName = lcFolder & lcFileName

Set ldDocument = laCorel.OpenDocument(lcFullName)

With ldDocument.PrintSettings

If bFirst Then

If Not .ShowDialog Then Exit Sub

Set Prn = .Printer

nCopies = .Copies

bFirst = False

Else

Set .Printer = Prn

.Copies = nCopies

End If

End With

ldDocument.PrintOut

ldDocument.Close

lcFileName$ = Dir()

Wend

End Sub

 Related Topics


PrintTrapping properties

PrintTrapping     Legend

      BlackColorLimit
      BlackDensityLimit
      BlackWidth
      ColorScaling
      Enabled
      ImageTrap
      InternalImageTrapping
    Layers
      MinResolution
      ObjectsToImage
      SlidingTrapLimit
      StepLimit
      Width


PrintTrapping

Class PrintTrapping

Properties     Referenced By

The PrintTrapping class represents color trapping in the print engine.

 Related Topics


PrintTrapping.BlackColorLimit

Property BlackColorLimit As Long

PrintTrapping

Description

The BlackColorLimit property sets the threshold at which process black is considered pure black for print trapping.

Example

The following example displays the values of properties which represent the thresholds of print trapping.

Sub Test()

Dim s As String

With ActiveDocument.PrintSettings.Trapping

s = "Black Color Limit: " & .BlackColorLimit & vbCr

s = s & "Black Density Limit: " & .BlackDensityLimit & vbCr

s = s & "Sliding Trap Limit: " & .SlidingTrapLimit & vbCr

s = s & "Step Limit: " & .StepLimit

End With

MsgBox s

End Sub

 Related Topics


PrintTrapping.BlackDensityLimit

Property BlackDensityLimit As Double

PrintTrapping

Description

The BlackDensityLimit property sets the neutral density value for the black ink in print trapping.

Example

The following example displays the values of properties which represent the thresholds of print trapping.

Sub Test()

Dim s As String

With ActiveDocument.PrintSettings.Trapping

s = "Black Color Limit: " & .BlackColorLimit & vbCr

s = s & "Black Density Limit: " & .BlackDensityLimit & vbCr

s = s & "Sliding Trap Limit: " & .SlidingTrapLimit & vbCr

s = s & "Step Limit: " & .StepLimit

End With

MsgBox s

End Sub

 Related Topics


PrintTrapping.BlackWidth

Property BlackWidth As Double

PrintTrapping

Description

The BlackWidth property sets the black trap width when trapping to black.

Example

The following example sets the PostScript.Level property to level 3, changes both the trapping and the black widths, and then displays the Print dialog box.

Sub Test()

Dim s As String

With ActiveDocument.PrintSettings

.PostScript.Level = prnPSLevel3

With .Trapping

.BlackWidth = 0.6 / 72 * 254000

.Width = 0.35 / 72 * 254000

End With

.ShowDialog

End With

End Sub

 Related Topics


PrintTrapping.ColorScaling

Property ColorScaling As Long

PrintTrapping

Description

The ColorScaling property sets the amount by which the ink color in a trap decreases.

Example

The following example displays the current value for color scaling.

Sub Test()

With ActiveDocument.PrintSettings.Trapping

MsgBox "The current value for color scaling is: " & .ColorScaling

End With

End Sub

 Related Topics


PrintTrapping.Enabled

Property Enabled As Boolean

PrintTrapping

Description

The Enabled property determines whether print trapping is turned on.

Example

The following example displays the current status of print trapping and displays the Print dialog box.

Sub Test()

With ActiveDocument.PrintSettings

With .Trapping

If .Enabled = True Then

MsgBox "Print trapping is currently enabled"

Else

MsgBox "Print trapping is currently disabled"

End If

End With

.ShowDialog

End With

End Sub

 Related Topics


PrintTrapping.ImageTrap

Property ImageTrap As PrnImageTrap

PrintTrapping

Description

The ImageTrap property sets the placement of the color trap.

Example

The following example sets the placement of the trap to Choke.

Sub Test()

With ActiveDocument.PrintSettings.Trapping

.ImageTrap = prnTrapChoke

End With

End Sub

 Related Topics


PrintTrapping.InternalImageTrapping

Property InternalImageTrapping As Boolean

PrintTrapping

Description

The InternalImageTrapping property applies a color trap within an image.

Example

The following example enables image trapping.

Sub Test()

With ActiveDocument.PrintSettings

With .Trapping

.InternalImageTrapping = False

End With

.ShowDialog

End With

End Sub

 Related Topics


PrintTrapping.Layers

Property Layers As TrapLayers

PrintTrapping

Description

The Layers property returns the TrapLayers collection.

Read-Only

Example

The following example displays the number of items in the TrapLayers collection.

Sub Test()

With ActiveDocument.PrintSettings.Trapping

MsgBox .Layers.Count

End With

End Sub

 Related Topics


PrintTrapping.MinResolution

Property MinResolution As Long

PrintTrapping

Description

The MinResolution property sets the minimum resolution of an image to be considered for trapping.

Example

The following example displays the current minimum bitmap resolution.

Sub Test()

With ActiveDocument.PrintSettings

With .Trapping

MsgBox .MinResolution, vbOKOnly, "MinResolution"

End With

End With

End Sub

 Related Topics


PrintTrapping.ObjectsToImage

Property ObjectsToImage As Boolean

PrintTrapping

Description

The ObjectsToImage property determines whether vector objects are trapped to images.

Example

The following example stores the current setting of objects-to-image trapping. It displays the dialog box that shows that this option is enabled, and then restores the previous setting.

Sub Test()

Dim bObjectsToImage As Boolean

With ActiveDocument.PrintSettings

With .Trapping

bObjectsToImage = .ObjectsToImage

.ObjectsToImage = True

End With

.ShowDialog

.Trapping.ObjectsToImage = bObjectsToImage

End With

End Sub

 Related Topics


PrintTrapping.SlidingTrapLimit

Property SlidingTrapLimit As Long

PrintTrapping

Description

The SlidingTrapLimit property sets the sliding trap threshold for print trapping.

Example

The following example displays the values of properties which represent the thresholds of print trapping.

Sub Test()

Dim s As String

With ActiveDocument.PrintSettings.Trapping

s = "Black Color Limit: " & .BlackColorLimit & vbCr

s = s & "Black Density Limit: " & .BlackDensityLimit & vbCr

s = s & "Sliding Trap Limit: " & .SlidingTrapLimit & vbCr

s = s & "Step Limit: " & .StepLimit

End With

MsgBox s

End Sub

 Related Topics


PrintTrapping.StepLimit

Property StepLimit As Long

PrintTrapping

Description

The StepLimit property sets the threshold between color variations for print trapping.

Example

The following example displays the values of properties which represent the thresholds of print trapping.

Sub Test()

Dim s As String

With ActiveDocument.PrintSettings.Trapping

s = "Black Color Limit: " & .BlackColorLimit & vbCr

s = s & "Black Density Limit: " & .BlackDensityLimit & vbCr

s = s & "Sliding Trap Limit: " & .SlidingTrapLimit & vbCr

s = s & "Step Limit: " & .StepLimit

End With

MsgBox s

End Sub

 Related Topics


PrintTrapping.Width

Property Width As Double

PrintTrapping

Description

The Width property sets the amount that one color spreads into another for print trapping.

Example

The following example sets the PostScript.Level property to level 3, changes both the trapping and the black widths, and then displays the Print dialog box.

Sub Test()

Dim s As String

With ActiveDocument.PrintSettings

.PostScript.Level = prnPSLevel3

With .Trapping

.BlackWidth = 0.6 / 72 * 254000

.Width = 0.35 / 72 * 254000

End With

.ShowDialog

End With

End Sub

 Related Topics


Properties properties

Properties     Legend

    Count
    Index
    Item
    ItemByIndex


Properties methods

Properties     Legend

   Delete
   DeleteByIndex
   Description
   GetFile
   PutFile


Properties

Class Properties

Properties     Methods     Referenced By

The Properties class represents a collection of custom data items assigned to Document, Page, Layer, or Shape.

Each property item is identified by a name and ID. A name could be a program or macro name that owns the data, and the ID is any integer number.

 Related Topics


Properties.Count

Property Count As Long

Properties

Description

The Count property returns the number of data items assigned to an object.

Read-Only

Example

The following example creates an ellipse and assigns the number "2" to its properties collection. It then displays the number of elements in the collection ("1" will be displayed).

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse(0, 0, 2, 2)

s.Properties("MyMacroParam", 0) = 2

MsgBox s.Properties.Count

End Sub

 Related Topics


Properties.Index

Property Index(ByVal Name As String, ByVal ID As Long) As Long

Properties

Description

The Index property returns the index of data item with the specified item name and ID.

Read-Only

Parameters	Description

Name	Represents a string value that uniquely identifies a property [in]

ID	Represents a unique identifier of a property within CorelDRAW [in]

Example

The following example creates an ellipse and assigns two data items to it. The index value of 2 is then displayed, representing the property specified by (Name="Height", ID=0).

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse(0, 0, 2, 2)

s.Properties("Width", 0) = s.SizeWidth

s.Properties("Height", 0) = s.SizeHeight

MsgBox s.Properties.Index("Height", 0)

End Sub

 Related Topics


Properties.Item

Property Item(ByVal Name As String, ByVal ID As Long) As Variant

Properties

Description

The Item property returns the data item specified by the data name and ID.

The Item property can also be used to assign data to an object.

The Item property of the Properties collection is the default property and its reference may be omitted when accessing an item in the collection. For example, Properties.Item(MyMacroName, 5) is the same as Properties(MyMacroName, 5) - they both reference the fifth property in the collection.

Parameters	Description

Name	Represents a string value that uniquely identifies a property [in]

ID	Represents a unique identifier of a property within CorelDRAW [in]

Example

The following example creates three different custom property records in the current document and retrieves their values. The values will be saved along with the document and be available in the next session unless you delete them using Delete or DeleteByIndex methods

Sub Test()

Const MyMacroName As String = "MyTestMacro"

With ActiveDocument

.Properties(MyMacroName, 1) = "My String 1" ' String

.Properties(MyMacroName, 2) = 1	 ' Integer

.Properties(MyMacroName, 3) = Atn(1) * 4	' Double

MsgBox .Properties(MyMacroName, 1)

MsgBox .Properties(MyMacroName, 2)

MsgBox .Properties(MyMacroName, 3)

End With

End Sub

 Related Topics


Properties.ItemByIndex

Property ItemByIndex(ByVal Index As Long) As Variant

Properties

Description

The ItemByIndex property returns the data item specified by the specified index.

Read-Only

Parameters	Description

Index	Specifies the data item by its index number [in]

Example

The following example adds three data items to the document's property collection and displays the second data item.

Sub Test()

Dim p As Properties

Set p = ActiveDocument.Properties

p.Item("Item", 1) = "Draw"

p.Item("Item", 2) = "PhotoPaint"

p.Item("Item", 3) = "R.A.V.E"

MsgBox p.ItemByIndex(2)

End Sub

 Related Topics


Properties.Delete

Sub Delete(ByVal Name As String, ByVal ID As Long)

Properties

Description

The Delete method deletes the data item specified by its name and id.

Parameters	Description

Name	Represents a string value that uniquely identifies a property [in]

ID	Represents a unique identifier of a property within CorelDRAW [in]

Example

The following example retrieves all the shape references stored in the page and deletes them.

Sub DeleteStoredShapes()

Dim s As Shape, sr As New ShapeRange

Dim v As Variant

Dim Num As Long, i As Long, id As Long

v = ActivePage.Properties("ShapeArray", 0) ' Retrieving the total number of shape references stored

If Not IsNull(v) Then

ActivePage.Properties.Delete "ShapeArray", 0 ' Delete the property

Num = v

ActiveDocument.ClearSelection

For i = 1 To Num

id = ActivePage.Properties("ShapeArray", i) ' Getting the current shape's ID to find

Set s = ActivePage.FindShape(StaticID:=id)

If Not s Is Nothing Then sr.Add s ' Add the shape to the shape range

ActivePage.Properties.Delete "ShapeArray", i ' Delete the property

Next i

sr.Delete ' Delete all shapes found

Else

MsgBox "No shape references stored in the active page"

End If

End Sub

 Related Topics


Properties.DeleteByIndex

Sub DeleteByIndex(ByVal Index As Long)

Properties

Description

The DeleteByIndex method deletes the data item specified by its index number.

Parameters	Description

Index	Specifies the data item by its index number [in]

Example

The following example adds three data items to the document's property collection and then removes the second data item.

Sub Test()

Dim p As Properties

Set p = ActiveDocument.Properties

p.Item("Application", 1) = "CorelDRAW"

p.Item("Application", 2) = "Corel PHOTO-PAINT"

p.Item("Application", 3) = "R.A.V.E"

p.DeleteByIndex (2) ' Remove the second data item - "Corel PHOTO-PAINT."

End Sub

 Related Topics


Properties.Description

Sub Description(ByVal Index As Long, ByRef Name As String, ByRef ID As Long)

Properties

Description

The Description method returns the name and ID of a data item by specifying its index.

Parameters	Description

Index	Specifies the data item by its index number [in]

Name	Represents a string that uniquely identifies a property [out]

ID	Represents a unique identifier of a property within CorelDRAW [out]

Example

The following example shows the list of all properties and their values for the active document.

Sub Test()

Dim s As String, i As Long

Dim Name As String, ID As Long

s = "Document property list:"

For i = 1 To ActiveDocument.Properties.Count

ActiveDocument.Properties.Description i, Name, ID

s = s & vbCr & "<" & Name & "," & ID & "> = "

s = s & ActiveDocument.Properties.ItemByIndex(i)

Next i

MsgBox s

End Sub

 Related Topics


Properties.GetFile

Sub GetFile(ByVal Name As String, ByVal ID As Long, ByVal FileName As String)

Properties

Description

The GetFile method retrieves data previously stored by the PutFile method. The data is retrieved from the property list of an object and then saved to a file.

Parameters	Description

Name	Represents a string that uniquely identifies a property [in]

ID	Represents a unique identifier of a property within CorelDRAW [in]

FileName	Identifies the full path name of a document that is retrieved [in]

Example

The following example retrieves the file C:\Temp\MyData.dat from the property list of the active document.

Sub Test()

ActiveDocument.Properties.GetFile "DataSheet", 0, "C:\Temp\MyData.dat"

End Sub

 Related Topics


Properties.PutFile

Sub PutFile(ByVal Name As String, ByVal ID As Long, ByVal FileName As String)

Properties

Description

The PutFile method stores the contents of a file in the property list of an object.

Parameters	Description

Name	Represents a string that uniquely identifies a property [in]

ID	Represents a unique identifier of a property within CorelDRAW [in]

FileName	Identifies the full path name of a document that is retrieved [in]

Example

The following exemple stores the contents of the file C:\Temp\MyData.dat in the property list of the active document.

Sub Test()

ActiveDocument.Properties.PutFile "DataSheet", 0, "C:\Temp\MyData.dat"

End Sub

 Related Topics


RecentFile properties

RecentFile     Legend

    Application
      FullName
    Index
      Name
    Parent
      Path


RecentFile methods

RecentFile     Legend

   Delete
   Open


RecentFile

Class RecentFile

Properties     Methods     Referenced By

The RecentFile class represents a recent file item on the File menu.

CorelDRAW keeps the four most recently opened documents in the Most Recently Used (MRU) list.

 Related Topics


RecentFile.Application

Property Application As Object

RecentFile

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


RecentFile.FullName

Property FullName As String

RecentFile

Description

The FullName property returns or sets the full path and filename of an item in the Most Recently Used (MRU) list of CorelDRAW.

Example

The following example displays the list of all the most recently used files and their paths.

Sub Test()

Dim rf As RecentFile, s As String

s = "Most Recently Used files:"

For Each rf In RecentFiles

s = s & vbCr & rf.Name & vbTab & rf.Path

Next rf

MsgBox s

End Sub

 Related Topics


RecentFile.Index

Property Index As Long

RecentFile

Description

The Index property returns the index of the current file entry in the Most Recently Used (MRU) list of CorelDRAW.

Read-Only

Example

The following example displays the list of all files in the MRU list.

Sub Test()

Dim rf As RecentFile, s As String

s = "Most Recently Used files:"

For Each rf In RecentFiles

s = s & vbCr & rf.Index & ". " & rf.Name

Next rf

MsgBox s

End Sub

 Related Topics


RecentFile.Name

Property Name As String

RecentFile

Description

The Name property returns or sets the filename of an item in the Most Recently Used (MRU) list of CorelDRAW.

Example

The following example displays the list of all the most recently used files and their paths.

Sub Test()

Dim rf As RecentFile, s As String

s = "Most Recently Used files:"

For Each rf In RecentFiles

s = s & vbCr & rf.Name & vbTab & rf.Path

Next rf

MsgBox s

End Sub

 Related Topics


RecentFile.Parent

Property Parent As RecentFiles

RecentFile

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


RecentFile.Path

Property Path As String

RecentFile

Description

The Path property returns or sets the path of an item in the Most Recently Used (MRU) list of CorelDRAW.

Example

The following example displays the list of all the most recently used files and their paths.

Sub Test()

Dim rf As RecentFile, s As String

s = "Most Recently Used files:"

For Each rf In RecentFiles

s = s & vbCr & rf.Name & vbTab & rf.Path

Next rf

MsgBox s

End Sub

 Related Topics


RecentFile.Delete

Sub Delete()

RecentFile

Description

The Delete method removes a specified document from the Most Recently Used (MRU) list.

Removing a document with the Delete method does not delete the actual document - it only removes its name from the MRU list in CorelDRAW.

Example

The following example clears the MRU list.

Sub Test()

Dim rf As RecentFile

While RecentFiles.Count <> 0

RecentFiles(1).Delete

Wend

End Sub

 Related Topics


RecentFile.Open

Function Open() As Object

RecentFile

Description

The Open method opens a document from the Most Recently Used (MRU) list.

Return value

Returns Object

Example

The following code opens the second document listed in the MRU list of CorelDRAW and displays the number of pages it contains.

Sub Test()

Dim doc  As Document

Set doc = RecentFiles(2).Open

MsgBox "Number of pages = " & doc.Pages.Count

End Sub

 Related Topics


RecentFiles properties

RecentFiles     Legend

    Application
    Count
  Item
    Maximum
    Parent


RecentFiles methods

RecentFiles     Legend

   Add


RecentFiles

Class RecentFiles

Properties     Methods     Referenced By

The RecentFiles class represents a list of Most Recently Used (MRU) files.

CorelDRAW keeps the four most recent documents opened in the MRU list.

 Related Topics


RecentFiles.Application

Property Application As Object

RecentFiles

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


RecentFiles.Count

Property Count As Long

RecentFiles

Description

The Count property returns the number of files in the Most Recently Used (MRU) list of CorelDRAW.

Read-Only

Example

The following example clears the MRU list.

Sub Test()

Dim rf As RecentFile

While RecentFiles.Count <> 0

RecentFiles(1).Delete

Wend

End Sub

 Related Topics


RecentFiles.Item

Property Item(ByVal Index As Long) As RecentFile

RecentFiles

Description

The Item property returns the specified RecentFile object.

The Item property is the default property and its reference may be omitted when accessing an item in the collection. For example, RecentFiles.Item(2) is the same as RecentFiles(2) - they both reference the second RecentFile in the RecentFiles collection.

Read-Only

Parameters	Description

Index	Index is a preset placeholder for each object in a RecentFiles collection; it uniquely identifies each member of the collection. [in]

Example

The following example displays the list of all most recently used files and their paths.

Sub Test()

Dim rf As RecentFile, s As String, i As Long

s = "Most Recently Used files:"

For i = 1 To RecentFiles.Count

Set rf = RecentFiles(i)

s = s & vbCr & rf.Name & vbTab & rf.Path

Next i

MsgBox s

End Sub

Sub Test()

Dim rf As RecentFile, s As String

s = "Most Recently Used files:"

For Each rf In RecentFiles

s = s & vbCr & rf.Name & vbTab & rf.Path

Next rf

MsgBox s

End Sub

 Related Topics


RecentFiles.Maximum

Property Maximum As Long

RecentFiles

Description

The Maximum property returns the number of items that can be stored in the Most Recently Used (MRU) list of CorelDRAW. The current maximum is four.

Read-Only

Example

The following example displays the maximum number of documents that can be stored in the MRU list of CorelDRAW.

Sub FilesMax()

MsgBox RecentFiles.Maximum

End Sub

 Related Topics


RecentFiles.Parent

Property Parent As Object

RecentFiles

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


RecentFiles.Add

Function Add(ByVal Name As String, ByVal Path As String) As RecentFile

RecentFiles

Description

The Add method places a specified document in the Most Recently Used (MRU) list of CorelDRAW.

Parameters	Description

Name	Specifies the name of the file [in]

Path	Specifies the path to the file [in]

Return value

Returns RecentFile

Example

The following example adds the file C:\Temp\Graphics\MyFile.cdr to the list of most recently used files.

Sub Test()

RecentFiles.Add "MyFile.cdr", "C:\Temp\Graphics\"

End Sub

 Related Topics


Rectangle properties

Rectangle     Legend

      CornerLowerLeft
      CornerLowerRight
      CornerUpperLeft
      CornerUpperRight
    EqualCorners
    MaxRadius
      RadiusLowerLeft
      RadiusLowerRight
      RadiusUpperLeft
      RadiusUpperRight


Rectangle methods

Rectangle     Legend

   SetRadius
   SetRoundness


Rectangle

Class Rectangle

Properties     Methods     Referenced By

The Rectangle class represents the rectangle-specific properties of the Shape object.

 Related Topics


Rectangle.CornerLowerLeft

Property CornerLowerLeft As Long

Rectangle

Description

The CornerLowerLeft property returns or sets the roundness of the lower left-hand corner of a rectangle.

The value for the roundness ranges from 0 (a cusp corner) to 100 (the maximum corner radius which is half the length of the shortest side).

Example

The following example determines if the selected rectangle has any rounded corners.

Sub Test()

Dim r As Rectangle

If ActiveShape.Type = cdrRectangleShape Then

Set r = ActiveShape.Rectangle

If r.CornerLowerLeft = 0 And r.EqualCorners Then

MsgBox "The rectangle does not have rounded corners."

Else

MsgBox "The rectangle has rounded corners."

End If

Else

MsgBox "The selected shape is not a rectangle."

End If

End Sub

 Related Topics


Rectangle.CornerLowerRight

Property CornerLowerRight As Long

Rectangle

Description

The CornerLowerRight property returns or sets the roundness of the lower right-hand corner of a rectangle.

The value for the roundness ranges from 0 (a cusp corner) to 100 (the maximum corner radius which is half the length of the shortest side).

Example

The following example determines if the selected rectangle has any rounded corners.

Sub Test()

Dim r As Rectangle

If ActiveShape.Type = cdrRectangleShape Then

Set r = ActiveShape.Rectangle

If r.CornerLowerRight = 0 And r.EqualCorners Then

MsgBox "The rectangle does not have rounded corners."

Else

MsgBox "The rectangle has rounded corners."

End If

Else

MsgBox "The selected shape is not a rectangle."

End If

End Sub

 Related Topics


Rectangle.CornerUpperLeft

Property CornerUpperLeft As Long

Rectangle

Description

The CornerUpperLeft property returns or sets the roundness of the upper left-hand corner of a rectangle.

The value for the roundness ranges from 0 (a cusp corner) to 100 (the maximum corner radius which is half the length of the shortest side).

Example

The following example determines if the selected rectangle has any rounded corners.

Sub Test()

Dim r As Rectangle

If ActiveShape.Type = cdrRectangleShape Then

Set r = ActiveShape.Rectangle

If r.CornerUpperLeft = 0 And r.EqualCorners Then

MsgBox "The rectangle does not have rounded corners."

Else

MsgBox "The rectangle has rounded corners."

End If

Else

MsgBox "The selected shape is not a rectangle."

End If

End Sub

 Related Topics


Rectangle.CornerUpperRight

Property CornerUpperRight As Long

Rectangle

Description

The CornerUpperRight property returns or sets the roundness of the upper right-hand corner of a rectangle.

The value for the roundness ranges from 0 (a cusp corner) to 100 (the maximum corner radius which is half the length of the shortest side).

Example

The following example determines if the selected rectangle has any rounded corners.

Sub Test()

Dim r As Rectangle

If ActiveShape.Type = cdrRectangleShape Then

Set r = ActiveShape.Rectangle

If r.CornerUpperRight = 0 And r.EqualCorners Then

MsgBox "The rectangle does not have rounded corners."

Else

MsgBox "The rectangle has rounded corners."

End If

Else

MsgBox "The selected shape is not a rectangle."

End If

End Sub

 Related Topics


Rectangle.EqualCorners

Property EqualCorners As Boolean

Rectangle

Description

The EqualCorners property returns True if all four corners of the rectangle have the same corner radius (if any at all).

Read-Only

Example

The following example checks all rectangles on the current page and makes sure that all corners of a rectangle are equal. If all corners are not equal, it applies the radius of the smallest corner in each rectangle.

Sub Test()

Dim s As Shape

Dim r As Rectangle

Dim d As Long

For Each s In ActivePage.FindShapes(Type:=cdrRectangleShape)

Set r = s.Rectangle

If Not r.EqualCorners Then

d = r.CornerLowerLeft

If d > r.CornerLowerRight Then d = r.CornerLowerRight

If d > r.CornerUpperLeft Then d = r.CornerUpperLeft

If d > r.CornerUpperRight Then d = r.CornerUpperRight

r.SetRoundness d

End If

Next s

End Sub

 Related Topics


Rectangle.MaxRadius

Property MaxRadius As Double

Rectangle

Description

The MaxRadius property returns the maximum radius value possible for a rectangle's rounded corner. This value is half the size of the shortest side of a rectangle.

Read-Only

Example

The following example sets the maximum corner radius for all rectangles to 0.5".

Sub Test()

Dim s As Shape

Const r As Double = 0.5

For Each s In ActivePage.FindShapes(Type:=cdrRectangleShape)

If s.Rectangle.MaxRadius >= r Then

s.Rectangle.SetRadius r

End If

Next s

End Sub

 Related Topics


Rectangle.RadiusLowerLeft

Property RadiusLowerLeft As Double

Rectangle

Description

The RadiusLowerLeft property returns or sets the radius of a rectangle's lower left-hand corner.

The radius is measured in document units and is not relative to the size of the rectangle.

Example

The following example rounds the corners of the selected rectangle by specifying a different corner radius (0.1", 0.2", 0.3", and 0.4") for each corner.

Sub Test()

If ActiveShape.Type <> cdrRectangleShape Then Exit Sub

With ActiveShape.Rectangle

.RadiusLowerLeft = 0.1

.RadiusLowerRight = 0.2

.RadiusUpperLeft = 0.3

.RadiusUpperRight = 0.4

End With

End Sub

 Related Topics


Rectangle.RadiusLowerRight

Property RadiusLowerRight As Double

Rectangle

Description

The RadiusLowerRight property returns or sets the radius of a rectangle's lower right-hand corner.

The radius is measured in document units and is not relative to the size of the rectangle.

Example

The following example rounds the corners of the selected rectangle by specifying a different corner radius (0.1", 0.2", 0.3", and 0.4") for each corner.

Sub Test()

If ActiveShape.Type <> cdrRectangleShape Then Exit Sub

With ActiveShape.Rectangle

.RadiusLowerLeft = 0.1

.RadiusLowerRight = 0.2

.RadiusUpperLeft = 0.3

.RadiusUpperRight = 0.4

End With

End Sub

 Related Topics


Rectangle.RadiusUpperLeft

Property RadiusUpperLeft As Double

Rectangle

Description

The RadiusUpperLeft property returns or sets the radius of a rectangle's upper left-hand corner.

The radius is measured in document units and is not relative to the size of the rectangle.

Example

The following example rounds the corners of the selected rectangle by specifying a different corner radius (0.1", 0.2", 0.3", and 0.4") for each corner.

Sub Test()

If ActiveShape.Type <> cdrRectangleShape Then Exit Sub

With ActiveShape.Rectangle

.RadiusLowerLeft = 0.1

.RadiusLowerRight = 0.2

.RadiusUpperLeft = 0.3

.RadiusUpperRight = 0.4

End With

End Sub

 Related Topics


Rectangle.RadiusUpperRight

Property RadiusUpperRight As Double

Rectangle

Description

The RadiusUpperRight property returns or sets the radius of a rectangle's upper right-hand corner.

The radius is measured in document units and is not relative to the size of the rectangle.

Example

The following example rounds the corners of the selected rectangle by specifying a different corner radius (0.1", 0.2", 0.3", and 0.4") for each corner.

Sub Test()

If ActiveShape.Type <> cdrRectangleShape Then Exit Sub

With ActiveShape.Rectangle

.RadiusLowerLeft = 0.1

.RadiusLowerRight = 0.2

.RadiusUpperLeft = 0.3

.RadiusUpperRight = 0.4

End With

End Sub

 Related Topics


Rectangle.SetRadius

Sub SetRadius(ByVal Radius As Double)

Rectangle

Description

The SetRadius method sets the same radius value for all corners in the rectangle. This value is measured in document units.

Parameters	Description

Radius	Specifies the value of the radius [in]

Example

The following example sets the radius of all corners in the active rectangle to 0.3".

Sub Test()

ActiveShape.Rectangle.SetRadius 0.3

End Sub

 Related Topics


Rectangle.SetRoundness

Sub SetRoundness(ByVal Roundness As Long)

Rectangle

Description

The SetRoundness method sets the same roundness for all corners in a rectangle.

The value for the roundness ranges from 0 (a cusp corner) to 100 (the maximum corner radius which is half the length of the shortest side).

Parameters	Description

Roundness	Specifies the roundness. Values range from 0 to 100. [in]

Example

The following example sets the roundness for all corners in the active rectangle shape to 50%.

Sub Test()

ActiveShape.Rectangle.SetRoundness 50

End Sub

 Related Topics


Rulers properties

Rulers     Legend

    Application
      HUnits
    Parent
      VUnits


Rulers

Class Rulers

Properties     Referenced By

The Rulers class represents the settings for the ruler in the drawing window.

 Related Topics


Rulers.Application

Property Application As Application

Rulers

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Rulers.HUnits

Property HUnits As cdrUnit

Rulers

Description

The HUnits property returns or sets the unit of measurement in the horizontal ruler of the document window. This property returns or sets a value of cdrUnit.

The specified value affects only the user interface of CorelDRAW and has no effect on automation. See also the Unit property of the Document class.

Example

The following example changes the units of horizontal ruler to inches while the units of the vertical ruler are changed to centimeters.

Sub Test()

With ActiveDocument.Rulers

.HUnits = cdrInch

.VUnits = cdrCentimeter

End With

End Sub

 Related Topics


Rulers.Parent

Property Parent As Document

Rulers

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Rulers.VUnits

Property VUnits As cdrUnit

Rulers

Description

The VUnits property returns or sets the unit of measurement in the vertical ruler of the document window. This property returns or sets a value of cdrUnit.

The specified value affects only the user interface of CorelDRAW and has no effect on automation. See also the Unit property of the Document class.

Example

The following example changes the units of horizontal ruler to inches while the units of the vertical ruler are changed to centimeters.

Sub Test()

With ActiveDocument.Rulers

.HUnits = cdrInch

.VUnits = cdrCentimeter

End With

End Sub

 Related Topics


Segment properties

Segment     Legend

    AbsoluteIndex
    Application
      EndingControlPointAngle
      EndingControlPointLength
      EndingControlPointX
      EndingControlPointY
    EndNode
    Index
    Length
    Parent
      StartingControlPointAngle
      StartingControlPointLength
      StartingControlPointX
      StartingControlPointY
    StartNode
    SubPath
    SubPathIndex
      Type


Segment methods

Segment     Legend

   AddNodeAt
   BreakApartAt
   FindParamOffset
   GetAbsoluteOffset
   GetBendPoints
   GetCopy
   GetCurvatureAt
   GetCurveSpeedAt
   GetEndingControlPointPosition
   GetIntersections
   GetPeaks
   GetPerpendicularAt
   GetPointPositionAt
   GetStartingControlPointPosition
   GetTangentAt
   Next
   Previous
   SetEndingControlPointPosition
   SetStartingControlPointPosition


Segment

Class Segment

Properties     Methods     Referenced By

The Segment class repesents the properties of a curve or line segment.

 Related Topics


Segment.AbsoluteIndex

Property AbsoluteIndex As Long

Segment

Description

The AbsoluteIndex property returns the index value of the subpath within the curve (all the subpaths).

Index and AbsoluteIndex will return the same value if the segment belongs to the first subpath of the curve.

Read-Only

Example

The following example loops through all the segments of each subpath and prints the segment's Index and AbsoluteIndex property in the Intermediate window of the VBA Editor.

Sub Test()

Dim s As Shape

Dim sp As SubPath

Dim seg As Segment

Set s = ActiveShape

If s.Type = cdrCurveShape Then

For Each sp In s.Curve.Subpaths

For Each seg In sp.Segments

Debug.Print seg.Index, seg.AbsoluteIndex

Next seg

Next sp

End If

End Sub

 Related Topics


Segment.Application

Property Application As Application

Segment

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Segment.EndingControlPointAngle

Property EndingControlPointAngle As Double

Segment

Description

The StartingControlPointAngle property returns or sets the angle, in degrees, of the control point vector of the ending of a segment.

Example

The following example constrains control point angles to increments of 45 degrees. Each control point vector is rotated to the closest angle that is a multiple 45 degrees.

Sub Test()

Dim s As Shape

Dim seg As Segment

Set s = ActiveShape

If s.Type = cdrCurveShape Then

For Each seg In s.Curve.Segments

If seg.Type = cdrCurveSegment Then

seg.StartingControlPointAngle = Constrain(seg.StartingControlPointAngle)

seg.EndingControlPointAngle = Constrain(seg.EndingControlPointAngle)

End If

Next seg

End If

End Sub

Private Function Constrain(a As Double) As Double

Constrain = Fix(a / 45 + 0.5) * 45

End Function

 Related Topics


Segment.EndingControlPointLength

Property EndingControlPointLength As Double

Segment

Description

The EndingControlPointLength property returns or sets the length of the control point vector of the ending of a curve. The length is measured in document units.

Example

The following example sets the starting and ending control point length for the first segment in the active shape.

Sub App()

With ActiveShape.Curve.Segments(1)

.StartingControlPointLength = 5

.EndingControlPointLength = 5

End With

End Sub

 Related Topics


Segment.EndingControlPointX

Property EndingControlPointX As Double

Segment

Description

The EndingControlPointX property returns or sets the horizontal coordinate of the ending control point of a curve segment.

This property is measured in document units.

Example

The following example marks the position of each control point of the selected curve with a small circle.

Sub Test()

Dim s As Shape

Dim seg As Segment

Set s = ActiveShape

If s.Type = cdrCurveShape Then

For Each seg In s.Curve.Segments

If seg.Type = cdrCurveSegment Then

ActiveLayer.CreateEllipse2 seg.StartingControlPointX, seg.StartingControlPointY, 0.02

ActiveLayer.CreateEllipse2 seg.EndingControlPointX, seg.EndingControlPointY, 0.02

End If

Next seg

End If

End Sub

 Related Topics


Segment.EndingControlPointY

Property EndingControlPointY As Double

Segment

Description

The EndingControlPointY property returns or sets the vertical coordinate of the ending control point of a curve segment.

This property is measured in document units.

Example

The following example marks the position of each control point of the selected curve with a small circle.

Sub Test()

Dim s As Shape

Dim seg As Segment

Set s = ActiveShape

If s.Type = cdrCurveShape Then

For Each seg In s.Curve.Segments

If seg.Type = cdrCurveSegment Then

ActiveLayer.CreateEllipse2 seg.StartingControlPointX, seg.StartingControlPointY, 0.02

ActiveLayer.CreateEllipse2 seg.EndingControlPointX, seg.EndingControlPointY, 0.02

End If

Next seg

End If

End Sub

 Related Topics


Segment.EndNode

Property EndNode As Node

Segment

Description

The EndNode property returns the ending Node object of a segment.

Read-Only

Example

The following example re-creates the selected curve by creating each segment as a separate shape.

Sub Test()

Dim seg As Segment

If ActiveShape Is Nothing Then Exit Sub

If ActiveShape.Type <> cdrCurveShape Then Exit Sub

For Each seg In ActiveShape.Curve.Segments

Select Case seg.Type

Case cdrLineSegment

ActiveLayer.CreateLineSegment seg.StartNode.PositionX, _

seg.StartNode.PositionY, _

seg.EndNode.PositionX, seg.EndNode.PositionY

Case cdrCurveSegment

ActiveLayer.CreateCurveSegment seg.StartNode.PositionX, _

seg.StartNode.PositionY, _

seg.EndNode.PositionX, seg.EndNode.PositionY, _

seg.StartingControlPointLength, _

seg.StartingControlPointAngle, _

seg.EndingControlPointLength, _

seg.EndingControlPointAngle

End Select

Next seg

End Sub

 Related Topics


Segment.Index

Property Index As Long

Segment

Description

The Index property returns the number (index) of the segment within its subpath.

The Index and AbsoluteIndex properties return the same value if the segment belongs to the first subpath of the curve.

Read-Only

Example

The following example loops through all the segments of each subpath and prints the segment's Index and AbsoluteIndex property in the Intermediate window of the VBA Editor.

Sub Test()

Dim s As Shape

Dim sp As SubPath

Dim seg As Segment

Set s = ActiveShape

If s.Type = cdrCurveShape Then

For Each sp In s.Curve.Subpaths

For Each seg In sp.Segments

Debug.Print seg.Index, seg.AbsoluteIndex

Next seg

Next sp

End If

End Sub

 Related Topics


Segment.Length

Property Length As Double

Segment

Description

The Length property returns the length of a segment. Length is measured in document units.

Read-Only

Example

The following example displays the length of the first segment of selected curve.

Sub Test()

MsgBox ActiveShape.Curve.Segments(1).Length

End Sub

 Related Topics


Segment.Parent

Property Parent As Curve

Segment

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Segment.StartingControlPointAngle

Property StartingControlPointAngle As Double

Segment

Description

The StartingControlPointAngle property returns or sets the angle, in degrees, of the control point vector of the beginning of a segment.

Example

The following example constrains control point angles to increments of 45 degrees. Each control point vector is rotated to the closest angle that is a multiple of 45 degrees.

Sub Test()

Dim s As Shape

Dim seg As Segment

Set s = ActiveShape

If s.Type = cdrCurveShape Then

For Each seg In s.Curve.Segments

If seg.Type = cdrCurveSegment Then

seg.StartingControlPointAngle = Constrain(seg.StartingControlPointAngle)

seg.EndingControlPointAngle = Constrain(seg.EndingControlPointAngle)

End If

Next seg

End If

End Sub

Private Function Constrain(a As Double) As Double

Constrain = Fix(a / 45 + 0.5) * 45

End Function

 Related Topics


Segment.StartingControlPointLength

Property StartingControlPointLength As Double

Segment

Description

The StartingControlPointLength property returns or sets the length of the control point vector of the beginning of a curve. The length is measured in document units.

Example

The following example sets the starting and ending control point length for the first segment in the active shape.

Sub App()

With ActiveShape.Curve.Segments(1)

.StartingControlPointLength = 5

.EndingControlPointLength = 5

End With

End Sub

 Related Topics


Segment.StartingControlPointX

Property StartingControlPointX As Double

Segment

Description

The StartingControlPointX property returns or sets the horizontal coordinate of the starting control point of a curve segment. This property is measured in document units.

Example

The following example marks the position of each control point of the selected curve with a small circle.

Sub Test()

Dim s As Shape

Dim seg As Segment

Set s = ActiveShape

If s.Type = cdrCurveShape Then

For Each seg In s.Curve.Segments

If seg.Type = cdrCurveSegment Then

ActiveLayer.CreateEllipse2 seg.StartingControlPointX, seg.StartingControlPointY, 0.02

ActiveLayer.CreateEllipse2 seg.EndingControlPointX, seg.EndingControlPointY, 0.02

End If

Next seg

End If

End Sub

 Related Topics


Segment.StartingControlPointY

Property StartingControlPointY As Double

Segment

Description

The StartingControlPointY property returns or sets the vertical coordinate of the starting control point of a curve segment. This property is measured in document units.

Example

The following example marks the position of each control point of the selected curve with a small circle.

Sub Test()

Dim s As Shape

Dim seg As Segment

Set s = ActiveShape

If s.Type = cdrCurveShape Then

For Each seg In s.Curve.Segments

If seg.Type = cdrCurveSegment Then

ActiveLayer.CreateEllipse2 seg.StartingControlPointX, seg.StartingControlPointY, 0.02

ActiveLayer.CreateEllipse2 seg.EndingControlPointX, seg.EndingControlPointY, 0.02

End If

Next seg

End If

End Sub

 Related Topics


Segment.StartNode

Property StartNode As Node

Segment

Description

The StartNode property returns the starting Node object of a segment.

Read-Only

Example

The following example re-creates the selected curve by creating each segment as a separate shape.

Sub Test()

Dim seg As Segment

If ActiveShape Is Nothing Then Exit Sub

If ActiveShape.Type <> cdrCurveShape Then Exit Sub

For Each seg In ActiveShape.Curve.Segments

Select Case seg.Type

Case cdrLineSegment

ActiveLayer.CreateLineSegment seg.StartNode.PositionX, seg.StartNode.PositionY, _

seg.EndNode.PositionX, seg.EndNode.PositionY

Case cdrCurveSegment

ActiveLayer.CreateCurveSegment seg.StartNode.PositionX, seg.StartNode.PositionY, _

seg.EndNode.PositionX, seg.EndNode.PositionY, seg.StartingControlPointLength, _

seg.StartingControlPointAngle, seg.EndingControlPointLength, seg.EndingControlPointAngle

End Select

Next seg

End Sub

 Related Topics


Segment.SubPath

Property SubPath As SubPath

Segment

Description

The SubPath property returns the SubPath object to which the segment belongs.

Read-Only

Example

The following example creates a curve with two subpaths. The subpath which contains the seventh segment is copied as a curve, and a shape is then created from that curve.

Sub Test()

Dim s As Shape, s2 As Shape

Dim sp As SubPath, sp2 As SubPath

Dim crv As Curve, crv2 As Curve

Set crv = CreateCurve(ActiveDocument)

ActiveDocument.ReferencePoint = cdrBottomLeft

Set sp = crv.CreateSubPath(1, 1)

sp.AppendLineSegment 1, 1

sp.AppendCurveSegment 3, 3

sp.AppendCurveSegment 5, 1

sp.AppendCurveSegment 6, 4

sp.Nodes(2).Type = cdrSmoothNode

sp.Nodes(3).Type = cdrSmoothNode

Set sp2 = crv.CreateSubPath(6, 4)

sp2.AppendLineSegment 5, 7

sp2.AppendCurveSegment 3, 5

sp2.AppendCurveSegment 1, 7

sp2.Nodes(3).Type = cdrSmoothNode

sp2.Nodes(4).Type = cdrSmoothNode

Set s = ActiveLayer.CreateCurve(crv)

Set sp2 = s.Curve.Segments(7).SubPath

Set crv2 = sp2.GetCopy

Set s2 = ActiveLayer.CreateCurve(crv2)

s2.Move 0, 1

End Sub

 Related Topics


Segment.SubPathIndex

Property SubPathIndex As Long

Segment

Description

The SubPathIndex property returns the index value of the subpath to which the current segment belongs.

Read-Only

Example

The following example re-creates each segment of the selected curve as a separate shape, and gives each a different outline color, depending on the subpath to which the original segment belonged.

Sub Test()

Dim s As Shape

Dim seg As Segment

If ActiveShape Is Nothing Then Exit Sub

If ActiveShape.Type <> cdrCurveShape Then Exit Sub

For Each seg In ActiveShape.Curve.Segments

Select Case seg.Type

Case cdrLineSegment

Set s = ActiveLayer.CreateLineSegment(seg.StartNode.PositionX, seg.StartNode.PositionY, _

seg.EndNode.PositionX, seg.EndNode.PositionY)

Case cdrCurveSegment

Set s = ActiveLayer.CreateCurveSegment(seg.StartNode.PositionX, seg.StartNode.PositionY, _

seg.EndNode.PositionX, seg.EndNode.PositionY, seg.StartingControlPointLength, _

seg.StartingControlPointAngle, seg.EndingControlPointLength, seg.EndingControlPointAngle)

End Select

s.Outline.Color = ActivePalette.Color(seg.SubPathIndex + 12)

Next seg

End Sub

 Related Topics


Segment.Type

Property Type As cdrSegmentType

Segment

Description

The Type property returns or sets the type (line or curve) of the segment. You can also use this property to convert the type between line and curve.

This property returns cdrSegmentType.

Example

The following example counts the number of curve and line segments in the selected curve shape.

Sub Test()

Dim seg As Segment, ls As Long, cs As Long

If ActiveShape Is Nothing Then Exit Sub

If ActiveShape.Type <> cdrCurveShape Then Exit Sub

ls = 0

cs = 0

For Each seg In ActiveShape.Curve.Segments

Select Case seg.Type

Case cdrLineSegment

ls = ls + 1

Case cdrCurveSegment

cs = cs + 1

End Select

Next seg

MsgBox "The current curve has " & ActiveShape.Curve.Segments.Count & _

" segments including:" & vbCr & _

"Line segments: " & ls & vbCr & _

"Curve segments: " & cs

End Sub

 Related Topics


Segment.AddNodeAt

Function AddNodeAt([ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset (2)]) As Node

Segment

Description

The AddNodeAt method adds a node to a segment at a specified offset.

Parameters	Description

Offset	Specifies the offset, in document units, from the beginning of a segment's subpath [in]
Optional
Default value = 0.5

OffsetType	Specifies the type of offset of a point on a curve's subpath. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrParamSegmentOffset (2)

Return value

Returns Node

Example

The following example creates a curve segment and adds a node at its center.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateCurveSegment(2, 8.3, 5.3, 8.5, 1.5, -62, 2.4, 84)

s.Curve.Segments(1).AddNodeAt 0.5, cdrRelativeSegmentOffset

End Sub

 Related Topics


Segment.BreakApartAt

Function BreakApartAt([ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset (2)]) As Node

Segment

Description

The BreakApartAt method divides a segment into two unconnected segments at a given point.

Currently, this method fails even if the segment was split successfully. Therefore, you must use the On Error Resume Next statement to catch the error and continue execution.

Parameters	Description

Offset	Specifies the offset, in document units, from the beginning of a segment's subpath [in]
Optional
Default value = 0.5

OffsetType	Specifies the type of offset of a point on a curve's subpath. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrParamSegmentOffset (2)

Return value

Returns Node

Example

The following example creates a curve segment and divides it into two pieces at a point that is 1.3" from the beginning of the segment.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateCurveSegment(2, 8.3, 5.3, 8.5, 1.5, -62, 2.4, 84)

On Error Resume Next ' Lines in green are a workaround

s.Curve.Segments(1).BreakApartAt 1.3, cdrAbsoluteSegmentOffset

On Error GoTo 0

End Sub

 Related Topics


Segment.FindParamOffset

Function FindParamOffset(ByVal AbsoluteOffset As Double, ByRef ParamOffset As Double, [ByRef Remainder As Double = 0]) As Boolean

Segment

Description

The FindParamOffset method returns the parametric offset for a specified absolute offset

If the segment is shorter than the specified offset, the function returns False, and the remainder of the offset is returned in the Remainder parameter. Otherwise the function returns True, and the ParamOffset parameter returns the parametric offset for the segment.

Parameters	Description

AbsoluteOffset	Lets you specify the absolute offset value [in]

ParamOffset	Returns the value of the parametric offset [out]

Remainder	Returns the remainder [out]
Optional
Default value = 0

Return value

Returns Boolean

Example

The following example duplicates a shape and distributes it along a path. The shape and the path must be selected, and the path must be selected last.

Sub Test()

Dim sr As ShapeRange

Dim sPath As Shape, sShape As Shape, sWork As Shape

Dim dWidth As Double, Offset As Double, Rest As Double, t As Double

Dim x As Double, y As Double, a As Double, sx As Double, sy As Double

Dim seg As Segment

Set sr = ActiveSelectionRange

If sr.Count <> 2 Then

MsgBox "Please select two shapes", vbCritical

Exit Sub

End If

If sr(1).Type <> cdrCurveShape Then

MsgBox "Last selected shape must be a curve", vbCritical

Exit Sub

End If

Set sPath = sr(1)

Set sShape = sr(2)

ActiveDocument.ReferencePoint = cdrCenter

dWidth = sShape.SizeWidth

sShape.GetPosition sx, sy

Offset = dWidth / 2

For Each seg In sPath.Curve.Segments

While seg.FindParamOffset(Offset, t, Rest)

seg.GetPointPositionAt x, y, t, cdrParamSegmentOffset

a = seg.GetTangentAt(t, cdrParamSegmentOffset)

Set sWork = sShape.Duplicate(x - sx, y - sy)

sWork.Rotate a

Offset = Offset + dWidth

Wend

Offset = Rest

Next seg

End Sub

 Related Topics


Segment.GetAbsoluteOffset

Function GetAbsoluteOffset(ByVal ParamOffset As Double) As Double

Segment

Description

The GetAbsoluteOffset method returns the distance of a specified point from the beginning of the segment, thus effectively converting the parametric offset to an absolute offset value.

Parameters	Description

ParamOffset	Lets you specify the parametric offset value of a segment [in]

Return value

Returns Double

Example

The following example displays the distance of a point, with a parametric offset 0.5, from the beginning of the first segment of the active curve.

Sub Test()

MsgBox ActiveShape.Curve.Segments(1).GetAbsoluteOffset(0.5)

End Sub

 Related Topics


Segment.GetBendPoints

Function GetBendPoints(ByRef Offset1 As Double, ByRef Offset2 As Double, [ByVal OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset (2)]) As Long

Segment

Description

The GetBendPoints method returns the number of bend points in a curve segment. A bend point is the offset where a curve segment bends (where it changes its curvature from positive to negative). There can be a maximum of two bend points per segment, and possibly none.

Parameters	Description

Offset1	Returns the offset, in document units, of the first bend point [out]

Offset2	Returns the offset, in document units, of the second bend point [out]

OffsetType	Specifies the type of offset of a point on a curve's subpath. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrParamSegmentOffset (2)

Return value

Returns Long

Example

The following example marks all bend points in the selected curve with small circles.

Sub Test()

Dim seg As Segment

Dim t1 As Double, t2 As Double, n As Long

For Each seg In ActiveShape.Curve.Segments

n = seg.GetBendPoints(t1, t2)

If n > 1 Then MarkPoint seg, t2

If n > 0 Then MarkPoint seg, t1

Next seg

End Sub

Private Sub MarkPoint(seg As Segment, t As Double)

Dim x As Double, y As Double

Dim s As Shape

seg.GetPointPositionAt t, , x, y

Set s = ActiveLayer.CreateEllipse2(x, y, 0.03)

s.Fill.UniformColor.RGBAssign 255, 255, 0

End Sub

 Related Topics


Segment.GetCopy

Function GetCopy() As Curve

Segment

Description

The GetCopy method returns a copy of the active segment as a separate curve.

Return value

Returns Curve

Example

The following example creates a curve, and copies its second segment to form a second curve. It then creates another shape from the second curve.

Sub Test()

Dim s As Shape, s2 As Shape

Dim sp As SubPath

Dim crv As Curve, crv2 As Curve

Set crv = CreateCurve(ActiveDocument)

ActiveDocument.ReferencePoint = cdrBottomLeft

Set sp = crv.CreateSubPath(1, 1)

sp.AppendLineSegment 1, 1

sp.AppendCurveSegment 3, 3

sp.AppendCurveSegment 5, 1

sp.AppendCurveSegment 6, 4

sp.AppendCurveSegment 8, 2

sp.AppendLineSegment 10, 5

sp.Nodes(2).Type = cdrSmoothNode

sp.Nodes(3).Type = cdrSmoothNode

sp.Nodes(4).Type = cdrSymmetricalNode

sp.Nodes(5).Type = cdrSmoothNode

Set s = ActiveLayer.CreateCurve(crv)

Set crv2 = s.Curve.Segments(2).GetCopy

Set s2 = ActiveLayer.CreateCurve(crv2)

s2.Move 0, 2

End Sub

 Related Topics


Segment.GetCurvatureAt

Function GetCurvatureAt([ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset (2)]) As Double

Segment

Description

The GetCurvatureAt method returns a numerical value that indicates the curvature of a segment at a given point.

The curvature value is the inverse of the curvature radius, and depends on the current document units.

Parameters	Description

Offset	Specifies the offset, in document units, of a point on a segment's subpath. This value is optiona, and the default value of the offset distance 0.5. [in]
Optional
Default value = 0.5

OffsetType	Specifies the type of offset [in]
Optional
Default value = cdrParamSegmentOffset (2)

Return value

Returns Double

Example

The following example draws a circle so that it touches the selected curve at the point which represents 25% of its length. This circle has the same curvature as the curve at this point; that is, it shows the curvature radius.

Sub Test()

Dim c As Double, r As Double

Dim x As Double, y As Double, pa As Double

Dim seg As Segment

Set seg = ActiveShape.Curve.Segments(1)

c = seg.GetCurvatureAt(0.25, cdrRelativeSegmentOffset)

If Abs(c) < 0.00001 Then

MsgBox "The segment is almost straight at this point", vbCritical

Exit Sub

End If

seg.GetPointPositionAt 0.25, cdrRelativeSegmentOffset, x, y

pa = seg.GetPerpendicularAt(0.25, cdrRelativeSegmentOffset)

pa = pa * 3.1415926 / 180

r = 1 / c

x = x + r * Cos(pa)

y = y + r * Sin(pa)

ActiveLayer.CreateEllipse2 x, y, r

End Sub

 Related Topics


Segment.GetCurveSpeedAt

Function GetCurveSpeedAt([ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset (2)]) As Double

Segment

Description

The GetCurveSpeedAt method returns a value that indicates how fast the curvature changes at a specified point.

A value close to 0 means that the curvature is steady, for example, in a circle. If it is greater than 0, the curvature increases, for example, in a spiral. A value of less than 0 value indicates that the curvature decreases, for example, in an unwinding spiral.

Parameters	Description

Offset	Specifies the offset, in document units, of a point on a segment's subpath. [in]
Optional
Default value = 0.5

OffsetType	Specifies the type of the offset [in]
Optional
Default value = cdrParamSegmentOffset (2)

Return value

Returns Double

Example

The following example displays how fast the curvature changes in the middle of the first segment of the selected curve.

Sub Test()

Dim c As Double

Dim seg As Segment

Set seg = ActiveShape.Curve.Segments(1)

c = seg.GetCurveSpeedAt(0.5, cdrRelativeSegmentOffset)

If Abs(c) < 0.01 Then

MsgBox "Curvature is steady: " & c

Else

If c > 0 Then

MsgBox "Curvature is increasing: " & c

Else

MsgBox "Curvature is decreasing: " & c

End If

End If

End Sub

 Related Topics


Segment.GetEndingControlPointPosition

Sub GetEndingControlPointPosition(ByRef PositionX As Double, ByRef PositionY As Double)

Segment

Description

The GetEndingControlPointPosition method returns the position of the ending control point.

Parameters	Description

PositionX	Returns the horizontal position [out]

PositionY	Returns the vertical position [out]

Example

The following example creates a curve, and sets the ending control point of the last segment to the same position as the ending control point of the second segment.

Sub Test()

Dim s As Shape, s2 As Shape

Dim sp As SubPath

Dim crv As Curve, crv2 As Curve

Dim seg As Segment, seg2 As Segment

Dim x As Double, y As Double

Set crv = CreateCurve(ActiveDocument)

ActiveDocument.ReferencePoint = cdrBottomLeft

Set sp = crv.CreateSubPath(1, 1)

sp.AppendLineSegment 1, 1

sp.AppendCurveSegment 3, 3

sp.AppendCurveSegment 5, 1

sp.AppendCurveSegment 6, 4

sp.Nodes(2).Type = cdrSmoothNode

sp.Nodes(3).Type = cdrSmoothNode

Set s = ActiveLayer.CreateCurve(crv)

Set seg = ActiveShape.Curve.Segments(2)

seg.GetEndingControlPointPosition x, y

Set seg2 = ActiveShape.Curve.Segments(ActiveShape.Curve.Segments.Count)

seg2.SetEndingControlPointPosition x, y

End Sub

 Related Topics


Segment.GetIntersections

Function GetIntersections(ByVal Target As Segment, [ByVal OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset (2)]) As CrossPoints

Segment

Description

The GetIntersections method finds all points of intersection between two segments.

Parameters	Description

Target	Specifies the second object [in]

OffsetType	Specifies the type of offset of a point on a curve's subpath. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrParamSegmentOffset (2)

Return value

Returns CrossPoints

Example

The following example displays the number of times the first segment of the first two subpaths of the selected curve intersect, and marks each intersection point with a small circle.

Sub Test()

Dim seg1 As Segment, seg2 As Segment

Dim cps As CrossPoints, cp As CrossPoint

Dim x As Double, y As Double

If ActiveShape Is Nothing Then

MsgBox "Nothing selected", vbCritical

Exit Sub

End If

If ActiveShape.Type <> cdrCurveShape Then

MsgBox "Select a curve", vbCritical

Exit Sub

End If

If ActiveShape.Curve.Subpaths.Count < 2 Then

MsgBox "The curve must have 2 subpaths", vbCritical

Exit Sub

End If

Set seg1 = ActiveShape.Curve.Subpaths(1).Segments(1)

Set seg2 = ActiveShape.Curve.Subpaths(2).Segments(1)

Set cps = seg1.GetIntersections(seg2)

For Each cp In cps

ActiveLayer.CreateEllipse2 cp.PositionX, cp.PositionY, 0.05

Next cp

MsgBox cps.Count & " intersection point(s) found"

End Sub

 Related Topics


Segment.GetPeaks

Function GetPeaks(ByVal Angle As Double, ByRef Offset1 As Double, ByRef Offset2 As Double, [ByVal OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset (2)]) As Long

Segment

Description

The GetPeaks method returns the number of points where a tangent at a specified angle can touch a curve segment. There might be up to two peaks on a segment.

Parameters	Description

Angle	Specifies the angle, measured in degrees [in]

Offset1	Returns the offset, in document units, of the first tangent from the beginning of the curve [out]

Offset2	Returns the offset, in document units, of the second tangent from the beginning of the curve [out]

OffsetType	Specifies the type of offset of a point on a curve's subpath. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrParamSegmentOffset (2)

Return value

Returns Long

Example

The following example marks points on a curve through which tangents can be drawn at 30°.

Sub Test()

Const Angle As Double = 30

Dim seg As Segment

Dim t1 As Double, t2 As Double, n As Long

For Each seg In ActiveShape.Curve.Segments

n = seg.GetPeaks(Angle, t1, t2)

If n > 1 Then MarkPoint seg, t2, Angle

If n > 0 Then MarkPoint seg, t1, Angle

Next seg

End Sub

Private Sub MarkPoint(seg As Segment, t As Double, Angle As Double)

Dim x As Double, y As Double

Dim dx As Double, dy As Double

Dim s As Shape, a As Double

a = Angle * 3.1415926 / 180

dx = 1.5 * Cos(a)

dy = 1.5 * Sin(a)

seg.GetPointPositionAt t, cdrParamSegmentOffset, x, y

ActiveLayer.CreateLineSegment x + dx, y + dy, x - dx, y - dy

Set s = ActiveLayer.CreateEllipse2(x, y, 0.05)

s.Fill.UniformColor.RGBAssign 255, 0, 0

End Sub

 Related Topics


Segment.GetPerpendicularAt

Function GetPerpendicularAt([ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset (2)]) As Double

Segment

Description

The GetPerpendicularAt method returns the angle of the perpendicular at a specified point on a curve segment.

Parameters	Description

Offset	Specifies the offset, in document units, from the beginning of a segment's subpath. [in]
Optional
Default value = 0.5

OffsetType	Specifies the type of offset of a point on a curve's subpath. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrParamSegmentOffset (2)

Return value

Returns Double

Example

The following example draws perpendicular and tangent vectors for several points uniformly distributed along the segments of the selected curve.

Sub Test()

Dim seg As Segment

Dim t As Double

For Each seg In ActiveShape.Curve.Segments

For t = 0 To 10 Step 2

MarkPoint seg, t / 10

Next t

Next seg

End Sub

Private Sub MarkPoint(seg As Segment, t As Double)

Dim x As Double, y As Double

Dim dx As Double, dy As Double

Dim a1 As Double, a2 As Double

seg.GetPointPositionAt t, cdrRelativeSegmentOffset, x, y

a1 = seg.GetTangentAt(t, cdrRelativeSegmentOffset) * 3.1415926 / 180

a2 = seg.GetPerpendicularAt(t, cdrRelativeSegmentOffset) * 3.1415926 / 180

dx = 0.5 * Cos(a1)

dy = 0.5 * Sin(a1)

With ActiveLayer.CreateLineSegment(x, y, x + dx, y + dy)

.Outline.EndArrow = ArrowHeads(1)

End With

dx = 0.5 * Cos(a2)

dy = 0.5 * Sin(a2)

With ActiveLayer.CreateLineSegment(x, y, x + dx, y + dy)

.Outline.EndArrow = ArrowHeads(1)

End With

End Sub

 Related Topics


Segment.GetPointPositionAt

Sub GetPointPositionAt(ByRef X As Double, ByRef Y As Double, [ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset (2)])

Segment

Description

The GetPointPositionAt method returns the coordinates of a point located on a segment.

Parameters	Description

X	Specifies the horizontal position of a point on a segment's subpath. The x-coordinate is measured in document units. [out]

Y	Specifies the vertical position of a point on a segment's subpath. The y-coordinate is measured in document units. [out]

Offset	Specifies the offset, in document units, from the beginning of a segment's subpath. [in]
Optional
Default value = 0.5

OffsetType	Specifies the offset type of a point on a curve's subpath. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrParamSegmentOffset (2)

Example

The following example creates five small ellipses distributed evenly along each segment of the selected curve.

Sub Test()

Dim seg As Segment

Dim t As Double, x As Double, y As Double

For Each seg In ActiveShape.Curve.Segments

For t = 0 To 0.9 Step 0.2

seg.GetPointPositionAt t, cdrRelativeSegmentOffset, x, y

ActiveLayer.CreateEllipse2 x, y, 0.03

Next t

Next seg

End Sub

 Related Topics


Segment.GetStartingControlPointPosition

Sub GetStartingControlPointPosition(ByRef PositionX As Double, ByRef PositionY As Double)

Segment

Description

The GetStartingControlPointPosition method returns the position of the starting control point.

Parameters	Description

PositionX	Returns the horizontal position [out]

PositionY	Returns the vertical position [out]

Example

The following example creates a curve, and sets the starting control point of the last segment to the same position as the starting control point for the second segment.

Sub Test()

Dim s As Shape, s2 As Shape

Dim sp As SubPath

Dim crv As Curve, crv2 As Curve

Dim seg As Segment, seg2 As Segment

Dim x As Double, y As Double

Set crv = CreateCurve(ActiveDocument)

ActiveDocument.ReferencePoint = cdrBottomLeft

Set sp = crv.CreateSubPath(1, 1)

sp.AppendLineSegment 1, 1

sp.AppendCurveSegment 3, 3

sp.AppendCurveSegment 5, 1

sp.AppendCurveSegment 6, 4

sp.Nodes(2).Type = cdrSmoothNode

sp.Nodes(3).Type = cdrSmoothNode

Set s = ActiveLayer.CreateCurve(crv)

Set seg = ActiveShape.Curve.Segments(2)

seg.GetStartingControlPointPosition x, y

Set seg2 = ActiveShape.Curve.Segments(ActiveShape.Curve.Segments.Count)

seg2.SetStartingControlPointPosition x, y

End Sub

 Related Topics


Segment.GetTangentAt

Function GetTangentAt([ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset (2)]) As Double

Segment

Description

The GetTangentAt method returns the angle of the tangent at a specified point on a curve segment.

Parameters	Description

Offset	Specifies the offset, in document units, from the beginning of a segment's subpath [in]
Optional
Default value = 0.5

OffsetType	Specifies the type of offset of a point on a curve's subpath. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrParamSegmentOffset (2)

Return value

Returns Double

Example

The following example draws perpendicular and tangent vectors for several points uniformly distributed along the segments of the selected curve.

Sub Test()

Dim seg As Segment

Dim t As Double

For Each seg In ActiveShape.Curve.Segments

For t = 0 To 10 Step 2

MarkPoint seg, t / 10

Next t

Next seg

End Sub

Private Sub MarkPoint(seg As Segment, t As Double)

Dim x As Double, y As Double

Dim dx As Double, dy As Double

Dim a1 As Double, a2 As Double

seg.GetPointPositionAt t, cdrRelativeSegmentOffset, x, y

a1 = seg.GetTangentAt(t, cdrRelativeSegmentOffset) * 3.1415926 / 180

a2 = seg.GetPerpendicularAt(t, cdrRelativeSegmentOffset) * 3.1415926 / 180

dx = 0.5 * Cos(a1)

dy = 0.5 * Sin(a1)

With ActiveLayer.CreateLineSegment(x, y, x + dx, y + dy)

.Outline.EndArrow = ArrowHeads(1)

End With

dx = 0.5 * Cos(a2)

dy = 0.5 * Sin(a2)

With ActiveLayer.CreateLineSegment(x, y, x + dx, y + dy)

.Outline.EndArrow = ArrowHeads(1)

End With

End Sub

 Related Topics


Segment.Next

Function Next() As Segment

Segment

Description

The Next method returns the next segment on the same subpath.

If the last segment is reached and the subpath is not closed, Nothing is returned

Return value

Returns Segment

Example

The following example creates a triangle, converts the three segments to curves, and changes the type of the bottom nodes to smooth, producing a shape resembling a droplet.

Sub Test()

Dim s As Shape

Dim seg As Segment

Set s = ActiveLayer.CreatePolygon(3, 6, 7, 2, 3)

s.ConvertToCurves

s.Curve.Nodes.Range(2, 4, 6).Delete

Set seg = s.Curve.Segments(2)

seg.Previous.Type = cdrCurveSegment

seg.Next.Type = cdrCurveSegment

seg.Type = cdrCurveSegment

seg.StartNode.Type = cdrSmoothNode

seg.EndNode.Type = cdrSmoothNode

End Sub

 Related Topics


Segment.Previous

Function Previous() As Segment

Segment

Description

The Previous method returns the previous segment on the same subpath.

If the first segment is reached and the subpath is not closed, Nothing is returned

Return value

Returns Segment

Example

The following example creates a triangle, converts the three segments to curves, and changes the type of the bottom nodes to smooth, producing a shape resembling a droplet.

Sub Test()

Dim s As Shape

Dim seg As Segment

Set s = ActiveLayer.CreatePolygon(3, 6, 7, 2, 3)

s.ConvertToCurves

s.Curve.Nodes.Range(2, 4, 6).Delete

Set seg = s.Curve.Segments(2)

seg.Previous.Type = cdrCurveSegment

seg.Next.Type = cdrCurveSegment

seg.Type = cdrCurveSegment

seg.StartNode.Type = cdrSmoothNode

seg.EndNode.Type = cdrSmoothNode

End Sub

 Related Topics


Segment.SetEndingControlPointPosition

Sub SetEndingControlPointPosition(ByVal PositionX As Double, ByVal PositionY As Double)

Segment

Description

The SetEndingControlPointPosition method sets the positin of the ending control point.

Parameters	Description

PositionX	Specifies the horizontal position [in]

PositionY	Specifies the vertical position [in]

Example

The following example creates a curve, and sets the ending control point of the last segment to the same position as the ending control point of the second segment.

Sub Test()

Dim s As Shape, s2 As Shape

Dim sp As SubPath

Dim crv As Curve, crv2 As Curve

Dim seg As Segment, seg2 As Segment

Dim x As Double, y As Double

Set crv = CreateCurve(ActiveDocument)

ActiveDocument.ReferencePoint = cdrBottomLeft

Set sp = crv.CreateSubPath(1, 1)

sp.AppendLineSegment 1, 1

sp.AppendCurveSegment 3, 3

sp.AppendCurveSegment 5, 1

sp.AppendCurveSegment 6, 4

sp.Nodes(2).Type = cdrSmoothNode

sp.Nodes(3).Type = cdrSmoothNode

Set s = ActiveLayer.CreateCurve(crv)

Set seg = ActiveShape.Curve.Segments(2)

seg.GetEndingControlPointPosition x, y

Set seg2 = ActiveShape.Curve.Segments(ActiveShape.Curve.Segments.Count)

seg2.SetEndingControlPointPosition x, y

End Sub

 Related Topics


Segment.SetStartingControlPointPosition

Sub SetStartingControlPointPosition(ByVal PositionX As Double, ByVal PositionY As Double)

Segment

Description

The SetStartingControlPointPosition method sets the position of the starting control point.

Parameters	Description

PositionX	Specifies the horizontal position [in]

PositionY	Specifies the vertical position [in]

Example

The following example creates a curve, and sets the starting control point of the last segment to the same position as the starting control point for the second segment.

Sub Test()

Dim s As Shape, s2 As Shape

Dim sp As SubPath

Dim crv As Curve, crv2 As Curve

Dim seg As Segment, seg2 As Segment

Dim x As Double, y As Double

Set crv = CreateCurve(ActiveDocument)

ActiveDocument.ReferencePoint = cdrBottomLeft

Set sp = crv.CreateSubPath(1, 1)

sp.AppendLineSegment 1, 1

sp.AppendCurveSegment 3, 3

sp.AppendCurveSegment 5, 1

sp.AppendCurveSegment 6, 4

sp.Nodes(2).Type = cdrSmoothNode

sp.Nodes(3).Type = cdrSmoothNode

Set s = ActiveLayer.CreateCurve(crv)

Set seg = ActiveShape.Curve.Segments(2)

seg.GetStartingControlPointPosition x, y

Set seg2 = ActiveShape.Curve.Segments(ActiveShape.Curve.Segments.Count)

seg2.SetStartingControlPointPosition x, y

End Sub

 Related Topics


SegmentRange properties

SegmentRange     Legend

    Application
    Count
  Item
    Length
    NodeRange
    Parent
    Type


SegmentRange methods

SegmentRange     Legend

   Add
   AddNode
   AddRange
   Remove
   RemoveAll
   RemoveRange
   SetType


SegmentRange

Class SegmentRange

Properties     Methods     Referenced By

The SegmentRange class represents an array of segments of a curve.

You can create a SegmentRange object by using the New keyword in Visual Basic.

 Related Topics


SegmentRange.Application

Property Application As Application

SegmentRange

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


SegmentRange.Count

Property Count As Long

SegmentRange

Description

The Count property returns the number of segments in the range.

Read-Only

Example

The following example displays the number of curve segments in the selected curve. It then allows the user to convert all curve segments to lines.

Sub Test()

Dim sgr As New SegmentRange

Dim seg As Segment

Dim r As VbMsgBoxResult

If ActiveShape Is Nothing Then Exit Sub

If ActiveShape.Type <> cdrCurveShape Then

MsgBox "Select a curve and try again"

Exit Sub

End If

For Each seg In ActiveShape.Curve.Segments

If seg.Type = cdrCurveSegment Then sgr.Add seg

Next seg

If sgr.Count = 0 Then

MsgBox "No curve segments found"

Else

r = MsgBox(sgr.Count & " curve segments found. Convert them to lines?", vbYesNo)

If r = vbYes Then

sgr.SetType cdrLineSegment

End If

End If

End Sub

 Related Topics


SegmentRange.Item

Property Item(ByVal Index As Long) As Segment

SegmentRange

Description

The Item property returns the specified Segment from the segment range.

The Item property is the default property and its reference may be omitted when referencing items in the range. For example, SegmentRange.Item(2) is the same as SegmentRange(2) - they both reference the second segment range object in the range.

Read-Only

Parameters	Description

Index	Specifies the segment to return [in]

Example

The following example adds a node to the middle of each curve segment in the selected curve.

Sub Test()

Dim sgr As SegmentRange

Dim n As Node

Dim i As Long

Set sgr = ActiveShape.Curve.Segments.All

For i = sgr.Count To 1 Step -1

If sgr(i).Type = cdrLineSegment Then sgr.Remove i

' Same as: If sgr.Item(i).Type <> cdrLineSegment Then sgr.Remove i

Next i

If sgr.Count > 0 Then sgr.AddNode

End Sub

 Related Topics


SegmentRange.Length

Property Length As Double

SegmentRange

Description

The Length property returns the total length of all segments in a range.

The length is measured in document units.

Read-Only

Example

The following example displays the total length of all curve segments in the selected curve.

Sub Test()

Dim sgr As New SegmentRange

Dim seg As Segment

For Each seg In ActiveShape.Curve.Segments

If seg.Type = cdrCurveSegment Then sgr.Add seg

Next seg

MsgBox "All curve segments have total length of " & sgr.Length & """"

End Sub

 Related Topics


SegmentRange.NodeRange

Property NodeRange As NodeRange

SegmentRange

Description

The NodeRange property returns a NodeRange object that contains all nodes that end the segments in the active segment range object.

Read-Only

Example

The following example converts all line segments to curves and changes the type of all ending nodes of the segments to smooth.

Sub Test()

Dim sgr As New SegmentRange

Dim seg As Segment

For Each seg In ActiveShape.Curve.Segments

If seg.Type = cdrLineSegment Then sgr.Add seg

Next seg

sgr.SetType cdrCurveSegment

sgr.NodeRange.SetType cdrSmoothNode

End Sub

 Related Topics


SegmentRange.Parent

Property Parent As Curve

SegmentRange

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


SegmentRange.Type

Property Type As cdrSegmentType

SegmentRange

Description

The Type property returns a value associated with the type of segments in the range.

The Type property returns a value of cdrSegmentType. If there is a mixture of line and curve segments, a value of cdrMixedSegments is returned.

Read-Only

Example

The following example determines if all segments in the selected shape are curves.

Sub Test()

Dim sgr As SegmentRange

Dim r As VbMsgBoxResult

Set sgr = ActiveShape.Curve.Segments.All

If sgr.Type <> cdrCurveSegment Then

r = MsgBox("There are some lime segments in the shape." & vbCr & _

"Do you want to convert them to curves?", vbYesNo)

If r = vbYes Then sgr.SetType cdrCurveSegment

Else

MsgBox "All segments are curves"

End If

End Sub

 Related Topics


SegmentRange.Add

Sub Add(ByVal Segment As Segment)

SegmentRange

Description

The Add method adds a segment to a range.

Parameters	Description

Segment	Specifies the segment to be added [in]

Example

The following example adds an extra node to the middle of any segment longer than 1", dividing it into two separate segments.

Sub Test()

Dim sgr As New SegmentRange

Dim seg As Segment

Do

sgr.RemoveAll

For Each seg In ActiveShape.Curve.Segments

If seg.Length > 1 Then sgr.Add seg

Next seg

If sgr.Count <> 0 Then sgr.AddNode

Loop While sgr.Count <> 0

End Sub

 Related Topics


SegmentRange.AddNode

Sub AddNode()

SegmentRange

Description

The AddNode method adds a new node to the middle of each segment in a segment range.

Example

The following example adds a node to the middle of each segment in the selected curve.

Sub Test()

ActiveShape.Curve.Segments.All.AddNode

End Sub

 Related Topics


SegmentRange.AddRange

Sub AddRange(ByVal SegmentRange As SegmentRange)

SegmentRange

Description

The AddRange method adds segments from a specified range to the active range. (It combines the two ranges.)

Parameters	Description

SegmentRange	Specifies the range of segment items that are added to active segment range [in]

Example

The following example creates a text object containing the letter "B" and converts it to curves. Then it creates a range containing the segments from the second and third subpaths (that is, the inner "holes" in the letter "B"), and converts the segments to lines.

Sub Test()

Dim s As Shape

Dim sgr As SegmentRange

Set s = ActiveLayer.CreateArtisticText(0, 0, "B")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 72

End With

s.ConvertToCurves

Set sgr = s.Curve.Subpaths(2).Segments.All

sgr.AddRange s.Curve.Subpaths(3).Segments.All

sgr.SetType cdrLineSegment

End Sub

 Related Topics


SegmentRange.Remove

Sub Remove(ByVal Index As Long)

SegmentRange

Description

The Remove method removes a specified segment from a range. This excludes the segment from the range object, but does not affect the segment itself.

Parameters	Description

Index	Specifies the segment to be removed [in]

Example

The following example highlights each curve segment that is adjacent to a cusp node, using a red stroke.

Sub Test()

Dim s As Shape

Dim sgr As SegmentRange

Dim seg As Segment

Dim i As Long

Set sgr = ActiveShape.Curve.Segments.All

For i = sgr.Count To 1 Step -1

Set seg = sgr(i)

If seg.Type = cdrLineSegment Then

sgr.Remove i

Else

If seg.StartNode.Type <> cdrCuspNode And seg.EndNode.Type <> cdrCuspNode Then

sgr.Remove i

End If

End If

Next i

For Each seg In sgr

Set s = ActiveLayer.CreateCurveSegment(seg.StartNode.PositionX, seg.StartNode.PositionY, _

seg.EndNode.PositionX, seg.EndNode.PositionY, _

seg.StartingControlPointLength, seg.StartingControlPointAngle, _

seg.EndingControlPointLength, seg.EndingControlPointAngle)

s.Outline.Width = 0.01

s.Outline.Color.RGBAssign 255, 0, 0

Next seg

End Sub

 Related Topics


SegmentRange.RemoveAll

Sub RemoveAll()

SegmentRange

Description

The RemoveAll method removes all segments from the range. This excludes the segments from the range object, but does not affect the segments themselves.

Example

The following example adds an extra node to the middle of any segment longer than 1", dividing it into two separate segments.

Sub Test()

Dim sgr As New SegmentRange

Dim seg As Segment

Do

sgr.RemoveAll

For Each seg In ActiveShape.Curve.Segments

If seg.Length > 1 Then sgr.Add seg

Next seg

If sgr.Count <> 0 Then sgr.AddNode

Loop While sgr.Count <> 0

End Sub

 Related Topics


SegmentRange.RemoveRange

Sub RemoveRange(ByVal SegmentRange As SegmentRange)

SegmentRange

Description

The RemoveRange method removes the segments in the specified range from the current range.

Parameters	Description

SegmentRange	Specifies the range of segments to be removed [in]

Example

The following example creates a curve and two shape ranges. The first shape range contains all the curve's segments, and the second range contains only the curved segments of the curve. The second range is then removed from the first range, leaving only the line segments in the first range.

Sub Test()

Dim s As Shape

Dim n As Node

Dim sp As SubPath

Dim crv As Curve

Dim sg As Segment

Dim sgr As SegmentRange

Dim sgr2 As New SegmentRange

Set crv = CreateCurve(ActiveDocument)

ActiveDocument.ReferencePoint = cdrBottomLeft

Set sp = crv.CreateSubPath(-1, 0.2)

sp.AppendLineSegment 0.5, 1

sp.AppendCurveSegment 2, 3

sp.AppendCurveSegment 4, 1

sp.AppendCurveSegment 5, 4

sp.AppendCurveSegment 7, 2

sp.AppendLineSegment 8, 5

sp.AppendLineSegment 9, 1

Set s = ActiveLayer.CreateCurve(crv)

Set sgr = s.Curve.Segments.All

For Each sg In s.Curve.Segments

If sg.Type = cdrCurveSegment Then

sgr2.Add sg

End If

Next sg

sgr.RemoveRange sgr2

End Sub

 Related Topics


SegmentRange.SetType

Sub SetType(ByVal Type As cdrSegmentType)

SegmentRange

Description

The SetType method sets the type of segment for all segments in a range.

Parameters	Description

Type	Specifies the type of segment for all segments in a range. The Type parameter accepts a value of cdrSegmentType. [in]

Example

The following example converts all segments in the selected shape to curve segments and changes the type of all its nodes to smooth.

Sub Test()

With ActiveShape.Curve

.Segments.All.SetType cdrCurveSegment

.Nodes.All.SetType cdrSmoothNode

End With

End Sub

 Related Topics


Segments properties

Segments     Legend

    Application
    Count
  Item
    Parent


Segments methods

Segments     Legend

   All
   AllExcluding
   Range


Segments

Class Segments

Properties     Methods     Referenced By

The Segments class represents a collection of segments in a curve or subpath.

 Related Topics


Segments.Application

Property Application As Application

Segments

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Segments.Count

Property Count As Long

Segments

Description

The Count property returns the number of segments in the Segments collection.

Read-Only

Example

The following example displays the number of nodes, segments, and subpaths in the active curve.

Sub Test()

Dim crv As Curve

Set crv = ActiveShape.Curve

MsgBox "The curve contains:" & vbCr & _

"Nodes: " & crv.Nodes.Count & vbCr & _

"Segments: " & crv.Segments.Count & vbCr & _

"Subpaths: " & crv.Subpaths.Count

End Sub

 Related Topics


Segments.Item

Property Item(ByVal Index As Long) As Segment

Segments

Description

The Item property returns the specified Segment.

The Item property is the default property and its reference may be omitted when referencing items in the collection. For example, Segments.Item(2) is the same as Segments(2) - they both reference the second segment object in the Segments collection.

Read-Only

Parameters	Description

Index	Specifies the Segment by its index number [in]

Example

The following example converts all segments in the curve to curve segments.

Sub Test()

Dim i As Long

For i = 1 To ActiveShape.Curve.Segments.Count

ActiveShape.Curve.Segments(i).Type = cdrCurveSegment

Next i

End Sub

Sub Test()

Dim seg As Segment

For Each seg In ActiveShape.Curve.Segments

seg.Type = cdrCurveSegment

Next seg

End Sub

 Related Topics


Segments.Parent

Property Parent As Curve

Segments

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Segments.All

Function All() As SegmentRange

Segments

Description

The All method returns a SegmentRange object which contains all segments from the collection.

Return value

Returns SegmentRange

Example

The following example converts all curve segments in all curves to linear.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrCurveShape Then

s.Curve.Segments.All.SetType cdrLineSegment

End If

Next s

End Sub

 Related Topics


Segments.AllExcluding

Function AllExcluding(ByRef IndexArray() As Variant) As SegmentRange

Segments

Description

The AllExcluding method returns a SegmentRange object which contains all segments, except for specified segments, from the Segments collection.

This function accepts a variable number of arguments. It also accepts arrays.

Parameters	Description

IndexArray	Represents a range of index numbers that identify and group specific segments [in]

Return value

Returns SegmentRange

Example

The following example adds a node to the middle of each curve segment, except the first three.

Sub Test()

Dim sgr As SegmentRange

Set sgr = ActiveShape.Curve.Segments.AllExcluding(1, 2, 3)

sgr.AddNode

End Sub

 Related Topics


Segments.Range

Function Range(ByRef IndexArray() As Variant) As SegmentRange

Segments

Description

The Range method returns a SegmentRange object which contains all specified segments from the collection.

This method accepts a variable number of arguments. It also accepts arrays.

Parameters	Description

IndexArray	Represents index numbers that identify specific segments [in]

Return value

Returns SegmentRange

Example

The following example converts segments 2, 3, and 4 of the selected curve to lines.

Sub Test()

Dim sgr As SegmentRange

Set sgr = ActiveShape.Curve.Segments.Range(Array(2, 3, 4))

sgr.SetType cdrLineSegment

End Sub

 Related Topics


SelectionInfo properties

SelectionInfo     Legend

    Application
    BlendBottomShape
    BlendPath
    BlendTopShape
    CanApplyBlend
    CanApplyContour
    CanApplyDistortion
    CanApplyEnvelope
    CanApplyFill
    CanApplyFillOutline
    CanApplyOutline
    CanApplyTransparency
    CanAssignURL
    CanClone
    CanCloneBlend
    CanCloneContour
    CanCloneDropShadow
    CanCloneExtrude
    CanCopyBlend
    CanCopyContour
    CanCopyDistortion
    CanCopyDropShadow
    CanCopyEnvelope
    CanCopyExtrude
    CanCopyLens
    CanCopyPerspective
    CanCopyPowerclip
    CanCreateBlend
    CanDeleteControl
    CanLockShapes
    CanPrint
    CanUngroup
    CanUnlockShapes
    ConnectorLines
    ContainsRollOverParent
    ContourControlShape
    ContourGroup
    Count
    DimensionControlShape
    DimensionGroup
    DistortionShape
    DistortionType
    DropShadowControlShape
    DropShadowGroup
    ExtrudeBevelGroup
    ExtrudeFaceShape
    ExtrudeGroup
    FirstShape
    FirstShapeWithFill
    FirstShapeWithOutline
    FittedText
    FittedTextControlShape
    HasAutoLabelText
    IsArtisticTextSelected
    IsAttachedToDimension
    IsBevelGroup
    IsBitmapPresent
    IsBitmapSelected
    IsBlendControl
    IsBlendGroup
    IsCloneControl
    IsConnector
    IsConnectorLine
    IsConnectorLineSelected
    IsConnectorSelected
    IsContourControl
    IsContourGroup
    IsControlSelected
    IsControlShape
    IsDimensionControl
    IsDistortion
    IsDistortionPresent
    IsDropShadowControl
    IsDropShadowGroup
    IsEditingRollOver
    IsEditingText
    IsEnvelope
    IsEnvelopePresent
    IsExternalBitmapSelected
    IsExtrudeControl
    IsExtrudeGroup
    IsFittedText
    IsFittedTextControl
    IsFittedTextSelected
    IsGroup
    IsGroupSelected
    IsGuidelineSelected
    IsInternetObjectSelected
    IsLensPresent
    IsLinkControlSelected
    IsLinkGroupSelected
    IsMaskedBitmapPresent
    IsMeshFillPresent
    IsMeshFillSelected
    IsNaturalMediaControl
    IsNaturalMediaGroup
    IsNonExternalBitmapSelected
    IsOLESelected
    IsOnPowerClipContents
    IsParagraphTextSelected
    IsPerspective
    IsPerspectivePresent
    IsRegularShape
    IsRollOverSelected
    IsSecondContourControl
    IsSecondDropShadowControl
    IsSecondExtrudeControl
    IsSecondNaturalMediaControl
    IsSoundObjectSelected
    IsTextSelected
    IsTextSelection
    NaturalMediaControlShape
    NaturalMediaGroup
    Parent
    SecondShape


SelectionInfo

Class SelectionInfo

Properties     Referenced By

SelectionInfo Class

 Related Topics


SelectionInfo.Application

Property Application As Application

SelectionInfo

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


SelectionInfo.BlendBottomShape

Property BlendBottomShape As Shape

SelectionInfo

Description

The BlendBottomShape property returns the bottom shape of the selected blend.

Read-Only

 Related Topics


SelectionInfo.BlendPath

Property BlendPath As Shape

SelectionInfo

Description

The BlendPath property returns the blend path.

Read-Only

 Related Topics


SelectionInfo.BlendTopShape

Property BlendTopShape As Shape

SelectionInfo

Description

The BlendTopShape returns the top shape of the selected blend.

Read-Only

 Related Topics


SelectionInfo.CanApplyBlend

Property CanApplyBlend As Boolean

SelectionInfo

Description

The CanApplyBlend property returns whether the selected shapes can be blended.

Read-Only

 Related Topics


SelectionInfo.CanApplyContour

Property CanApplyContour As Boolean

SelectionInfo

Description

The CanApplyContour property returns whether the selected shape(s) can be contoured.

Read-Only

 Related Topics


SelectionInfo.CanApplyDistortion

Property CanApplyDistortion As Boolean

SelectionInfo

Description

The CanApplyDistortion property returns whether a distortion can be applied to the selected shape(s)

Read-Only

 Related Topics


SelectionInfo.CanApplyEnvelope

Property CanApplyEnvelope As Boolean

SelectionInfo

The CanApplyEnvelope property returns whether an envelope can be applied to the selected shape(s).

Read-Only

 Related Topics


SelectionInfo.CanApplyFill

Property CanApplyFill As Boolean

SelectionInfo

Description

The CanApplyFill property returns whether the selected shape(s) can have a fill.

Read-Only

 Related Topics


SelectionInfo.CanApplyFillOutline

Property CanApplyFillOutline As Boolean

SelectionInfo

Description

The CanApplyFillOutline property returns whether a fill and an outline can be applied to the selected shape.

Read-Only

 Related Topics


SelectionInfo.CanApplyOutline

Property CanApplyOutline As Boolean

SelectionInfo

Description

The CanApplyOutline propety returns whether the selected shape(s) can have an outline.

Read-Only

 Related Topics


SelectionInfo.CanApplyTransparency

Property CanApplyTransparency As Boolean

SelectionInfo

Description

The CanApplyTransparency property returns whether a transparency can be applied to the selected shape(s).

Read-Only

 Related Topics


SelectionInfo.CanAssignURL

Property CanAssignURL As Boolean

SelectionInfo

Description

The CanAssignURL property returns whether a URL can be assigned to the selected shape(s).

Read-Only

 Related Topics


SelectionInfo.CanClone

Property CanClone As Boolean

SelectionInfo

Description

The CanClone property returns whether the selected shapes can be cloned.

Read-Only

 Related Topics


SelectionInfo.CanCloneBlend

Property CanCloneBlend As Boolean

SelectionInfo

Description

The CanCloneBlend property returns whether the selected blend can be cloned.

Read-Only

 Related Topics


SelectionInfo.CanCloneContour

Property CanCloneContour As Boolean

SelectionInfo

Description

The CanCloneContour property returns whether the selected contour can be cloned.

Read-Only

 Related Topics


SelectionInfo.CanCloneDropShadow

Property CanCloneDropShadow As Boolean

SelectionInfo

Description

The CanCloneDropShadow property returns whether the selected blend can be copied.

Read-Only

 Related Topics


SelectionInfo.CanCloneExtrude

Property CanCloneExtrude As Boolean

SelectionInfo

Description

The CanCloneExtrude property returns whether the selected extrude can be cloned.

Read-Only

 Related Topics


SelectionInfo.CanCopyBlend

Property CanCopyBlend As Boolean

SelectionInfo

Description

The CanCopyBlend property returns whether the selected blend can be copied.

Read-Only

 Related Topics


SelectionInfo.CanCopyContour

Property CanCopyContour As Boolean

SelectionInfo

Description

The CanCopyContour property returns whether the selected contour can be copied.

Read-Only

 Related Topics


SelectionInfo.CanCopyDistortion

Property CanCopyDistortion As Boolean

SelectionInfo

Description

The CanCopyDistortion property returns whether the selected distortion can be copied.

Read-Only

 Related Topics


SelectionInfo.CanCopyDropShadow

Property CanCopyDropShadow As Boolean

SelectionInfo

Description

The CanCopyDropShadow property returns whether the selected drop shadow can be copied.

Read-Only

 Related Topics


SelectionInfo.CanCopyEnvelope

Property CanCopyEnvelope As Boolean

SelectionInfo

Description

The CanCopyEnvelope property returns whether the selected envelope can be copied.

Read-Only

 Related Topics


SelectionInfo.CanCopyExtrude

Property CanCopyExtrude As Boolean

SelectionInfo

Description

The CanCopyExtrude property returns whether the selected extrude can be copied.

Read-Only

 Related Topics


SelectionInfo.CanCopyLens

Property CanCopyLens As Boolean

SelectionInfo

Description

The CanCopyLens property returns whether the selected lens can be copied.

Read-Only

 Related Topics


SelectionInfo.CanCopyPerspective

Property CanCopyPerspective As Boolean

SelectionInfo

Description

The CanCopyPerspective property returns whether the selected perspective can be copied.

Read-Only

 Related Topics


SelectionInfo.CanCopyPowerclip

Property CanCopyPowerclip As Boolean

SelectionInfo

Description

The CanCopyPowerclip property returns whether the selected PowerClip can be copied.

Read-Only

 Related Topics


SelectionInfo.CanCreateBlend

Property CanCreateBlend As Boolean

SelectionInfo

Description

The CanCreateBlend property returns whether the selected shapes can create a blend.

Read-Only

 Related Topics


SelectionInfo.CanDeleteControl

Property CanDeleteControl As Boolean

SelectionInfo

Description

The CanDeleteControl property returns whether the selected control can be deleted.

Read-Only

 Related Topics


SelectionInfo.CanLockShapes

Property CanLockShapes As Boolean

SelectionInfo

Description

The CanLockShapes property returns whether the selected shapes can be locked.

Read-Only

 Related Topics


SelectionInfo.CanPrint

Property CanPrint As Boolean

SelectionInfo

Description

The CanPrint property returns whether the current document can be printed.

Read-Only

 Related Topics


SelectionInfo.CanUngroup

Property CanUngroup As Boolean

SelectionInfo

Description

The CanUngroup property returns whether any of the selected shapes can be ungrouped.

Read-Only

 Related Topics


SelectionInfo.CanUnlockShapes

Property CanUnlockShapes As Boolean

SelectionInfo

Description

The CanUnlockShapes property returns whether the selected shapes can be unlocked.

Read-Only

 Related Topics


SelectionInfo.ConnectorLines

Property ConnectorLines As Shape

SelectionInfo

Description

The ConnectorLines property returns the selected connector lines.

Read-Only

 Related Topics


SelectionInfo.ContainsRollOverParent

Property ContainsRollOverParent As Boolean

SelectionInfo

Description

The ContainsRollOverParent  returns whether any of the selected shapes is a rollover parent.

Read-Only

 Related Topics


SelectionInfo.ContourControlShape

Property ContourControlShape As Shape

SelectionInfo

Description

The ContourControlShape property returns the control shape of the selected contour.

Read-Only

 Related Topics


SelectionInfo.ContourGroup

Property ContourGroup As Shape

SelectionInfo

Description

The ContourGroup property returns the selected contour group.

Read-Only

 Related Topics


SelectionInfo.Count

Property Count As Long

SelectionInfo

Description

The Count property returns the number of objects.

Read-Only

 Related Topics


SelectionInfo.DimensionControlShape

Property DimensionControlShape As Shape

SelectionInfo

Description

The DimensionControlShape property returns the control shape of the selected dimension.

Read-Only

 Related Topics


SelectionInfo.DimensionGroup

Property DimensionGroup As Shape

SelectionInfo

Description

The DimensionGroup property returns the selected dimension group.

Read-Only

 Related Topics


SelectionInfo.DistortionShape

Property DistortionShape As Shape

SelectionInfo

Description

The DistortionShape property returns the distortion state of the selected shape.

Read-Only

 Related Topics


SelectionInfo.DistortionType

Property DistortionType As cdrDistortionType

SelectionInfo

Description

The DistortionType property returns the type of the selected distortion.

Read-Only

 Related Topics


SelectionInfo.DropShadowControlShape

Property DropShadowControlShape As Shape

SelectionInfo

Description

The DropShadowControlShape property returns the control shape of the selected drop shadow.

Read-Only

 Related Topics


SelectionInfo.DropShadowGroup

Property DropShadowGroup As Shape

SelectionInfo

Description

The DropShadowGroup property returns the selected drop shadow group.

Read-Only

 Related Topics


SelectionInfo.ExtrudeBevelGroup

Property ExtrudeBevelGroup As Shape

SelectionInfo

Description

The ExtrudeBevelGroup property returns the bevel group of the selected extrude.

Read-Only

 Related Topics


SelectionInfo.ExtrudeFaceShape

Property ExtrudeFaceShape As Shape

SelectionInfo

Description

The ExtrudeFaceShape property returns the face shape of the selected extrude.

Read-Only

 Related Topics


SelectionInfo.ExtrudeGroup

Property ExtrudeGroup As Shape

SelectionInfo

Description

The ExtrudeGroup property returns the selected extrude group.

Read-Only

 Related Topics


SelectionInfo.FirstShape

Property FirstShape As Shape

SelectionInfo

Description

The FirstShape property returns the first selected shape.

Read-Only

 Related Topics


SelectionInfo.FirstShapeWithFill

Property FirstShapeWithFill As Shape

SelectionInfo

Description

The FirstShapeWithFill property returns the first selected shape with a fill.

Read-Only

 Related Topics


SelectionInfo.FirstShapeWithOutline

Property FirstShapeWithOutline As Shape

SelectionInfo

Description

The FirstShapeWithOutline property returns the first selected shape with an outline.

Read-Only

 Related Topics


SelectionInfo.FittedText

Property FittedText As Shape

SelectionInfo

Description

The FittedText property returns the selected fitted text.

Read-Only

 Related Topics


SelectionInfo.FittedTextControlShape

Property FittedTextControlShape As Shape

SelectionInfo

Description

The FittedTextControlShape property returns the control shape of the selected fitted text.

Read-Only

 Related Topics


SelectionInfo.HasAutoLabelText

Property HasAutoLabelText As Boolean

SelectionInfo

Description

The HasAutoLabelText property returns whether the selected shape has automatically labelled text.

Read-Only

 Related Topics


SelectionInfo.IsArtisticTextSelected

Property IsArtisticTextSelected As Boolean

SelectionInfo

Description

The IsArtisticTextSelected property returns whether the selected shape is artistic text.

Read-Only

 Related Topics


SelectionInfo.IsAttachedToDimension

Property IsAttachedToDimension As Boolean

SelectionInfo

Description

The IsAttachedToDimension property returns whether any of the selected shapes is attached to a dimension line.

Read-Only

 Related Topics


SelectionInfo.IsBevelGroup

Property IsBevelGroup As Boolean

SelectionInfo

Description

The IsBevelGroup property returns whether the selected shape is a bevel group.

Read-Only

 Related Topics


SelectionInfo.IsBitmapPresent

Property IsBitmapPresent As Boolean

SelectionInfo

Description

The IsBitmapPresent property returns whether any of the selected shapes contains a bitmap.

Read-Only

 Related Topics


SelectionInfo.IsBitmapSelected

Property IsBitmapSelected As Boolean

SelectionInfo

Description

The IsBitmapSelected property returns whether any of the selected shapes is a bitmap.

Read-Only

 Related Topics


SelectionInfo.IsBlendControl

Property IsBlendControl As Boolean

SelectionInfo

Description

The IsBlendControl property returns whether the selected shape is a blend control.

Read-Only

 Related Topics


SelectionInfo.IsBlendGroup

Property IsBlendGroup As Boolean

SelectionInfo

Description

The IsBlendGroup property returns whether the selected shape is a blend group.

Read-Only

 Related Topics


SelectionInfo.IsCloneControl

Property IsCloneControl As Boolean

SelectionInfo

Description

The IsCloneControl property returns whether the selected shape is a clone control.

Read-Only

 Related Topics


SelectionInfo.IsConnector

Property IsConnector As Boolean

SelectionInfo

Description

The IsConnector property returns whether the selected shape is a fitted text.

Read-Only

 Related Topics


SelectionInfo.IsConnectorLine

Property IsConnectorLine As Boolean

SelectionInfo

Description

The IsConnectorLine property returns whether the selected shape is a connector line.

Read-Only

 Related Topics


SelectionInfo.IsConnectorLineSelected

Property IsConnectorLineSelected As Boolean

SelectionInfo

Description

The IsConnectorLineSelected property returns whether any of the selected shapes is a connector line.

Read-Only

 Related Topics


SelectionInfo.IsConnectorSelected

Property IsConnectorSelected As Boolean

SelectionInfo

Description

The IsConnectorSelected property returns whether any of the selected shapes is a connector.

Read-Only

 Related Topics


SelectionInfo.IsContourControl

Property IsContourControl As Boolean

SelectionInfo

Description

The IsContourControl property returns whether the selected shape is a contour control.

Read-Only

 Related Topics


SelectionInfo.IsContourGroup

Property IsContourGroup As Boolean

SelectionInfo

Description

The IsContourGroup property returns whether the selected shape is a contour group.

Read-Only

 Related Topics


SelectionInfo.IsControlSelected

Property IsControlSelected As Boolean

SelectionInfo

Description

The IsControlSelected property returns whether a control is selected.

Read-Only

 Related Topics


SelectionInfo.IsControlShape

Property IsControlShape As Boolean

SelectionInfo

Description

The IsControlShape property returns whether the selected shape is a link control.

Read-Only

 Related Topics


SelectionInfo.IsDimensionControl

Property IsDimensionControl As Boolean

SelectionInfo

Description

The IsDimensionControl property returns whether the selected shape is a dimension control.

Read-Only

 Related Topics


SelectionInfo.IsDistortion

Property IsDistortion As Boolean

SelectionInfo

Description

The IsDistortion property returns whether the selected shape is a distortion.

Read-Only

 Related Topics


SelectionInfo.IsDistortionPresent

Property IsDistortionPresent As Boolean

SelectionInfo

Description

The IsDistortionPresent returns whether any of the selected shapes is a distortion.

Read-Only

 Related Topics


SelectionInfo.IsDropShadowControl

Property IsDropShadowControl As Boolean

SelectionInfo

Description

The IsDropShadowControl propery returns whether the selected shape is a drop shadow control.

Read-Only

 Related Topics


SelectionInfo.IsDropShadowGroup

Property IsDropShadowGroup As Boolean

SelectionInfo

Description

The IsDropShadowGroup property returns whether the selected shape is a drop shadow group.

Read-Only

 Related Topics


SelectionInfo.IsEditingRollOver

Property IsEditingRollOver As Boolean

SelectionInfo

Description

The IsEditingRollOver property returns the rollover editing state.

Read-Only

 Related Topics


SelectionInfo.IsEditingText

Property IsEditingText As Boolean

SelectionInfo

Description

The IsEditingText property returns the text editing state.

Read-Only

 Related Topics


SelectionInfo.IsEnvelope

Property IsEnvelope As Boolean

SelectionInfo

Description

The IsEnvelope property returns whether the selected shape is an envelope.

Read-Only

 Related Topics


SelectionInfo.IsEnvelopePresent

Property IsEnvelopePresent As Boolean

SelectionInfo

Description

The IsEnvelopePresent property returns whether any of the selected shapes is an envelope.

Read-Only

 Related Topics


SelectionInfo.IsExternalBitmapSelected

Property IsExternalBitmapSelected As Boolean

SelectionInfo

Description

The IsExternalBitmapSelected property returns whether any of the selected shapes is an externally-linked bitmap.

Read-Only

 Related Topics


SelectionInfo.IsExtrudeControl

Property IsExtrudeControl As Boolean

SelectionInfo

Description

The IsExtrudeControl property returns whether the selected shape is an extrude control.

Read-Only

 Related Topics


SelectionInfo.IsExtrudeGroup

Property IsExtrudeGroup As Boolean

SelectionInfo

Description

The IsExtrudeGroup property returns whether the selected shape is an extrude group.

Read-Only

 Related Topics


SelectionInfo.IsFittedText

Property IsFittedText As Boolean

SelectionInfo

Description

The IsFittedText property returns whether the selected shape is a fitted text control.

Read-Only

 Related Topics


SelectionInfo.IsFittedTextControl

Property IsFittedTextControl As Boolean

SelectionInfo

Description

The IsFittedTextControl property returns whether the selected shape is a natural media control.

Read-Only

 Related Topics


SelectionInfo.IsFittedTextSelected

Property IsFittedTextSelected As Boolean

SelectionInfo

Description

The IsFittedTextSelected property returns whether any of the selected shapes is fitted text.

Read-Only

 Related Topics


SelectionInfo.IsGroup

Property IsGroup As Boolean

SelectionInfo

Description

The IsGroup property returns whether the selected shape is a group.

Read-Only

 Related Topics


SelectionInfo.IsGroupSelected

Property IsGroupSelected As Boolean

SelectionInfo

Description

The IsGroupSelected property returns whether any of the selected shapes is a group.

Read-Only

 Related Topics


SelectionInfo.IsGuidelineSelected

Property IsGuidelineSelected As Boolean

SelectionInfo

Description

The IsGuidelineSelected property returns whether any of the selected shapes is a guideline.

Read-Only

 Related Topics


SelectionInfo.IsInternetObjectSelected

Property IsInternetObjectSelected As Boolean

SelectionInfo

Description

The IsInternetObjectSelected property returns whether any of the selected shapes is an Internet object.

Read-Only

 Related Topics


SelectionInfo.IsLensPresent

Property IsLensPresent As Boolean

SelectionInfo

Description

The IsLensPresent property returns whether any of the selected shapes contains a lens.

Read-Only

 Related Topics


SelectionInfo.IsLinkControlSelected

Property IsLinkControlSelected As Boolean

SelectionInfo

Description

The IsLinkControlSelected property returns whether any of the selected shapes is a link control.

Read-Only

 Related Topics


SelectionInfo.IsLinkGroupSelected

Property IsLinkGroupSelected As Boolean

SelectionInfo

Description

The IsLinkGroupSelected property returns whether any of the selected shapes is a link group.

Read-Only

 Related Topics


SelectionInfo.IsMaskedBitmapPresent

Property IsMaskedBitmapPresent As Boolean

SelectionInfo

Description

The IsMaskedBitmapPresent property returns whether any of the selected shapes contains a masked bitmap.

Read-Only

 Related Topics


SelectionInfo.IsMeshFillPresent

Property IsMeshFillPresent As Boolean

SelectionInfo

Description

The IsMeshFillPresent property returns whether any of the selected shapes is a mesh fill.

Read-Only

 Related Topics


SelectionInfo.IsMeshFillSelected

Property IsMeshFillSelected As Boolean

SelectionInfo

Description

The IsMeshFillSelected property returns whether any of the selected shapes is a mesh fill.

Read-Only

 Related Topics


SelectionInfo.IsNaturalMediaControl

Property IsNaturalMediaControl As Boolean

SelectionInfo

Description

The IsNaturalMediaControl property returns whether the selected shape is a natural media control.

Read-Only

 Related Topics


SelectionInfo.IsNaturalMediaGroup

Property IsNaturalMediaGroup As Boolean

SelectionInfo

Description

The IsNaturalMediaGroup property returns whether the selected shape is a natural media group.

Read-Only

 Related Topics


SelectionInfo.IsNonExternalBitmapSelected

Property IsNonExternalBitmapSelected As Boolean

SelectionInfo

Description

The IsNonExternalBitmapSelected property returns whether any of the selected shapes is a bitmap that is not externally-linked.

Read-Only

 Related Topics


SelectionInfo.IsOLESelected

Property IsOLESelected As Boolean

SelectionInfo

Description

The IsOLESelected property returns whether the selected shape is an OLE object.

Read-Only

 Related Topics


SelectionInfo.IsOnPowerClipContents

Property IsOnPowerClipContents As Boolean

SelectionInfo

Description

The IsOnPowerClipContents property returns the editing state of a PowerClip.

Read-Only

 Related Topics


SelectionInfo.IsParagraphTextSelected

Property IsParagraphTextSelected As Boolean

SelectionInfo

Description

The IsParagraphTextSelected property returns whether the selected shape is paragraph text.

Read-Only

 Related Topics


SelectionInfo.IsPerspective

Property IsPerspective As Boolean

SelectionInfo

Description

The IsPerspective property returns whether the selected shape has a perspective effect.

Read-Only

 Related Topics


SelectionInfo.IsPerspectivePresent

Property IsPerspectivePresent As Boolean

SelectionInfo

Description

The IsPerspectivePresent property returns whether any of the selected shapes is a perspective.

Read-Only

 Related Topics


SelectionInfo.IsRegularShape

Property IsRegularShape As Boolean

SelectionInfo

Description

The IsRegularShape property returns whether the selected shape is a regular shape.

Read-Only

 Related Topics


SelectionInfo.IsRollOverSelected

Property IsRollOverSelected As Boolean

SelectionInfo

Description

The IsRollOverSelected property returns whether any of the selected shapes is a rollover.

Read-Only

 Related Topics


SelectionInfo.IsSecondContourControl

Property IsSecondContourControl As Boolean

SelectionInfo

Description

The IsSecondContourControl property returns whether the second selected shape is a contour control.

Read-Only

 Related Topics


SelectionInfo.IsSecondDropShadowControl

Property IsSecondDropShadowControl As Boolean

SelectionInfo

Description

The IsSecondDropShadowControl property returns whether the second selected shape is a drop shadow control.

Read-Only

 Related Topics


SelectionInfo.IsSecondExtrudeControl

Property IsSecondExtrudeControl As Boolean

SelectionInfo

Description

The IsSecondExturdeControl property returns whether the second selected shape is an extrude or a bevel control.

Read-Only

 Related Topics


SelectionInfo.IsSecondNaturalMediaControl

Property IsSecondNaturalMediaControl As Boolean

SelectionInfo

Description

The IsSecondNAturalMediaControl property returns whether the second selected shape is a natural media control.

Read-Only

 Related Topics


SelectionInfo.IsSoundObjectSelected

Property IsSoundObjectSelected As Boolean

SelectionInfo

Description

The IsSoundObjectSelected property returns whether any of the selected shapes is a sound object.

Read-Only

 Related Topics


SelectionInfo.IsTextSelected

Property IsTextSelected As Boolean

SelectionInfo

Description

The IsTextSelected property returns whether the selected shape is text.

Read-Only

 Related Topics


SelectionInfo.IsTextSelection

Property IsTextSelection As Boolean

SelectionInfo

Description

The IsTextSelection property returns whether the selection is text.

Read-Only

 Related Topics


SelectionInfo.NaturalMediaControlShape

Property NaturalMediaControlShape As Shape

SelectionInfo

Description

The NaturalMediaControlShape property returns the natural media control shape.

Read-Only

 Related Topics


SelectionInfo.NaturalMediaGroup

Property NaturalMediaGroup As Shape

SelectionInfo

Description

The NaturalMediaGroup property returns the natural media group.

Read-Only

 Related Topics


SelectionInfo.Parent

Property Parent As Document

SelectionInfo

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Read-Only

 Related Topics


SelectionInfo.SecondShape

Property SecondShape As Shape

SelectionInfo

Description

The SecondShape property returns the second selected shape.

Read-Only

 Related Topics


SeparationPlate properties

SeparationPlate     Legend

      Angle
    Color
      Enabled
      Frequency
      OverprintGraphic
      OverprintText
    Type


SeparationPlate

Class SeparationPlate

Properties     Referenced By

The SeparationPlate class represents the separation plate object.

 Related Topics


SeparationPlate.Angle

Property Angle As Double

SeparationPlate

Description

The Angle property returns the angle of a separation plate.

Example

The following example displays the angle and frequency of each separation plate.

Sub Test()

Dim intPlateCounter As Integer

With ActiveDocument

With .PrintSettings.Separations.Plates

For intPlateCounter = 1 To .Count - 1

MsgBox "The angle of the " & .Item(intPlateCounter).Color & _

" plate is " & .Item(intPlateCounter).Angle & vbCr & _

" The frequency is " & .Item(intPlateCounter).Frequency

Next intPlateCounter

End With

End With

End Sub

 Related Topics


SeparationPlate.Color

Property Color As String

SeparationPlate

Description

The Color property returns the color of the separation plate.

Read-Only

Example

The following example displays the color of each separation plate.

Sub Test()

Dim strPlates As String

Dim Plate As SeparationPlate

Dim intPlateCounter As Integer

With ActiveDocument.PrintSettings.Separations

For intPlateCounter = 1 To .Plates.Count - 1

strPlates = strPlates & .Plates(intPlateCounter).Color & vbCr

Next intPlateCounter

MsgBox strPlates

End With

End Sub

 Related Topics


SeparationPlate.Enabled

Property Enabled As Boolean

SeparationPlate

Description

The Enabled property allows a user to specify which separation plate to print.

Example

The following example displays the disabled separation plates.

Sub Test()

Dim intPlateCounter As Integer

With ActiveDocument.PrintSettings.Separations

For intPlateCounter = 1 To .Plates.Count - 1

If .Plates(intPlateCounter).Enabled <> True Then

MsgBox "The " & .Plates(intPlateCounter).Color & _

" is not enabled."

End If

Next intPlateCounter

End With

End Sub

 Related Topics


SeparationPlate.Frequency

Property Frequency As Double

SeparationPlate

Description

The Frequency property returns the screen frequency of a separation plate.

Example

The following example displays the angle and frequency of each separation plate.

Sub Test()

Dim intPlateCounter As Integer

With ActiveDocument

With .PrintSettings.Separations.Plates

For intPlateCounter = 1 To .Count - 1

MsgBox "The angle of the " & .Item(intPlateCounter).Color & _

" plate is " & .Item(intPlateCounter).Angle & vbCr & _

" The frequency is " & .Item(intPlateCounter).Frequency

Next intPlateCounter

End With

End With

End Sub

 Related Topics


SeparationPlate.OverprintGraphic

Property OverprintGraphic As Boolean

SeparationPlate

Description

The OverprintGraphic property returns or sets whether graphics are overprinted by the current separation plate.

Example

The following example iterates through the collection of separation plates, and sets the values of the OverprintGraphic and OverprintText properties to False.

Sub Test()

Dim intPlateCounter As Integer

With ActiveDocument.PrintSettings.Separations

For intPlateCounter = 1 To .Plates.Count - 1

.Plates(intPlateCounter).OverprintGraphic = False

.Plates(intPlateCounter).OverprintText = False

Next intPlateCounter

End With

End Sub

 Related Topics


SeparationPlate.OverprintText

Property OverprintText As Boolean

SeparationPlate

Description

The OverprintGraphic property returns or sets whether graphics are overprinted by the current separation plate.

Example

The following example iterates through the collection of separation plates, and sets the values of the OverprintGraphic and OverprintText properties to False.

Sub Test()

Dim intPlateCounter As Integer

With ActiveDocument.PrintSettings.Separations

For intPlateCounter = 1 To .Plates.Count - 1

.Plates(intPlateCounter).OverprintGraphic = False

.Plates(intPlateCounter).OverprintText = False

Next intPlateCounter

End With

End Sub

 Related Topics


SeparationPlate.Type

Property Type As PrnPlateType

SeparationPlate

Description

The Type property returns the type of the separation plate.

This property is reserved for future development.

Read-Only

 Related Topics


SeparationPlates properties

SeparationPlates     Legend

    Count
  Item


SeparationPlates

Class SeparationPlates

Properties     Referenced By

The SepartionPlates class represents the collection of separation plates.

 Related Topics


SeparationPlates.Count

Property Count As Long

SeparationPlates

Description

The Count property returns the number of items in the collection.

Read-Only

Example

The following example displays the number of plates in the collection.

Sub Test()

Select Case ActiveDocument.PrintSettings.Separations.Plates.Count

Case 0

MsgBox "There are no plates to print"

Case 1

MsgBox "There's 1 plate to print"

Case Else

MsgBox "There are " & _

ActiveDocument.PrintSettings.Separations.Plates.Count & _

" plates to print"

End Select

End Sub

 Related Topics


SeparationPlates.Item

Property Item(ByVal Index As Long) As SeparationPlate

SeparationPlates

Description

The Item property returns the specified SeparationPlate in the collection.

The Item property is the default property and its reference may be omitted when referencing items in the collection. For example, SeparationPlates.Item(2) is the same as SeparationPlates(2) - they both reference the second segment object in the SeparationPlates collection.

Read-Only

Parameters	Description

Index	Specifies the SeparationPlate by its index number [in]

Example

The following example lists the colors of the separation plates in the collection.

Sub Test()

Dim strPlates As String

Dim Plate As SeparationPlate

Dim intPlateCounter As Integer

With ActiveDocument.PrintSettings.Separations

For intPlateCounter = 1 To .Plates.Count - 1

If .Plates(intPlateCounter).Enabled = True Then

strPlates = strPlates & .Plates(intPlateCounter).Color & vbCr

End If

Next intPlateCounter

MsgBox strPlates

End With

End Sub

 Related Topics


Shape properties

Shape     Legend

    AbsoluteHScale
    AbsoluteSkew
    AbsoluteVScale
    Application
    Bitmap
    CloneLink
    Clones
    Connector
    Curve
    DisplayCurve
      DrapeFill
    Effect
    Effects
    Ellipse
      Fill
    Guide
      Layer
      Locked
      Name
    Next
    ObjectData
    OriginalHeight
    OriginalWidth
    Outline
      OverprintFill
      OverprintOutline
    Parent
    ParentGroup
    Polygon
      PositionX
      PositionY
    PowerClip
    PowerClipParent
    Previous
    Properties
    Rectangle
      RotationAngle
      RotationCenterX
      RotationCenterY
      Selected
    Shapes
      SizeHeight
      SizeWidth
    SnapPoints
    StaticID
    Text
      TextWrapOffset
    Transparency
    Type
    URL
      WrapText


Shape methods

Shape     Legend

   AddToPowerClip
   AddToSelection
   ApplyStyle
   BreakApart
   BreakApartEx
   ClearEffect
   Clone
   Combine
   ConvertToBitmap
   ConvertToBitmapEx
   ConvertToCurves
   Copy
   CreateArrowHead
   CreateBlend
   CreateContour
   CreateDropShadow
   CreateEnvelope
   CreateExtrude
   CreateLens
   CreatePerspective
   CreatePushPullDistortion
   CreateSelection
   CreateTwisterDistortion
   CreateZipperDistortion
   Cut
   Delete
   Duplicate
   Flip
   GetBoundingBox
   GetMatrix
   GetPosition
   GetSize
   Group
   Intersect
   IsOnShape
   Move
   OrderBackOf
   OrderBackOne
   OrderForwardOne
   OrderFrontOf
   OrderIsInFrontOf
   OrderReverse
   OrderToBack
   OrderToFront
   PlaceTextInside
   RemoveFromContainer
   RemoveFromSelection
   Rotate
   RotateEx
   Separate
   SetBoundingBox
   SetMatrix
   SetPosition
   SetRotationCenter
   SetSize
   SetSizeEx
   Skew
   SkewEx
   Stretch
   StretchEx
   Trim
   Ungroup
   UngroupAll
   UngroupAllEx
   UngroupEx
   Weld


Shape

Class Shape

Properties     Methods     Referenced By

The Shape class represents a single CorelDRAW shape (object), group, or selection.

 Related Topics


Shape.AbsoluteHScale

Property AbsoluteHScale As Double

Shape

Description

The AbsoluteHScale property returns the absolute horizontal scaling value of a shape. The returned value represents the total stretch transformation applied to the shape since it was first created.

Read-Only

Example

The following example displays a warning message if the active shape was stretched horizontally or vertically or both since it was created.

Sub Test()

If ActiveShape.AbsoluteHScale <> 1 Or ActiveShape.AbsoluteVScale <> 1 Then

MsgBox "The current shape is distored"

End If

End Sub

 Related Topics


Shape.AbsoluteSkew

Property AbsoluteSkew As Double

Shape

Description

The AbsoluteSkew property returns the absolute skew angle that has been applied to the shape since it was created.

Read-Only

Example

The following example displays the absolute skew angle of the selected shape

Sub Test()

If ActiveShape.AbsoluteSkew <> 0 Then

MsgBox "The current shape is skewed. Skew angle is " & _

ActiveShape.AbsoluteSkew

End If

End Sub

 Related Topics


Shape.AbsoluteVScale

Property AbsoluteVScale As Double

Shape

Description

The AbsoluteVScale property returns the absolute vertical scaling value of a shape. The returned value represents the total stretch transformation applied to the shape since it was first created.

Read-Only

Example

The following example displays a warning message if the active shape was stretched horizontally or vertically or both since it was created.

Sub Test()

If ActiveShape.AbsoluteHScale <> 1 Or ActiveShape.AbsoluteVScale <> 1 Then

MsgBox "The current shape is distored"

End If

End Sub

 Related Topics


Shape.Application

Property Application As Application

Shape

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Shape.Bitmap

Property Bitmap As Bitmap

Shape

Description

The Bitmap property returns a Bitmap object which represents the bitmap-related properties of a bitmap shape.

Read-Only

Example

The following example creates a rectangle, converts it to a bitmap, and then shows the resulting bitmap size in pixels.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s.Fill.ApplyTextureFill "Patches 5C"

Set s = s.ConvertToBitmapEx(cdrRGBColorImage)

MsgBox "The resulting bitmap is " & s.Bitmap.SizeWidth & "x" & _

s.Bitmap.SizeHeight & " pixels"

End Sub

 Related Topics


Shape.CloneLink

Property CloneLink As CloneLink

Shape

Description

The CloneLink property returns a CloneLink object which represents the clone properties of the specified shape.

Read-Only

Example

The following example creates a rectangle and then creates a clone of it. The original rectangle (control shape) is filled with a texture fill by referencing it through the CloneLink property.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

Set s = s.Clone(3, 0)

s.CloneLink.CloneParent.Fill.ApplyTextureFill "Patches 5C"

End Sub

 Related Topics


Shape.Clones

Property Clones As ShapeRange

Shape

Description

The Clones property returns a ShapeRange object containing all cloned shapes for the specified clone control object.

Read-Only

Example

The following example restores fill links for all clones of the currently selected shape.

Sub Test()

Dim s As Shape

For Each s In ActiveShape.Clones

s.CloneLink.FillLinked = True

Next s

End Sub

 Related Topics


Shape.Connector

Property Connector As Connector

Shape

Description

The Connector property returns a Connector object for connector shapes.

Read-Only

Example

The following example creates a rectangle and an ellipse. It then creates a connector line and attaches it to the centers of the rectangle and ellipse.

Sub Test()

Dim r As Shape, e As Shape, c As Shape

Set r = ActiveLayer.CreateRectangle(0, 0, 2, 2)

Set e = ActiveLayer.CreateEllipse2(4, 2, 1)

Set c = ActiveLayer.CreateFreeConnector(1, 0, 4, 0)

c.Connector.StartPoint = r.SnapPoints(10) ' Center of rectangle

c.Connector.EndPoint = e.SnapPoints(6) ' Center of ellipse

End Sub

 Related Topics


Shape.Curve

Property Curve As Curve

Shape

Description

The Curve property returns a Curve object for connector shapes.

Read-Only

Example

The following example creates an ellipse and converts it to a curve shape. It then changes all curve segments to lines, resulting in a diamond shape.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(3, 3, 2, 1)

s.ConvertToCurves

s.Curve.Segments.All.SetType cdrLineSegment

End Sub

 Related Topics


Shape.DisplayCurve

Property DisplayCurve As Curve

Shape

Description

The DisplayCurve property returns a curve representing the current shape. This property allows you to get a curve from a shape (rectangle, ellipse, polygon, and so on) without having to first convert the shape to a curve.

The curve returned by this property is read-only, so you cannot modify it. However, you can get a copy in memory using the GetCopy method, and then modify the curve.

Read-Only

Example

The following example creates a large circle and places 50 small circles along its path.

Sub Test()

Const Steps As Long = 50

Dim s As Shape, sp As SubPath

Dim x As Double, y As Double

Dim t As Double

Set s = ActiveLayer.CreateEllipse(0, 0, 5, 5)

For Each sp In s.DisplayCurve.Subpaths

For t = 0 To Steps - 1

sp.GetPointPositionAt x, y, t / Steps

ActiveLayer.CreateEllipse2 x, y, 0.05

Next t

Next sp

End Sub

 Related Topics


Shape.DrapeFill

Property DrapeFill As Boolean

Shape

Description

The DrapeFill property returns or sets whether or not to drape the fill of a group of objects in a vector extrusion.

Example

The following example creates two ellipses, groups them together, and applies a two-color pattern fill that flows across both objects.

Sub Test()

Dim s1 As Shape, s2 As Shape, grp As Shape

Set s1 = ActiveLayer.CreateEllipse(1.003717, 9.103496, 3.012929, 7.580724, 90#, 90#, False)

s1.Outline.Type = cdrNoOutline

Set s2 = ActiveLayer.CreateEllipse(4.683748, 6.332898, 2.103496, 8.574756, 90#, 90#, False)

s2.Outline.Type = cdrNoOutline

s1.Selected = True

Set grp = ActiveSelection.Group

With grp.Fill.ApplyPatternFill(cdrTwoColorPattern, "%%['$'UH$[UH", 0, _

  CreateCMYKColor(0, 100, 100, 0), CreateCMYKColor(0, 0, 100, 0), False)

.TransformWithShape = False

.TileHeight = 1

.TileWidth = 1

.OriginX = 0

.OriginY = 0

End With

grp.DrapeFill = True

End Sub

 Related Topics


Shape.Effect

Property Effect As Effect

Shape

Description

The Effect property represents the Effect object for shapes generated by an effect (for example, Contour or Blend groups, Extrude facets, and so on).

Read-Only

Examples

The following example creates a blend between two ellipses. It iterates through all the shapes on the page to locate the blend group, and changes some blend parameters. This example is just a demonstration of the Effect property. You can use the Effect object returned by the CreateBlend method directly if you want to set properties of the blend just created.

Sub Test()

Dim doc As Document

Dim e1 As Shape, e2 As Shape, s As Shape

Set doc = CreateDocument

Set e1 = doc.ActiveLayer.CreateEllipse(0, 0, 2, 2)

e1.Fill.UniformColor.RGBAssign 255, 0, 0

Set e2 = doc.ActiveLayer.CreateEllipse(4, 4, 5, 5)

e2.Fill.UniformColor.RGBAssign 0, 0, 255

e1.CreateBlend e2

For Each s In doc.ActivePage.Shapes

If s.Type = cdrBlendGroupShape Then

With s.Effect.Blend

.Steps = 5

.ColorBlendType = cdrRainbowCWFountainFillBlend

End With

End If

Next s

End Sub

The following example changes the blend effect properties immediately after creating the blend. You can also set most of the parameters for the blend directly in the CreateBlend method.

Sub Test()

Dim doc As Document

Dim e1 As Shape, e2 As Shape, eff As Effect

Set doc = CreateDocument

Set e1 = doc.ActiveLayer.CreateEllipse(0, 0, 2, 2)

e1.Fill.UniformColor.RGBAssign 255, 0, 0

Set e2 = doc.ActiveLayer.CreateEllipse(4, 4, 5, 5)

e2.Fill.UniformColor.RGBAssign 0, 0, 255

Set eff = e1.CreateBlend(e2)

eff.Blend.Steps = 5

eff.Blend.ColorBlendType = cdrRainbowCWFountainFillBlend

End Sub

The next example runs more efficiently. All the blend parameters are set in a single command.

Sub Test()

Dim doc As Document

Dim e1 As Shape, e2 As Shape, eff As Effect

Set doc = CreateDocument

Set e1 = doc.ActiveLayer.CreateEllipse(0, 0, 2, 2)

e1.Fill.UniformColor.RGBAssign 255, 0, 0

Set e2 = doc.ActiveLayer.CreateEllipse(4, 4, 5, 5)

e2.Fill.UniformColor.RGBAssign 0, 0, 255

e1.CreateBlend e2, 5, cdrRainbowCWFountainFillBlend

End Sub

The following example changes the number of steps in all blends found on a page and removes any extrudes found. The usefulness of the Shape.Effect property is apparent when working with many effects in an existing document.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

Select Case s.Type

Case cdrExtrudeGroupShape

s.Effect.Clear

Case cdrBlendGroupShape

s.Effect.Blend.Steps = 50

End Select

Next s

End Sub

 Related Topics


Shape.Effects

Property Effects As Effects

Shape

Description

The Effects property returns a collection of all Effects applied to a shape.

Read-Only

Example

The following example creates three ellipses and two blends between them. One ellipse, referenced by the s2 variable, is part of both blends. The Effects collection is then applied to that ellipse to access both blends and adjust their spacing acceleration properties.

Sub Test()

Dim doc As Document

Dim s1 As Shape, s2 As Shape, s3 As Shape

Dim e As Effect

Set doc = CreateDocument

Set s1 = doc.ActiveLayer.CreateEllipse(0, 0, 2, 2)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

Set s2 = doc.ActiveLayer.CreateEllipse(4, 4, 5, 5)

s2.Fill.UniformColor.RGBAssign 0, 0, 255

Set s3 = doc.ActiveLayer.CreateEllipse(0, 7, 1, 8)

s3.Fill.UniformColor.RGBAssign 0, 255, 0

s2.CreateBlend s1

s2.CreateBlend s3

For Each e In s2.Effects

e.Blend.SpacingAcceleration = -100

Next e

End Sub

 Related Topics


Shape.Ellipse

Property Ellipse As Ellipse

Shape

Description

The Ellipse property returns the Ellipse object which represents the properties of an ellipse shape.

Read-Only

Example

The following example converts all ellipses on the current page into pies.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrEllipseShape Then

With s.Ellipse

.StartAngle = 0

.EndAngle = 90

.Clockwise = True

.Type = cdrPie

End With

End If

Next s

End Sub

 Related Topics


Shape.Fill

Property Fill As Fill

Shape

Description

The Fill property returns the Fill object which represents the fill properties of a shape.

Example

The following example creates a rectangle and applies a fountain fill that progresses from red to yellow.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 5, 5)

s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(255, 255, 0)

End Sub

 Related Topics


Shape.Guide

Property Guide As Guide

Shape

Description

The Guide property returns the Guide object which represents the guideline properties of a guideline shape.

Read-Only

Example

The following example shows how many guidelines of each different type exist on the master page.

Sub Test()

Dim s As Shape

Dim hg As Long, vg As Long, sg As Long

vg = 0: sg = 0: hg = 0

For Each s In ActiveDocument.Pages(0).Guides(cdrAllGuides)

Select Case s.Guide.Type

Case cdrVerticalGuide

vg = vg + 1

Case cdrSlantedGuide

sg = sg + 1

Case cdrHorizontalGuide

hg = hg + 1

End Select

Next s

MsgBox "The document contains:" & vbCr & _

"Horizontal guides: " & hg & vbCr & _

"Vertical guides: " & vg & vbCr & _

"Slanted guides: " & sg

End Sub

 Related Topics


Shape.Layer

Property Layer As Layer

Shape

Description

The Layer property returns or sets the document layer on which the active shape resides.

Example

The following example moves all rectangles to a separate layer.

Sub Test()

Dim s As Shape

Dim lr As Layer

Set lr = ActivePage.CreateLayer("Rectangles")

For Each s In ActivePage.FindShapes(Type:=cdrRectangleShape)

s.Layer = lr

Next s

End Sub

 Related Topics


Shape.Locked

Property Locked As Boolean

Shape

Description

The Locked property determines whether the position of a shape is locked on a page.

Example

The following example calculates how many shapes are locked on the active page in the current document.

Sub Test()

Dim s As Shape

Dim n As Long

n = 0

For Each s In ActivePage.Shapes

If s.Locked Then n = n + 1

Next s

MsgBox "There are " & n & " shapes locked on the current page"

End Sub

 Related Topics


Shape.Name

Property Name As String

Shape

Description

The Name property returns or sets a name string associated with a shape. If this property was not changed, an empty string is returned.

Example

The following example gives each polygon a consecutively numbered name.

Sub Test()

Dim s As Shape

Dim n As Long

n = 1

For Each s In ActivePage.Shapes

If s.Type = cdrPolygonShape Then s.Name = "Polygon " & n: n = n + 1

Next s

End Sub

 Related Topics


Shape.Next

Property Next([ByVal Level As cdrShapeLevel = cdrLevelPage (3)], [ByVal EnterGroups As Boolean = False], [ByVal Loop As Boolean = True]) As Shape

Shape

Description

The Next property returns the next shape in the document.

Read-Only

Parameters	Description

Level	Specifies if the scope should be limited to the current group, layer, page, or document [in]
Optional
Default value = cdrLevelPage (3)

EnterGroups	If set to False, groups are treated as separate shapes, ignoring any shapes within the group. If set to True, group shapes are still returned. [in]
Optional
Default value = False

Loop	If set to True and the last shape in the scope is reached, the first shape of the group/layer/document is returned. Otherwise, Nothing is returned. [in]
Optional
Default value = True

Example

The following example selects the next shape on a current layer. It enters groups as necessary.

Sub Test()

Dim s As Shape

Set s = ActiveShape

If s Is Nothing Then

MsgBox "Nothing is selected"

Else

s.Next(cdrLevelLayer, True, True).CreateSelection

End If

End Sub

 Related Topics


Shape.ObjectData

Property ObjectData As DataItems

Shape

Description

The ObjectData property returns a collection of DataItems which represents object data associated with a shape.

Object data can also be manipulated through the Object Data Manager in CorelDRAW.

Read-Only

Example

The following example creates a new data field and sets it to the area of a shape for each shape encountered on the active page.

Sub Test()

Dim s As Shape, x As Double, y As Double

ActiveDocument.DataFields.Add "Area", "0.000"

For Each s In ActivePage.Shapes

s.GetSize x, y

s.ObjectData("Area").Value = x * y

Next s

End Sub

 Related Topics


Shape.OriginalHeight

Property OriginalHeight As Double

Shape

Description

The OriginalHeight property returns the height of a shape when it was created, before any transformations had been applied to it.

Read-Only

Example

The following example creates a rectangle that copies all the transformations of the currently selected shape.

Sub Test()

Const g2rad As Double = 1.74532925199433E-02

Dim s As Shape, r As Shape

Dim x As Double, y As Double

Set s = ActiveShape

If s Is Nothing Then

MsgBox "Nothing selected. Please try again", vbCritical

Exit Sub

End If

ActiveDocument.ReferencePoint = cdrCenter

s.GetPosition x, y

x = x - s.OriginalWidth / 2

y = y - s.OriginalHeight / 2

Set r = ActiveLayer.CreateRectangle2(x, y, s.OriginalWidth, s.OriginalHeight)

r.Stretch s.AbsoluteHScale, s.AbsoluteVScale * Cos(s.AbsoluteSkew * g2rad)

r.Skew s.AbsoluteSkew, 0

r.Rotate s.RotationAngle

End Sub

 Related Topics


Shape.OriginalWidth

Property OriginalWidth As Double

Shape

Description

The OriginalWidth property returns the width of a shape when it was created, before any transformations had been applied to it.

Read-Only

Example

The following example creates a rectangle that copies all the transformations of the currently selected shape.

Sub Test()

Const g2rad As Double = 1.74532925199433E-02

Dim s As Shape, r As Shape

Dim x As Double, y As Double

Set s = ActiveShape

If s Is Nothing Then

MsgBox "Nothing selected. Please try again", vbCritical

Exit Sub

End If

ActiveDocument.ReferencePoint = cdrCenter

s.GetPosition x, y

x = x - s.OriginalWidth / 2

y = y - s.OriginalHeight / 2

Set r = ActiveLayer.CreateRectangle2(x, y, s.OriginalWidth, s.OriginalHeight)

r.Stretch s.AbsoluteHScale, s.AbsoluteVScale * Cos(s.AbsoluteSkew * g2rad)

r.Skew s.AbsoluteSkew, 0

r.Rotate s.RotationAngle

End Sub

 Related Topics


Shape.Outline

Property Outline As Outline

Shape

Description

The Outline property returns the Outline object which represents the outline properties of a shape.

Read-Only

Example

The following example applies 0.1" wide outline to the selected object if it does not already have an outline.

Sub Test()

If ActiveShape.Outline.Type = cdrNoOutline Then

ActiveShape.Outline.Width = 0.1

End If

End Sub

 Related Topics


Shape.OverprintFill

Property OverprintFill As Boolean

Shape

Description

The OverprintFill property returns or sets whether the fill of an object is overprinted.

Example

The following example previews overprinted fills in the drawing by creating additional objects where two or more shapes intersect. These new objects are filled with the appropriate resultant colors. There must be at least two overlapping shapes in the document.

' Previews fill overprints on screen

Public Sub CreateOverprint()

Dim n1 As Long

Dim n2 As Long

Dim s1 As Shape

Dim s2 As Shape

Dim s As Shape

Dim shps As Shapes

Dim c1 As New color

Dim c2 As New color

ActiveDocument.ReferencePoint = cdrBottomLeft

ActiveDocument.ShapeEnumDirection = cdrShapeEnumBottomFirst

' Look through all shapes from bottom to top

Set shps = ActivePage.Shapes

For n1 = 1 To shps.Count - 1

Set s1 = shps(n1)

If s1.Fill.Type = cdrUniformFill Then

' If the shape has a uniform fill, get its color

c1.CopyAssign s1.Fill.UniformColor

' Check all shapes above it

For n2 = n1 + 1 To shps.Count

Set s2 = shps(n2)

If s2.Fill.Type = cdrUniformFill And s2.OverprintFill Then

' If the shape has a uniform fill has Overprint fill specified,

' get its color

c2.CopyAssign s2.Fill.UniformColor

If Overlap(s1, s2) Then

' If the shapes may overlap, mix the two colors and ...

MixColors c1, c2

' ... create the intersecting shape

Set s = s1.Intersect(s2)

If Not s Is Nothing Then

' If anything was generated during intersection,

' apply the resulting color to it and mark the shape with

' overprint fill attribute for future processing

s.Fill.ApplyUniformFill c2

s.OverprintFill = True

End If

End If

End If

Next n2

End If

Next n1

End Sub

' Determines if the two shapes may overlap

Private Function Overlap(s1 As Shape, s2 As Shape) As Boolean

Dim x1 As Double, y1 As Double, w1 As Double, h1 As Double

Dim x2 As Double, y2 As Double, w2 As Double, h2 As Double

s1.GetBoundingBox x1, y1, w1, h1

s2.GetBoundingBox x2, y2, w2, h2

Overlap = Not (x1 + w1 < x2 Or x2 + w2 < x1 Or y1 + h1 < y2 Or y2 + h2 < y1)

End Function

' Mixes two colors according to their inks

Private Sub MixColors(c1 As color, c2 As color)

Dim cc1 As New color

Dim bSpot As Boolean

cc1.CopyAssign c1

If cc1.Type <> cdrColorCMYK Then cc1.ConvertToCMYK

bSpot = (c1.Type = cdrColorSpot Or c1.Type = cdrColorPantone Or _

 c2.Type = cdrColorSpot Or c2.Type = cdrColorPantone)

If c2.Type <> cdrColorCMYK Then c2.ConvertToCMYK

If Not bSpot Then

' If we are mixing process colors, only replace the color channels that

' have no color in the top shape

If c2.CMYKBlack = 0 Then c2.CMYKBlack = cc1.CMYKBlack

If c2.CMYKCyan = 0 Then c2.CMYKCyan = cc1.CMYKCyan

If c2.CMYKMagenta = 0 Then c2.CMYKMagenta = cc1.CMYKMagenta

If c2.CMYKYellow = 0 Then c2.CMYKYellow = cc1.CMYKYellow

Else

' If we are mixing spot colors, just add inks

c2.CMYKBlack = GetMaxInk(cc1.CMYKBlack + c2.CMYKBlack)

c2.CMYKCyan = GetMaxInk(cc1.CMYKCyan + c2.CMYKCyan)

c2.CMYKMagenta = GetMaxInk(cc1.CMYKMagenta + c2.CMYKMagenta)

c2.CMYKYellow = GetMaxInk(cc1.CMYKYellow + c2.CMYKYellow)

End If

End Sub

' Makes sure the ink level doesn't exceed 100%

Private Function GetMaxInk(Ink As Long) As Long

Dim n As Long

n = Ink

If n > 100 Then n = 100

GetMaxInk = n

End Function

 Related Topics


Shape.OverprintOutline

Property OverprintOutline As Boolean

Shape

Description

The OverprintOutline property returns or sets whether the outline of an object overprints.

Example

The following example creates a rectangle and specifies that its fill is overprinted by its outline.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 3, 3)

s.Fill.ApplyUniformFill CreateRGBColor(155, 0, 155)

s.OverprintOutline = True

End Sub

 Related Topics


Shape.Parent

Property Parent As Object

Shape

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Shape.ParentGroup

Property ParentGroup As Shape

Shape

Description

The ParentGroup property returns a Shape object which represents the group shape to which the active shape belongs. If the shape is not part of a group, Nothing is selected.

Read-Only

Example

The following example extracts an object from a group and places it at the same level as the group object.

Sub Test()

Dim s As Shape, g As Shape

Set s = ActiveShape

If s Is Nothing Then

MsgBox "Please select an object", vbCritical

Exit Sub

End If

Set g = s.ParentGroup

If g Is Nothing Then

MsgBox "Please select an object within a group", vbCritical

Exit Sub

End If

ActiveDocument.PreserveSelection = False

g.CreateSelection

g.Ungroup

s.Selected = False

ActiveSelection.Group

s.CreateSelection

End Sub

 Related Topics


Shape.Polygon

Property Polygon As Polygon

Shape

Description

The Polygon property returns the Polygon object which represents the properties of a symmetrical polygon shape.

Read-Only

Example

The following example converts all symmetrical polygon shapes on the active page to five-point star polygons.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrPolygonShape Then

s.Polygon.Sides = 5

s.Polygon.Type = cdrStar

End If

Next s

End Sub

 Related Topics


Shape.PositionX

Property PositionX As Double

Shape

Description

The PositionX property returns or sets the horizontal, or x-coordinate, of a shape. The position is relative to a reference point specified by the Document.ReferencePoint property.

See also the GetPosition, SetPosition, and Move methods.

Example

The following example moves objects, as needed, so that they are all within the current page boundaries.

Sub Test()

Dim s As Shape

Dim pw As Double, ph As Double

ActivePage.GetSize pw, ph

For Each s In ActivePage.Shapes

If s.Type <> cdrGuidelineShape Then

ActiveDocument.ReferencePoint = cdrBottomLeft

If s.PositionX < 0 Then s.PositionX = 0

If s.PositionY < 0 Then s.PositionY = 0

ActiveDocument.ReferencePoint = cdrTopRight

If s.PositionX > pw Then s.PositionX = pw

If s.PositionY > ph Then s.PositionY = ph

End If

Next s

End Sub

 Related Topics


Shape.PositionY

Property PositionY As Double

Shape

Description

The PositionY property returns or sets the vertical, or y-coordinate, of a shape. The position is relative to a reference point specified by the Document.ReferencePoint property.

See also the GetPosition, SetPosition, and Move methods.

Example

The following example moves objects, as needed, so that they are all within the current page boundaries.

Sub Test()

Dim s As Shape

Dim pw As Double, ph As Double

ActivePage.GetSize pw, ph

For Each s In ActivePage.Shapes

If s.Type <> cdrGuidelineShape Then

ActiveDocument.ReferencePoint = cdrBottomLeft

If s.PositionX < 0 Then s.PositionX = 0

If s.PositionY < 0 Then s.PositionY = 0

ActiveDocument.ReferencePoint = cdrTopRight

If s.PositionX > pw Then s.PositionX = pw

If s.PositionY > ph Then s.PositionY = ph

End If

Next s

End Sub

 Related Topics


Shape.PowerClip

Property PowerClip As PowerClip

Shape

Description

The PowerClip property returns the PowerClip object which represents the properties for a PowerClip container. You can use this object to access shapes in a PowerClip container, or change the properties of a PowerClip.

Read-Only

Example

The following example extracts shapes from all PowerClip containers on the current page.

Sub Test()

Dim s As Shape

Dim pwc As PowerClip

For Each s In ActivePage.Shapes

Set pwc = Nothing

On Error Resume Next

Set pwc = s.PowerClip

On Error GoTo 0

If Not pwc Is Nothing Then

s.CreateSelection

pwc.ExtractShapes

End If

Next s

End Sub

 Related Topics


Shape.PowerClipParent

Property PowerClipParent As Shape

Shape

Description

The PowerClipParent property returns the shape that represents the PowerClip container for the given shape.

Read-Only

Example

The following example fills each shape in the current PowerClip container with a lighter tint of the color of the PowerClip container.

Sub Test()

Dim s As Shape

Dim c As New Color

If ActiveShape Is Nothing Then

MsgBox "Select a powerclip container"

Exit Sub

End If

If ActiveShape.Fill.Type <> cdrUniformFill Then

MsgBox "Powerclip container must have a uniform fill"

Exit Sub

End If

For Each s In ActiveShape.PowerClip.Shapes

c.CopyAssign s.PowerClipParent.Fill.UniformColor

Select Case c.Type

Case cdrColorRGB

c.RGBBlue = (c.RGBBlue + 255) \ 2

c.RGBGreen = (c.RGBGreen + 255) \ 2

c.RGBRed = (c.RGBRed + 255) \ 2

Case cdrColorCMYK

c.CMYKBlack = c.CMYKBlack \ 2

c.CMYKCyan = c.CMYKCyan \ 2

c.CMYKMagenta = c.CMYKMagenta \ 2

c.CMYKYellow = c.CMYKYellow \ 2

Case Else

c.ConvertToHLS

c.HLSLightness = (c.HLSLightness + 255) \ 2

End Select

s.Fill.ApplyUniformFill c

Next s

End Sub

 Related Topics


Shape.Previous

Property Previous([ByVal Level As cdrShapeLevel = cdrLevelPage (3)], [ByVal EnterGroups As Boolean = False], [ByVal Loop As Boolean = True]) As Shape

Shape

Description

The Previous property returns the previous shape in the document.

Read-Only

Parameters	Description

Level	Specifies if the scope should be limited to the current group, layer, page, or document [in]
Optional
Default value = cdrLevelPage (3)

EnterGroups	If set to False, groups are treated as separate shapes, ignoring any shapes within the group. If set to True, group shapes are still returned. [in]
Optional
Default value = False

Loop	If set to True and the last shape in the scope is reached, the first shape of the group/layer/document is returned. Otherwise, Nothing is returned. [in]
Optional
Default value = True

Example

The following example selects the next shape on the current layer. There must be at least two shapes in the document, and one shape must be selected.

Sub Test()

Dim s As Shape

Set s = ActiveShape

If s Is Nothing Then

MsgBox "Nothing is selected."

Else

s.Previous(cdrLevelLayer, True, True).CreateSelection

End If

End Sub

 Related Topics


Shape.Properties

Property Properties As Properties

Shape

Description

The Properties property returns the Properties collection which allows you to specify and manipulate custom data associated with the given shape. Data stored using the Properties collection is not accessible to the CorelDRAW user and can only be retrieved programmatically.

You can use this property as an advanced way of storing custom data with a shape. See also the ObjectData property.

Read-Only

Example

The following example stores all uniform fill colors with each shape so that the fill can be restored later.

Sub StoreFills()

Dim s As Shape

Dim c(0 To 7) As Long, i As Long

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrUniformFill Then

s.Fill.UniformColor.CorelScriptGetComponent c(0), c(1), c(2), c(3), c(4), c(5), c(6), c(7)

For i = 0 To 7

s.Properties("StoredFillColor", i) = c(i)

Next i

End If

Next s

End Sub

 Related Topics


Shape.Rectangle

Property Rectangle As Rectangle

Shape

Description

The Rectangle property returns the Rectangle object which represents the properties of a rectangle shape.

Read-Only

Example

The following example sets the roundness of all rectangles on a page to 30%.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrRectangleShape Then

s.Rectangle.SetRoundness 30

End If

Next s

End Sub

 Related Topics


Shape.RotationAngle

Property RotationAngle As Double

Shape

Description

The RotationAngle property returns or sets the angle at which the shape was rotated. Assigning a value to this properties rotates the shape so that its resulting rotation angle equals the specified value.

Example

The following example removes any rotation from the shapes on a page.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.RotationAngle <> 0 Then

s.RotationAngle = 0

End If

Next s

End Sub

 Related Topics


Shape.RotationCenterX

Property RotationCenterX As Double

Shape

Description

The RotationCenterX returns or sets the horizontal coordinate of the center of rotation for a shape.

See also the SetRotationCenter method.

Example

The following example creates a flower with randomly colored petals.

Sub Test()

Const NumLeafs As Long = 11

Dim pal As Palette

Dim s As Shape

Dim i As Long, NumColors As Long

If ActivePalette Is Nothing Then

Set pal = Palettes.Open(Application.SetupPath & "Custom\coreldrw.cpl")

Else

Set pal = ActivePalette

End If

NumColors = pal.ColorCount

For i = 1 To NumLeafs

If s Is Nothing Then

Set s = ActiveLayer.CreateEllipse(5, 5, 7, 6)

s.RotationCenterX = 4

s.RotationCenterY = 5.5

Else

s.Duplicate

End If

s.Fill.ApplyUniformFill pal.Color(Rnd() * NumColors + 1)

s.Rotate 360 / NumLeafs

Next i

End Sub

 Related Topics


Shape.RotationCenterY

Property RotationCenterY As Double

Shape

Description

The RotationCenterY returns or sets the vertical coordinate of the center of rotation for a shape.

See also the SetRotationCenter method.

Example

The following example creates a flower with randomly colored petals.

Sub Test()

Const NumLeafs As Long = 11

Dim pal As Palette

Dim s As Shape

Dim i As Long, NumColors As Long

Set s = Nothing

If ActivePalette Is Nothing Then

Set pal = Palettes.Open(Application.SetupPath & "Custom\coreldrw.cpl")

Else

Set pal = ActivePalette

End If

NumColors = pal.ColorCount

For i = 1 To NumLeafs

If s Is Nothing Then

Set s = ActiveLayer.CreateEllipse(5, 5, 7, 6)

s.RotationCenterX = 4

s.RotationCenterY = 5.5

Else

s.Duplicate

End If

s.Fill.ApplyUniformFill pal.Color(Rnd() * NumColors + 1)

s.Rotate 360 / NumLeafs

Next i

End Sub

 Related Topics


Shape.Selected

Property Selected As Boolean

Shape

Description

The Selected property returns or sets whether a shape is selected

Changing the value of this property adds or removes the shape to or from the current selection. See also the Shape.CreateSelection, Document.ClearSelection, ShapeRange.AddToSelection, and ShapeRange.RemoveFromSelection methods.

Example

The following example removes any rectangles from the current selection.

Sub Test()

Dim s As Shape

For Each s In ActiveSelection.Shapes

If s.Type = cdrRectangleShape Then s.Selected = False

Next s

End Sub

 Related Topics


Shape.Shapes

Property Shapes As Shapes

Shape

Description

The Shapes property returns a collection of Shapes.

This property is valid only for a group shape. The returned collection contains all shapes that are part of the group

Read-Only

Example

The following example converts all uniform fill colors to grayscale.

Sub Test()

ConvertFills ActivePage.Shapes

End Sub

Private Sub ConvertFills(ss As Shapes)

Dim s As Shape

For Each s In ss

If s.Type = cdrGroupShape Then

'If this is a group shape, then all the shapes in this group

'are processed by calling the function recursively.

ConvertFills s.Shapes

Else

If s.Fill.Type = cdrUniformFill Then

s.Fill.UniformColor.ConvertToGray

End If

End If

Next s

End Sub

 Related Topics


Shape.SizeHeight

Property SizeHeight As Double

Shape

Description

The SizeHeight property returns or sets the vertical size of a shape. Changing this property will stretch the shape to accommodate the specified size.

See also the GetSize, SetSize, and GetBoundingBox methods.

Example

The following example creates a rectangle around each shape on a page.

Sub Test()

Dim s As Shape

Dim x As Double, y As Double

ActiveDocument.ReferencePoint = cdrBottomLeft

For Each s In ActivePage.Shapes

s.GetPosition x, y

ActiveLayer.CreateRectangle2 x, y, s.SizeWidth, s.SizeHeight

Next s

End Sub

 Related Topics


Shape.SizeWidth

Property SizeWidth As Double

Shape

Description

The SizeWidth property returns or sets the horizontal size of a shape. Changing this property will stretch the shape to accommodate the specified size.

See also the GetSize, SetSize, and GetBoundingBox methods.

Example

The following example creates a rectangle around each shape on a page.

Sub Test()

Dim s As Shape

Dim x As Double, y As Double

ActiveDocument.ReferencePoint = cdrBottomLeft

For Each s In ActivePage.Shapes

s.GetPosition x, y

ActiveLayer.CreateRectangle2 x, y, s.SizeWidth, s.SizeHeight

Next s

End Sub

 Related Topics


Shape.SnapPoints

Property SnapPoints As SnapPoints

Shape

Description

The SnapPoints property returns a collection of shape SnapPoints which represents connection points for the connector tool.

Read-Only

Example

The following example creates ellipses at the position of each connection point of the active shape.

Sub Test()

Dim sp As SnapPoint

For Each sp In ActiveShape.SnapPoints

ActiveLayer.CreateEllipse2 sp.PositionX, sp.PositionY, 0.1

Next sp

End Sub

The following example creates a rectangle and an ellipse, and connects their centers with a connector line.

Sub Test()

Dim rect As Shape, ell As Shape

Dim lr As Layer

Set lr = ActiveLayer

Set rect = lr.CreateRectangle(0, 0, 3, 3)

Set ell = lr.CreateEllipse2(5, 5, 1, 1)

lr.CreateConnector rect.SnapPoints(9), ell.SnapPoints(5)

End Sub

 Related Topics


Shape.StaticID

Property StaticID As Long

Shape

Description

The StaticID property returns an integer representing a unique ID number assigned to each shape.

The ID number does not change during the lifetime of a shape, so this number can always be used to identify a shape.

Read-Only

Examples

The following example stores the current selection in the array of the active page properties.

Sub SaveSelection()

Dim s As Shape, n As Long

ActivePage.Properties("StoredSelection", 0) = ActiveSelection.Shapes.Count

n = 1

For Each s In ActiveSelection.Shapes

ActivePage.Properties("StoredSelection", n) = s.StaticID ' Store the current shape's ID number

n = n + 1

Next s

End Sub

The followinge example restores the selection saved in the properties of the active page in the previous example.

You can use the Page.FindShape or Layer.FindShape methods to locate a shape based on its unique ID.

Sub RestoreSelection()

Dim s As Shape, sr As New ShapeRange

Dim v As Variant

Dim Num As Long, i As Long, id As Long

v = ActivePage.Properties("StoredSelection", 0) ' Retrieving the total number of shape references stored

If Not IsNull(v) Then

ActivePage.Properties.Delete "StoredSelection", 0 ' Delete the property

Num = v

For i = 1 To Num

id = ActivePage.Properties("StoredSelection", i) ' Getting the current shape's ID to find

Set s = ActivePage.FindShape(StaticID:=id)

If Not s Is Nothing Then sr.Add s ' Add the shape to the shape range if it still exists in document

ActivePage.Properties.Delete "StoredSelection", i ' Delete the property

Next i

sr.CreateSelection ' Selects all shapes found

Else

MsgBox "No selection stored in the active page"

End If

End Sub

 Related Topics


Shape.Text

Property Text As Text

Shape

Description

The Text property returns the Text object which represents the properties of a text shape.

Read-Only

Example

The following example displays the type of the text.

Sub Test()

Dim s As Shape

Dim TextType As String

Set s = ActiveLayer.CreateArtisticText(1, 2, "This is a shape.")

s.Text.ConvertToParagraph

Select Case s.Text.Type

Case 0

TextType = "Artistic Text"

Case 1

TextType = "Paragraph Text"

Case 2

TextType = "Artistic Fitted Text"

Case 3

TextType = "Paragraph Fitted Text"

End Select

MsgBox TextType

End Sub

 Related Topics


Shape.TextWrapOffset

Property TextWrapOffset As Double

Shape

Description

The TextWrapOffset property returns or sets the offset for the wrapped text from the object.

Example

The following example wraps the paragraph text around the ellipse and offsets the text half an inch from the ellipse.

Sub Test()

Dim ell As Shape

ActiveLayer.CreateParagraphText 1, 1, ActivePage.SizeWidth - 1, _

ActivePage.SizeHeight - 1, String$(2000, "a"), , , , 24

Set ell = ActiveLayer.CreateEllipse(2, 9, 6, 4)

ell.WrapText = cdrWrapContourStraddle

ell.TextWrapOffset = 0.5

End Sub

 Related Topics


Shape.Transparency

Property Transparency As Transparency

Shape

Description

The Transparency property returns the Transparency object which represents the transparency settings for the active shape.

Read-Only

Example

The following example applies a 40% uniform transparency to all rectangles, and a fountain transparency to all ellipses on a page.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

Select Case s.Type

Case cdrRectangleShape

s.Transparency.ApplyUniformTransparency 40

' Working around the ApplyUnifromTransparency method

If s.Transparency.Uniform <> 40 Then

s.Transparency.Uniform = 40

End If

Case cdrEllipseShape

s.Transparency.ApplyFountainTransparency Angle:=45

Case Else

If s.Transparency.Type <> cdrNoTransparency Then

s.Transparency.ApplyNoTransparency

End If

End Select

Next s

End Sub

 Related Topics


Shape.Type

Property Type As cdrShapeType

Shape

Description

The Type property returns the shape type. You can use this property to distinguish between a rectangle, an ellipse, text, a curve, and other shape types.

Read-Only

Example

The following example distorts a curve by moving each its nodes by a random offset.

Sub Test()

Dim x As Double, y As Double, max As Double

Dim n As Node

If ActiveShape Is Nothing Then

MsgBox "Select an object first", vbCritical

Exit Sub

End If

If ActiveShape.Type <> cdrCurveShape Then ActiveShape.ConvertToCurves

If ActiveShape.Type <> cdrCurveShape Then

MsgBox "Unable to convert the object to curve", vbCritical

Exit Sub

End If

ActiveShape.GetSize x, y

If x < y Then max = y / 10 Else max = x / 10

For Each n In ActiveShape.Curve.Nodes

n.Move (Rnd() - 0.5) * max, (Rnd() - 0.5) * max

Next n

End Sub

 Related Topics


Shape.URL

Property URL As URL

Shape

Description

The URL property returns the URL object which represents the hyperlink properties associated with a shape.

Read-Only

Example

The following example sets a bookmark for each rectangle on the page, and links each ellipse to each rectangle.

Sub Test()

Dim s As Shape

Dim col As New Collection

Dim n As Long

For Each s In ActivePage.FindShapes(Type:=cdrRectangleShape)

col.Add s.StaticID

s.URL.BookMark = "Rectangle" & s.StaticID

Next s

n = 1

For Each s In ActivePage.FindShapes(Type:=cdrEllipseShape)

If n > col.Count Then Exit For

s.URL.Address = "Rectangle" & col(n)

s.URL.AltComment = "Link to the rectangle shape"

n = n + 1

Next s

End Sub

 Related Topics


Shape.WrapText

Property WrapText As cdrWrapStyle

Shape

Description

The WrapText property returns or sets the style for wrapping paragraph text.

Example

The following example wraps the paragraph text around the ellipse.

Sub Test()

Dim ell As Shape

ActiveLayer.CreateParagraphText 1, 1, ActivePage.SizeWidth - 1, _

ActivePage.SizeHeight - 1, String$(2000, "a"), , , , 24

Set ell = ActiveLayer.CreateEllipse(2, 9, 6, 4)

ell.WrapText = cdrWrapContourStraddle

End Sub

 Related Topics


Shape.AddToPowerClip

Sub AddToPowerClip(ByVal Shape As Shape)

Shape

Description

The AddToPowerClip method adds the current shape object to a PowerClip container.

Parameters	Description

Shape	Specifies the PowerClip container [in]

Example

The following example creates a rectangle and an ellipse, and then places the ellipse inside the rectangle.

Sub Test()

Dim rect As Shape, ell As Shape

Set rect = ActiveLayer.CreateRectangle(0, 0, 4, 3)

rect.Fill.UniformColor.RGBAssign 255, 0, 0

Set ell = ActiveLayer.CreateEllipse(2, 1, 5, 4)

ell.Fill.UniformColor.RGBAssign 255, 255, 0

ell.AddToPowerClip rect

End Sub

 Related Topics


Shape.AddToSelection

Sub AddToSelection()

Shape

Description

The AddToSelection method adds a shape to a selection. This method does not work if the shape is a Selection Shape.

Example

The following example selects all ellipses and rectangles on the active page.

Sub Test()

ActivePage.FindShapes(Type:=cdrEllipseShape).CreateSelection

ActivePage.FindShapes(Type:=cdrRectangleShape).AddToSelection

End Sub

 Related Topics


Shape.ApplyStyle

Sub ApplyStyle(ByVal StyleName As String)

Shape

Description

The ApplyStyle method applies a text or a graphic style.

Parameters	Description

StyleName	Specifies the graphic style by its name[in]

Example

The following example creates an ellipse and fills it. It then applies the default graphic style (a hairline outline and no fill) to the ellipse.

Sub Test()

Dim s1 As Shape

Set s1 = ActiveLayer.CreateEllipse(0, 0, 2, 2)

s1.Fill.ApplyUniformFill CreateRGBColor(255, 0, 0)

s1.ApplyStyle "Default Graphic"

End Sub

 Related Topics


Shape.BreakApart

Sub BreakApart()

Shape

Description

The BreakApart method breaks curve or text objects into subpaths, or words or characters.

Example

The following example creates the letter "O" and converts it to a curve. It breaks the two subpaths into separate objects. The inner path is then moved upwards by 0.2", and the two paths are combined into a single curve shape.

Sub Test()

Dim s As Shape, sr As ShapeRange

Set s = ActiveLayer.CreateArtisticText(0, 0, "O")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 48

End With

s.ConvertToCurves

s.BreakApart

Set sr = ActiveSelectionRange

sr(1).Move 0, 0.2

sr.Combine

End Sub

 Related Topics


Shape.BreakApartEx

Function BreakApartEx() As ShapeRange

Shape

Description

The BreakApartEx method breaks apart the curve and returns the objects as a ShapeRange object.

Return value

Returns ShapeRange

Example

The following example creates a letter "O" and converts it to a curve. The two subpaths are broken into separate objects, and the inner path is moved upwards by 0.2". The two paths are then combined into a single curve shape.

Sub Test()

Dim s As Shape, sr As ShapeRange

Set s = ActiveLayer.CreateArtisticText(0, 0, "O", , , "Arial Black", 48)

s.ConvertToCurves

Set sr = s.BreakApartEx

sr(1).Move 0, 0.2

sr.Combine

End Sub

 Related Topics


Shape.ClearEffect

Sub ClearEffect(ByVal Type As cdrEffectType)

Shape

Description

The ClearEffect method removes an effect from a shape.

Parameters	Description

Type	Specifies the effect to be removed from the shape. This value returns cdrEffectType. [in]

Example

The following example clears all contours applied to any shape on the page. Any shapes in a group are not processed.

Sub Test()

ActivePage.Shapes.All.CreateSelection

ActiveSelection.ClearEffect cdrContour

End Sub

 Related Topics


Shape.Clone

Function Clone([ByVal OffsetX As Double = 0], [ByVal OffsetY As Double = 0]) As Shape

Shape

Description

The Clone method clones a shape and return the reference to the cloned object.

Parameters	Description

OffsetX	Specifies the horizontal distance to offset the cloned shape object [in]
Optional
Default value = 0

OffsetY	Specifies the vertical distance to offset the cloned shape object [in]
Optional
Default value = 0

Return value

Returns Shape

Example

The following example creates a red rectangle, clones it, and then changes the fill of the clone to green.

Sub Test()

Dim rs As Shape, cs As Shape

Set rs = ActiveLayer.CreateRectangle2(0, 0, 4, 2)

rs.Fill.UniformColor.CMYKAssign 0, 100, 100, 0

Set cs = rs.Clone(0, 3)

cs.Fill.UniformColor.CMYKAssign 100, 0, 100, 0

End Sub

 Related Topics


Shape.Combine

Function Combine() As Shape

Shape

Description

The Combine method combines shape into a curve or text object.

See also the ShapeRange.Combine method.

Return value

Returns Shape

Example

The following example creates two ellipses and combines them into a single curve.

Sub Test()

Dim doc As Document

Dim e1 As Shape, e2 As Shape

Set doc = CreateDocument()

Set e1 = doc.ActiveLayer.CreateEllipse2(4, 3, 2)

Set e2 = doc.ActiveLayer.CreateEllipse2(4, 5, 3)

' Here e2 is selected. Just add e1 to selection

e1.Selected = True

Set e1 = doc.Selection.Combine

e1.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

End Sub

 Related Topics


Shape.ConvertToBitmap

Function ConvertToBitmap([ByVal BitDepth As Long = 24], [ByVal Grayscale As Boolean = False], [ByVal Dithered As Boolean = True], [ByVal TransparentBG As Boolean = True], [ByVal Resolution As Long = 72], [ByVal AntiAliasing As cdrAntiAliasingType = cdrNormalAntiAliasing (1)], [ByVal UseColorProfile As Boolean = True]) As Shape

Shape

Description

The ConvertToBitmap method converts a shape to a bitmap.

This method is obsolete and provided for backward compatibility only. It is recommended that you use the ConvertToBitmapEx method instead.

Parameters	Description

BitDepth	Lets you specify bit depth [in]
Optional
Default value = 24

Grayscale	Converts to grayscale if set to True (-1) [in]
Optional
Default value = False

Dithered	Enables dithering if set to True (-1) [in]
Optional
Default value = True

TransparentBG	Enables a transparent background if set to True (-1) [in]
Optional
Default value = True

Resolution	Lets you specify the resolution [in]
Optional
Default value = 72

AntiAliasing	Lets you specify the anti aliasing type.This value returns cdrAntiAliasingType. [in]
Optional
Default value = cdrNormalAntiAliasing (1)

UseColorProfile	Uses the color profile if set to True (-1) [in]
Optional
Default value = True

Return value

Returns Shape

 Related Topics


Shape.ConvertToBitmapEx

Function ConvertToBitmapEx([ByVal Mode As cdrImageType = cdrRGBColorImage (4)], [ByVal Dithered As Boolean = False], [ByVal Transparent As Boolean = False], [ByVal Resolution As Long = 72], [ByVal AntiAliasing As cdrAntiAliasingType = cdrNormalAntiAliasing (1)], [ByVal UseColorProfile As Boolean = True]) As Shape

Shape

Description

The ConvertToBitmapEx converts a shape object to a bitmap.

Parameters	Description

Mode	Sets the image type and returns cdrImageType. [in]
Optional
Default value = cdrRGBColorImage (4)

Dithered	Enables dithering if set to True (-1) [in]
Optional
Default value = False

Transparent	Enables a transparent background if set to True (-1) [in]
Optional
Default value = False

Resolution	Sets the resolution [in]
Optional
Default value = 72

AntiAliasing	Sets the anti-aliasing which returns cdrAntiAliasingType [in]
Optional
Default value = cdrNormalAntiAliasing (1)

UseColorProfile	Uses the color profile if set to TRUE (-1) [in]
Optional
Default value = True

Return value

Returns Shape

Example

The following example creates a rectangle and an ellipse. Then it converts the ellipse to a CMYK bitmap with a transparent background, applies a dropshadow to it, and groups it with the rectangle.

Sub Test()

Dim r As Shape, s As Shape

Set r = ActiveLayer.CreateRectangle(0, 0, 5, 5)

r.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

Set s = ActiveLayer.CreateEllipse2(3, 3, 2)

s.Fill.UniformColor.CMYKAssign 0, 100, 100, 0

Set s = s.ConvertToBitmapEx(cdrCMYKColorImage, False, True)

s.CreateDropShadow cdrDropShadowFlat, 80, 10, 0.5, -0.5, CreateCMYKColor(0, 50, 50, 50)

r.CreateSelection

s.Selected = True

ActiveSelection.Group

End Sub

 Related Topics


Shape.ConvertToCurves

Sub ConvertToCurves()

Shape

Description

The ConvertToCurves method converts a shape to a curve.

Example

The following example creates a jagged text object.

Sub Test()

Dim s As Shape, n As Node

Set s = ActiveLayer.CreateArtisticText(0, 0, "Jagged")

With s.Text.FontProperties

.Name = "Arial"

.Style = cdrBoldFontStyle

.Size = 140

End With

s.ConvertToCurves

For Each n In s.Curve.Nodes

n.Move (Rnd() - 0.5) * 0.2, (Rnd() - 0.5) * 0.2

Next n

End Sub

 Related Topics


Shape.Copy

Sub Copy()

Shape

Description

The Copy method copies the object to the clipboard.

Example

The following example copies each shape from the active page to a separate page in a new document.

Sub Test()

Dim s As Shape, bAddPage As Boolean

Dim doc1 As Document, doc2 As Document

Set doc1 = ActiveDocument

Set doc2 = CreateDocument()

bAddPage = False

For Each s In doc1.ActivePage.Shapes()

s.Copy

If bAddPage Then doc2.AddPages 1

doc2.ActiveLayer.Paste

bAddPage = True

Next s

End Sub

 Related Topics


Shape.CreateArrowHead

Function CreateArrowHead() As ArrowHead

Shape

Description

The CreateArrowhead method creates an arrowhead from the specified shape.

The shape must be of a type that can be converted to a curve.

Return value

Returns ArrowHead

Example

The following example creates an arrowhead from a six-sided star polygon and applies it to a line.

Sub Test()

Dim s As Shape, ar As ArrowHead

Set s = ActiveLayer.CreatePolygon(0, 0, 2, 2, 6, , , True)

Set ar = s.CreateArrowHead()

s.Delete

Set s = ActiveLayer.CreateLineSegment(0, 0, 5, 5)

s.Outline.Width = 0.1

s.Outline.EndArrow = ar

End Sub

 Related Topics


Shape.CreateBlend

Function CreateBlend(ByVal Shape As Shape, [ByVal Steps As Integer = 20], [ByVal ColorBlendType As cdrFountainFillBlendType = cdrDirectFountainFillBlend (0)], [ByVal Mode As cdrBlendMode = cdrBlendSteps (0)], [ByVal Spacing As Double = 0], [ByVal Angle As Double = 0], [ByVal Loop As Boolean = False], [ByVal Path As Shape = Nothing], [ByVal RotateShapes As Boolean = False], [ByVal SpacingAccel As Long = 0], [ByVal ColorAccel As Long = 0], [ByVal AccelSize As Boolean = False]) As Effect

Shape

Description

The CreateBlend method creates a blend between two shapes. This method returns the Effect object which represents the blend effect properties.

Parameters	Description

Shape	Specifies the starting shape [in]

Steps	Specifies the number of steps [in]
Optional
Default value = 20

ColorBlendType	Specifies the color blend type of a fountain fill blend type. This property returns cdrFountainFillBlendType. [in]
Optional
Default value = cdrDirectFountainFillBlend (0)

Mode	Specifies the blend mode. This property returns cdrBlendMode. [in]
Optional
Default value = cdrBlendSteps (0)

Spacing	Specifies the blend spacing [in]
Optional
Default value = 0

Angle	Specifies the angle in a blend effect [in]
Optional
Default value = 0

Loop	Determines whether a blend loops. [in]
Optional
Default value = False

Path	Specifies the blend path [in]
Optional
Default value = Nothing

RotateShapes	Determines whether the blend effect rotates its shape to follow a path [in]
Optional
Default value = False

SpacingAccel	Specifies the rate of object acceleration [in]
Optional
Default value = 0

ColorAccel	Specifies the rate of color acceleration. Higher numbers allow the colors to move quicker through the spectrum as they approach the end object [in]
Optional
Default value = 0

AccelSize	Determines whether the size of a blend accelerates along the path [in]
Optional
Default value = False

Return value

Returns Effect

Example

The following example creates a blend on path between two ellipses.

Sub Test()

Dim sPath As Shape, s1 As Shape, s2 As Shape

Dim eff As Effect

Set sPath = ActiveLayer.CreateCurveSegment(1, 6.5, 5, 8.5, 2, 72, 1.8, 180)

Set s1 = ActiveLayer.CreateEllipse(0.953386, 6.731929, 1.838858, 6.027165)

s1.Fill.UniformColor.CMYKAssign 0, 100, 100, 0

Set s2 = ActiveLayer.CreateEllipse(4.838622, 9.045, 5.597598, 8.21374)

s2.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

Set eff = s2.CreateBlend(s1, 10)

eff.Blend.Path = sPath

End Sub

 Related Topics


Shape.CreateContour

Function CreateContour([ByVal Direction As cdrContourDirection = cdrContourOutside (1)], [ByVal Offset As Double = 0], [ByVal Steps As Long = 1], [ByVal BlendType As cdrFountainFillBlendType = cdrDirectFountainFillBlend (0)], [ByVal OutlineColor As Color = Nothing], [ByVal FillColor As Color = Nothing], [ByVal FillColor2 As Color = Nothing], [ByVal SpacingAccel As Long = 0], [ByVal ColorAccel As Long = 0]) As Effect

Shape

Description

The CreateContour method creates a contour effect. This method returns the Effect object which represents contour properties.

Parameters	Description

Direction	Sets the direction of a contour effect. This property returns a value of cdrContourDirection. [in]
Optional
Default value = cdrContourOutside (1)

Offset	Sets the offset distance, in document units, between contour lines. This automatically adjusts the number of contour steps. [in]
Optional
Default value = 0

Steps	Sets the number of steps in a contour effect in CorelDRAW. The number of steps in a contour effect is linked to the number of lines that appear in the effect. [in]
Optional
Default value = 1

BlendType	Sets the color blend type of a fountain fill blend type. This property returns cdrFountainFillBlendType. [in]
Optional
Default value = cdrDirectFountainFillBlend (0)

OutlineColor	Sets the contour outline color [in]
Optional
Default value = Nothing

FillColor	Sets the contour fill color [in]
Optional
Default value = Nothing

FillColor2	Sets the FillColorTo color [in]
Optional
Default value = Nothing

SpacingAccel	Sets the change in the size of the steps [in]
Optional
Default value = 0

ColorAccel	Sets the acceleration of the color change [in]
Optional
Default value = 0

Return value

Returns Effect

Example

The following example creates a text string and applies a contour effect to it, resulting in blurred look.

Sub Test()

Dim sText As Shape

Set sText = ActiveLayer.CreateArtisticText(4, 5, "Blurred Text")

sText.Fill.UniformColor.RGBAssign 0, 0, 0

With sText.Text.FontProperties

.Name = "Arial"

.Size = 90

.Style = cdrBoldFontStyle

End With

sText.Text.AlignProperties.Alignment = cdrCenterAlignment

sText.CreateContour cdrContourOutside, 0.01, 10, , , CreateRGBColor(255, 255, 255)

End Sub

 Related Topics


Shape.CreateDropShadow

Function CreateDropShadow([ByVal Type As cdrDropShadowType = cdrDropShadowFlat (0)], [ByVal Opacity As Long = 50], [ByVal Feather As Long = 15], [ByVal OffsetX As Double = 0], [ByVal OffsetY As Double = 0], [ByVal Color As Color = Nothing], [ByVal FeatherType As cdrFeatherType = cdrFeatherAverage (3)], [ByVal FeatherEdge As cdrEdgeType = cdrEdgeLinear (0)], [ByVal PerspectiveAngle As Double = -45], [ByVal PerspectiveStretch As Double = 1], [ByVal Fade As Long = 1]) As Effect

Shape

Description

The CreateDropShadow method applies a drop shadow effect to a shape. This method returns the Effect object which represents the properties of a drop shadow effect.

Parameters	Description

Type	Specifies the type of drop shadow in a drop shadow effect. This value returns cdrDropShadowType. [in]
Optional
Default value = cdrDropShadowFlat (0)

Opacity	Specifies the opacity value of a drop shadow effect. Values range from 0 to 100. Low values create a less opaque drop shadow, while high values create a more opaque drop shadow. [in]
Optional
Default value = 50

Feather	Specifies the feather length for a drop shadow effect. Values range from 0 to 100. Low values create a more subtle feathering effect, while high values create a more pronounced effect. [in]
Optional
Default value = 15

OffsetX	Specifies the vertical offset of a drop shadow effect [in]
Optional
Default value = 0

OffsetY	Specifies the vertical offset of a drop shadow effect [in]
Optional
Default value = 0

Color	Specifies the color of a drop shadow effect [in]
Optional
Default value = Nothing

FeatherType	Specifies the feather type for a drop shadow effect. Values range from  0 to 100. Low values create a more subtle feathering effect, while high values create a more pronounced effect. This property returns cdrFeatherType. [in]
Optional
Default value = cdrFeatherAverage (3)

FeatherEdge	Specifies the feather edge for a drop shadow effect. Values range from 0 to 100. This property returns cdrEdgeType. [in]
Optional
Default value = cdrEdgeLinear (0)

PerspectiveAngle	Specifies the feather perspective angle in a drop shadow effect [in]
Optional
Default value = -45

PerspectiveStretch	Specifies the feather perspective stretch value in a drop shadow effect [in]
Optional
Default value = 1

Fade	Specifies the fade value of a drop shadow effect. The fade level of a drop shadow which has a Flat perspective cannot be changed. [in]
Optional
Default value = 1

Return value

Returns Effect

Example

The following example creates a cut-out effect.

Sub Test()

Const Border As Double = 0.5

Dim s As Shape, sRect As Shape, sShadow As Shape

Dim eff As Effect, sr As New ShapeRange

Dim x As Double, y As Double, sx As Double, sy As Double

Set s = ActiveLayer.CreateArtisticText(4, 5, "Cut")

With s.Text.FontProperties

.Name = "Arial"

.Size = 200

.Style = cdrBoldFontStyle

End With

s.Text.AlignProperties.Alignment = cdrCenterAlignment

s.GetBoundingBox x, y, sx, sy

Set sRect = ActiveLayer.CreateRectangle2(x - Border, y - Border, sx + 2 * Border, sy + 2 * Border)

s.Selected = True

Set sRect = ActiveSelection.Combine

sRect.Fill.UniformColor.CMYKAssign 30, 0, 0, 0

Set eff = sRect.CreateDropShadow(cdrDropShadowFlat, 80, 10, 0.2, -0.2, CreateCMYKColor(0, 0, 0, 100))

eff.Separate

Set sShadow = sRect.Next

Set s = ActiveLayer.CreateRectangle2(x, y, sx, sy)

s.Fill.ApplyNoFill

s.Outline.Type = cdrNoOutline

sShadow.AddToPowerClip s

s.OrderBackOf sRect

sr.Add s

sr.Add sRect

sr.Group.CreateSelection

End Sub

 Related Topics


Shape.CreateEnvelope

Function CreateEnvelope(ByVal PresetIndex As Long, [ByVal Mode As cdrEnvelopeMode = cdrEnvelopePutty (2)], [ByVal KeepLines As Boolean = False]) As Effect

Shape

Description

The CreateEnvelope method inserts a shape into a preset envelope. This method returns the Effect object which represents the envelope effect properties.

Currently you can apply only a preset envelope shape, and node positions cannot be modified.

Parameters	Description

PresetIndex	Represents an index number that uniquely identifies a preset envelope effect [in]

Mode	Specifies the type of mapping mode for the envelope effect. The Mode property returns a value of cdrEnvelopeMode. [in]
Optional
Default value = cdrEnvelopePutty (2)

KeepLines	Determines whether an envelope effect keeps its lines straight or converts them to curves. If the KeepLines property is True, the envelope effect keeps its lines straight. [in]
Optional
Default value = False

Return value

Returns Effect

Example

The following example draws a magnifying glass.

Sub Test()

Dim sText As Shape, sRect As Shape, sCircle1 As Shape, sCircle2 As Shape

Set sText = ActiveLayer.CreateArtisticText(2.8, 7.5, "Magnify")

With sText.Text.FontProperties

.Name = "Arial"

.Size = 64

End With

sText.Text.AlignProperties.Alignment = cdrCenterAlignment

sText.CreateEnvelope 4, cdrEnvelopePutty, False

ActiveDocument.ReferencePoint = cdrCenter

sText.Stretch 1, 1.6

Set sRect = ActiveLayer.CreateRectangle(2.164134, 5.358543, 6.338504, 4.798346)

With sRect

With .Fill.ApplyFountainFill(CreateRGBColor(255, 0, 0), CreateRGBColor(251, 0, 81), , -90)

.Colors.Add CreateRGBColor(255, 0, 0), 1

.Colors.Add CreateRGBColor(253, 253, 213), 23

.StartX = 4.251319

.StartY = 5.358543

.EndX = 4.251319

.EndY = 4.798346

End With

.Rotate -60

.Move 0.469843, -0.397559

.Outline.Type = cdrNoOutline

End With

Set sCircle1 = ActiveLayer.CreateEllipse(1.116024, 9.514843, 4.459134, 6.171732)

sCircle1.Outline.SetProperties 0.3, OutlineStyles(0), CreateCMYKColor(0, 100, 100, 0)

Set sCircle2 = sCircle1.Duplicate

With sCircle2.Outline

.Width = 0.05

.Color.CMYKAssign 0, 0, 0, 0

End With

sCircle2.CreateBlend sCircle1

End Sub

 Related Topics


Shape.CreateExtrude

Function CreateExtrude(ByVal Type As cdrExtrudeType, ByVal VPType As cdrExtrudeVPType, ByVal VPX As Double, ByVal VPY As Double, [ByVal Depth As Double = 20], [ByVal Shading As cdrExtrudeShading = cdrExtrudeObjectFill (0)], [ByVal BaseColor As Color = Nothing], [ByVal ShadingColor As Color = Nothing], [ByVal BevelDepth As Double = 0], [ByVal BevelAngle As Double = 45], [ByVal BevelColor As Color = Nothing], [ByVal BevelOnly As Boolean = False]) As Effect

Shape

Description

The CreateExtrude method extrudes the shape. This method returns the Effect object which represents the extrude effect properties.

Parameters	Description

Type	Specifies the extrude type. This property returns cdrExtrudeType. [in]

VPType	Specifies the vanishing point [in]

VPX	Specifies the x-coordinate of the vanishing point [in]

VPY	Specifies the y-coordinate of the vanishing point [in]

Depth	Specifies the extrude depth [in]
Optional
Default value = 20

Shading	Specifies the shading type. This property returns cdrExtrudeShading. [in]
Optional
Default value = cdrExtrudeObjectFill (0)

BaseColor	Specifies the solid fill color or starting shading color [in]
Optional
Default value = Nothing

ShadingColor	Specifies the ending shading color [in]
Optional
Default value = Nothing

BevelDepth	Specifies the bevel depth [in]
Optional
Default value = 0

BevelAngle	Specifies the bevel angle [in]
Optional
Default value = 45

BevelColor	Specifies the bevel color [in]
Optional
Default value = Nothing

BevelOnly	Determines whether to use only a bevel [in]
Optional
Default value = False

Return value

Returns Effect

Example

The following example creates an extruded text object.

Sub Test()

Dim sText As Shape, eff As Effect

Set sText = ActiveLayer.CreateArtisticText(4.25, 7, "Extrude")

With sText.Text.FontProperties

.Name = "Arial"

.Size = 120

.Style = cdrBoldFontStyle

End With

sText.Text.AlignProperties.Alignment = cdrCenterAlignment

sText.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

Set eff = sText.CreateExtrude(cdrExtrudeSmallBack, cdrVPLockedToShape, 4.25, 0.45, 40, _

 cdrExtrudeColorShading, CreateCMYKColor(0, 0, 0, 100), CreateCMYKColor(0, 0, 0, 0))

eff.Extrude.UseFullColorRange = True

End Sub

 Related Topics


Shape.CreateLens

Function CreateLens(ByVal Type As cdrLensType, [ByVal RateOrMagnification As Double = 50], [ByVal Color1 As Color = Nothing], [ByVal Color2 As Color = Nothing], [ByVal ColorMapPalette As cdrFountainFillBlendType = cdrDirectFountainFillBlend (0)]) As Effect

Shape

Description

The CreateLens method applies a lens effect to a shape. This method returns the Effect object which represents lens effect properties.

Parameters	Description

Type	Specifies the type of lens. This property returns cdrLensType. [in]

RateOrMagnification	Refers to values between 0 and 100% that increase the degree of a lens effect. The Rate property applies to the following lens effects: Brighten, Color add, Color limit, and Fish eye lens, and Transparency. [in]
Optional
Default value = 50

Color1	Specifies the starting color in a Custom color map lens effect [in]
Optional
Default value = Nothing

Color2	Specifies the ending color in a Custom color map lens effect [in]
Optional
Default value = Nothing

ColorMapPalette	Specifies the type of color map palette. This value returns cdrFountainFillBlendType. [in]
Optional
Default value = cdrDirectFountainFillBlend (0)

Return value

Returns Effect

Example

The following example creates a checkerboard and draws a Fish eye lens on top of it.

Sub Test()

Dim sGrid As Shape, s As Shape

Dim b As Boolean

Set sGrid = ActiveLayer.CreateGridBoxes(1.748504, 8.41252, 4.712126, 5.430827, 5, 5)

b = True

For Each s In sGrid.Shapes

If b Then

s.Fill.UniformColor.RGBAssign 0, 0, 0

Else

s.Fill.UniformColor.RGBAssign 255, 255, 255

End If

b = Not b

Next s

Set s = ActiveLayer.CreateEllipse(1.748504, 8.41252, 4.712126, 5.430827, 90#, 90#, False)

s.CreateLens cdrLensFishEye, 100

End Sub

 Related Topics


Shape.CreatePerspective

Function CreatePerspective([ByVal HorizVanishPointX As Variant], [ByVal HorizVanishPointY As Variant], [ByVal VertVanishPointX As Variant], [ByVal VertVanishPointY As Variant]) As Effect

Shape

Description

The CreatePerspective method applies a perspective effect to a shape. This method returns the Effect which represents perspective effect properties.

Parameters	Description

HorizVanishPointX	Specifies the x-coordinate of the horizontal vanishing point [in]
Optional

HorizVanishPointY	Specifies the y-coordinate of the horizontal vanishing point [in]
Optional

VertVanishPointX	Specifies the x-coordinate of the vertical vanishing point [in]
Optional

VertVanishPointY	Specifies the y-coordinate of the vertical vanishing point [in]
Optional

Return value

Returns Effect

Example

The following example creates a 3D cube with checkerboard sides.

Sub Test()

Dim sGrid As Shape, s As Shape

Dim b As Boolean, n As Long

Set sGrid = ActiveLayer.CreateGridBoxes(1.549724, 7.436693, 3.067677, 5.91874, 4, 4)

b = True

n = 0

For Each s In sGrid.Shapes

If b Then

s.Fill.UniformColor.RGBAssign 0, 0, 0

Else

s.Fill.UniformColor.RGBAssign 255, 255, 255

End If

n = n + 1

If (n Mod 4) <> 0 Then b = Not b

Next s

Set s = sGrid.Duplicate

s.SetBoundingBox 1.549724, 7.436693, 1.517953, 0.451447

s.CreatePerspective , , 6.984024, 9.839248

Set s = sGrid.Duplicate

s.SetBoundingBox 3.068583, 5.91874, 0.7395965, 1.517953

s.CreatePerspective 6.984024, 9.839248

End Sub

 Related Topics


Shape.CreatePushPullDistortion

Function CreatePushPullDistortion(ByVal OriginX As Double, ByVal OriginY As Double, ByVal Amplitude As Long) As Effect

Shape

Description

The CreatePushPullDistortion method applies a Push and pull distortion to a shape. This method returns the Effect object which represents the distortion effect properties.

Parameters	Description

OriginX	Specifies the x-coordinate around which the Push and Pull distortion rotates [in]

OriginY	Specifies the y-coordinate around which the Push and pull distortion rotates [in]

Amplitude	Determines the intensity of a Push and pull distortion effect. Values range from 0 to 100. Higher values produce a more pronounced distortion. [in]

Return value

Returns Effect

Example

The following example creates an ellipse in the middle of the page and applies a Push and pull distortion to it. Then it converts the shape to curve.

Sub Test()

Dim s As Shape

ActiveDocument.ResetSettings

Set s = ActiveLayer.CreateEllipse2(ActivePage.SizeWidth / 2, _

ActivePage.SizeHeight / 2, 2)

s.CreatePushPullDistortion 0, 0, 60

s.ConvertToCurves

End Sub

 Related Topics


Shape.CreateSelection

Sub CreateSelection()

Shape

Description

The CreateSelection method selects a shape. All other shapes on the page are deselected automatically.

See also the Selected property.

Example

The following example selects a shape with the name, "MyRectangle."

Sub Test()

Dim s As Shape

Set s = ActivePage.FindShape("MyRectangle")

If Not s Is Nothing Then

s.CreateSelection

Else

ActiveDocument.ClearSelection

End If

End Sub

 Related Topics


Shape.CreateTwisterDistortion

Function CreateTwisterDistortion(ByVal OriginX As Double, ByVal OriginY As Double, ByVal Angle As Double) As Effect

Shape

Description

The CreateTwisterDistortion method applies a Twister distortion to a shape. This method returns the Effect object which represents the distortion effect properties.

Parameters	Description

OriginX	Specifies the x-coordinate around which the twister distortion rotates [in]

OriginY	Specifies the y-coordinate around which the twister distortion rotates [in]

Angle	Specifies the degree of the twister rotation effect in the shape object [in]

Return value

Returns Effect

Example

The following example creates an ellipse and applies a Twister distortion to the ellipse. It then converts the ellipse to a curve.

Sub Test()

Dim s As Shape

ActiveDocument.ResetSettings

Set s = ActiveLayer.CreateEllipse2(ActivePage.SizeWidth / 2, _

ActivePage.SizeHeight / 2, 2)

s.CreateTwisterDistortion 0, 3, 80

s.ConvertToCurves

End Sub

 Related Topics


Shape.CreateZipperDistortion

Function CreateZipperDistortion(ByVal OriginX As Double, ByVal OriginY As Double, ByVal Amplitude As Long, ByVal Frequency As Long, [ByVal Random As Boolean = False], [ByVal Smooth As Boolean = False], [ByVal Local As Boolean = False]) As Effect

Shape

Description

The CreateZipperDistortion method applies a Zipper distortion to a shape. This method returns the Effect object which represents the distortion effect properties.

Parameters	Description

OriginX	Specifies the x-coordinate around which the zipper distortion rotates [in]

OriginY	Sets the y-coordinate around which the zipper distortion rotates [in]

Amplitude	Determines the intensity of a zipper distortion effect. Values range from 0 to 100. Higher values produce a more pronounced zipper distortion. [in]

Frequency	Values range from 0 to 100. A higher frequency value creates more zipper points in the distortion effect. [in]

Random	Determines whether the horizontal and vertical points follow a haphazard course [in]
Optional
Default value = False

Smooth	Determines whether the edges at the points are smooth or jagged [in]
Optional
Default value = False

Local	Determines whether the effect is emphasized in a specific area of the selected object [in]
Optional
Default value = False

Return value

Returns Effect

Example

The following example creates an ellipse and applies a Zipper distortion to the ellipse. It then converts the ellipse to a curve.

Sub Test()

Dim s As Shape

ActiveDocument.ResetSettings

Set s = ActiveLayer.CreateEllipse2(ActivePage.SizeWidth / 2, _

ActivePage.SizeHeight / 2, 2)

s.CreateZipperDistortion 0, 0, 6, 80

s.ConvertToCurves

End Sub

 Related Topics


Shape.Cut

Sub Cut()

Shape

Description

The Cut method copies an object to the clipboard and then deletes the object from the document.

Example

The following example cuts the active shape.

Sub Test()

ActiveShape.Cut

End Sub

 Related Topics


Shape.Delete

Sub Delete()

Shape

Description

The Delete method deletes a shape.

Example

The following example creates a crescent by trimming one ellipse with another.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateEllipse(1.947283, 7.707756, 4.278425, 5.376614)

Set s2 = s1.Duplicate(0.560197, 0)

s2.Trim s1

s2.Delete

End Sub

 Related Topics


Shape.Duplicate

Function Duplicate([ByVal OffsetX As Double = 0], [ByVal OffsetY As Double = 0]) As Shape

Shape

Description

The Duplicate method duplicates a shape and places the duplicate at the specified offset relative to the original shape position. The Duplicate method returns the Shape object for the duplicated shape.

Parameters	Description

OffsetX	Specifies the horizontal distance to offset the duplicated shape object [in]
Optional
Default value = 0

OffsetY	Specifies the vertical distance to offset the duplicated shape object [in]
Optional
Default value = 0

Return value

Returns Shape

Example

The following example creates an ellipse, duplicates it, and creates a blend between the two shapes.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateEllipse(2, 7, 4, 5)

Set s2 = s1.Duplicate(3, -5)

s1.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s2.Fill.UniformColor.CMYKAssign 0, 100, 100, 0

s2.CreateBlend s1

End Sub

 Related Topics


Shape.Flip

Sub Flip(ByVal Axes As cdrFlipAxes)

Shape

Description

The Flip method flips a shape along one or two axes. You can combine the two axes to flip the object along both in one step.

Parameters	Description

Axes	Sets the manner of the flip of a shape. This value returns cdrFlipAxes. [in]

Example

The following example creates an illusion of a text object reflected in a mirror.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateArtisticText(2, 5, "Some Text")

With s1.Text.FontProperties

.Name = "Arial"

.Size = 48

.Style = cdrBoldFontStyle

End With

Set s2 = s1.Duplicate(0, 0.5)

s1.Flip cdrFlipHorizontal

s1.Fill.ApplyFountainFill CreateCMYKColor(0, 0, 0, 100), CreateCMYKColor(0, 0, 0, 0), , -90

End Sub

 Related Topics


Shape.GetBoundingBox

Sub GetBoundingBox(ByRef X As Double, ByRef Y As Double, ByRef Width As Double, ByRef Height As Double, [ByVal UseOutline As Boolean = False])

Shape

Description

The GetBoundingBox method gets the size of an object and the position of its lower left corner.

If the UseOutline parameter is True, then the outline width and shape are accounted for when calculating the bounding box dimensions. Otherwise the shape is treated as if it has no outline.

Parameters	Description

X	Defines the horizontal, or x, coordinate for the lower left corner. This value is measured in document units. [out]

Y	Defines the vertical, or y, coordinate for the lower left corner. This value is measured in document units. [out]

Width	Defines the horizontal length. This value is measured in document units. [out]

Height	Defines the vertical length. This value is measured in document units. [out]

UseOutline	Determines whether the outline is included in measurements [in]
Optional
Default value = False

Example

The following example creates a rectangle around each shape on the active page.

Sub Test()

Dim s As Shape

Dim x As Double, y As Double, w As Double, h As Double

ActiveDocument.ReferencePoint = cdrBottomLeft

For Each s In ActivePage.Shapes

s.GetBoundingBox x, y, w, h

ActiveLayer.CreateRectangle2 x, y, s.SizeWidth, s.SizeHeight

Next s

End Sub

 Related Topics


Shape.GetMatrix

Sub GetMatrix(ByRef d11 As Double, ByRef d12 As Double, ByRef d21 As Double, ByRef d22 As Double, ByRef tx As Double, ByRef ty As Double)

Shape

Description

The GetMatrix method returns the values of the transformation matrix of a shape.

A transformation matrix is four numbers that include two transformations and two translations (movements). Each matrix element is referred to as D11, D12, D21, and D22 respectively, left to right, and top to bottom.

Parameters	Description

d11	Returns the horizontal stretch factor multiplied by the cosine of the rotation angle [out]

d12	Returns the vertical stretch factor multiplied by the sine of the sum of the rotation and skew angles. This value is expressed as the negative of the resultant value. [out]

d21	Returns the horizontal stretch factor multiplied by the sine of the rotation angle [out]

d22	Returns the vertical stretch factor multiplied by the cosine of the sum of the rotation and skew angles [out]

tx	[out]

ty	[out]

Example

The following example stretches each object along their x-axis by 200%. When applied to rotated objects, it causes the stretch along the rotated axies. For example, a rotated text object will be stretched along its baseline without skewing it.

Sub Test()

Dim d11 As Double, d12 As Double, d21 As Double, d22 As Double

Dim tx As Double, ty As Double, s As Shape

For Each s In ActivePage.Shapes

s.GetMatrix d11, d12, d21, d22, tx, ty

s.SetMatrix d11 * 2, d12, d21 * 2, d22, tx, ty

Next s

End Sub

 Related Topics


Shape.GetPosition

Sub GetPosition(ByRef PositionX As Double, ByRef PositionY As Double)

Shape

Description

The GetPosition method returns the coordinates of the point on the shape specified by the Document.ReferencePoint property of the Document object.

See also PositionX and PositionY properties of the Shape object.

Parameters	Description

PositionX	Returns the horizontal position of the shape object, in document units [out]

PositionY	Returns the vertical position of the shape object, in document units [out]

Example

The following example creates a small circle in the center of each shape on the page.

Sub Test()

Dim x As Double, y As Double

Dim s As Shape

ActiveDocument.ReferencePoint = cdrCenter

For Each s In ActivePage.Shapes

s.GetPosition x, y

ActiveLayer.CreateEllipse2 x, y, 0.03

Next s

End Sub

 Related Topics


Shape.GetSize

Sub GetSize(ByRef Width As Double, ByRef Height As Double)

Shape

Description

The GetSize method returns the horizontal and vertical size of the shape.

See also the SizeWidth and SizeHeight properties of the Shape object.

Parameters	Description

Width	Returns the width of the shape object, in document units [out]

Height	Returns the height of the shape object, in document units [out]

Example

The following example returns the width and height of each shape on the active page, and creates a rectangle with the same dimensions.

Sub Test()

Dim s As Shape

Dim x As Double, y As Double

ActiveDocument.ReferencePoint = cdrBottomLeft

For Each s In ActivePage.Shapes

s.GetSize x, y

ActiveLayer.CreateRectangle2 0, 0, x, y

Next s

End Sub

 Related Topics


Shape.Group

Function Group() As Shape

Shape

Description

The Group method groups the shapes that are part of the current shape and returns the group shape object.

This method is applicable for a selection shape only (whose Type is cdrSelectionShape).

Return value

Returns Shape

Example

The following example groups the current selection and moves the group to the current layer.

Sub Test()

Dim g As Shape

Set g = ActiveSelection.Group

g.Layer = ActiveLayer

End Sub

 Related Topics


Shape.Intersect

Function Intersect(ByVal TargetShape As Shape, [ByVal LeaveSource As Boolean = True], [ByVal LeaveTarget As Boolean = True]) As Shape

Shape

Description

The Intersect method creates an object which is an intersection of two shapes.

Parameters	Description

TargetShape	Specifies the object that intersects with the shape object [in]

LeaveSource	Determines whether to keep the shape object after the intersection is complete [in]
Optional
Default value = True

LeaveTarget	Determines whether to keep the target object after the intersection is complete [in]
Optional
Default value = True

Return value

Returns Shape

Example

The following example creates a color diagram for the additive color model (RGB). Three circles are filled, each with red, green, and blue. At the intersections of the circles, the resulting color blend fills the areas: white in the middle, while cyan, magenta, and yellow fill the areas between each pair of circles.

Sub Test()

Dim s(0 To 2) As Shape

Dim si(0 To 2) As Shape

Dim sm As Shape

Dim x As Double, y As Double

Dim i As Long, n As Long

Dim r As Long, g As Long, b As Long

Dim c1 As Color, c2 As Color

For i = 0 To 2

x = ActivePage.SizeWidth / 2 + 1 * Cos(i * 2.09439507)

y = ActivePage.SizeHeight / 2 + 1 * Sin(i * 2.09439507)

Set s(i) = ActiveLayer.CreateEllipse2(x, y, 1.5)

r = -255 * (i = 0)

g = -255 * (i = 1)

b = -255 * (i = 2)

s(i).Fill.UniformColor.RGBAssign r, g, b

Next i

For i = 0 To 2

n = (i + 1) Mod 3

Set si(i) = s(i).Intersect(s(n))

Set c1 = s(i).Fill.UniformColor

Set c2 = s(n).Fill.UniformColor

r = c1.RGBRed + c2.RGBRed

g = c1.RGBGreen + c2.RGBGreen

b = c1.RGBBlue + c2.RGBBlue

si(i).Fill.UniformColor.RGBAssign r, g, b

Next i

Set sm = si(1).Intersect(si(2))

sm.Fill.UniformColor.RGBAssign 255, 255, 255

End Sub

 Related Topics


Shape.IsOnShape

Function IsOnShape(ByVal X As Double, ByVal Y As Double, [ByVal HotArea As Double = -1]) As cdrPositionOfPointOverShape

Shape

Description

The IsOnCurve method determines whether the given point lies inside a shape or on its outline.

This method returns cdrPositionOfPointOverShape.

Parameters	Description

X	Sets the horizontal position for a point in the active document [in]

Y	Sets the vertical position for a point in the active document [in]

HotArea	Defines a tolerance radius in which to evaluate the presence of the shape [in]
Optional
Default value = -1

Return value

Returns cdrPositionOfPointOverShape

Example

The following example allows the user to click anywhere in the document and inspect whether any shape's outline or fill area was clicked. If so, the color of outline or fill is changed to yellow. This script runs until Esc is pressed.

Sub Test()

Dim s As Shape

Dim x As Double, y As Double

While ActiveDocument.GetUserClick(x, y, 0, 100, False, cdrCursorPickOvertarget) = 0

For Each s In ActivePage.Shapes

Select Case s.IsOnShape(x, y)

Case cdrOnMarginOfShape

If s.Outline.Type = cdrOutline Then

s.Outline.Color.RGBAssign 255, 255, 0

Exit For

End If

Case cdrInsideShape

s.Fill.UniformColor.RGBAssign 255, 255, 0

Exit For

End Select

Next s

Wend

End Sub

 Related Topics


Shape.Move

Sub Move(ByVal DeltaX As Double, ByVal DeltaY As Double)

Shape

Description

The Move method moves a shape by a specified offset relative to its previous position.

Positive values of offset move the shape to the right and upwards, while negative values move it to the left and downwards.

Parameters	Description

DeltaX	Specifies the horizontal distance to move a shape [in]

DeltaY	Specifies the vertical distance to move a shape [in]

Example

The following example creates a blend between two circles, separates the blend group, and scatters all intermediate blend steps randomly.

Sub Test()

Dim s1 As Shape, s2 As Shape

Dim e As Effect, sr As ShapeRange

Dim s As Shape

Set s1 = ActiveLayer.CreateEllipse(0, 10, 2, 8)

Set s2 = s1.Duplicate(5, -7)

s1.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s2.Fill.UniformColor.CMYKAssign 0, 100, 100, 0

Set e = s2.CreateBlend(s1)

Set sr = e.Separate

For Each s In sr(1).Shapes

s.Move Rnd() - 0.5, Rnd() - 0.5

Next s

End Sub

 Related Topics


Shape.OrderBackOf

Sub OrderBackOf(ByVal Shape As Shape)

Shape

Description

The OrderBackOf method places a shape behind a specified shape in the stacking order within the same layer.

Parameters	Description

Shape	Identifies the shape that will have another shape placed behind it in the stacking order [in]

Example

The following example creates a gray rectangle behind the selected shape.

Sub Test()

Dim s As Shape, r As Shape

Dim x As Double, y As Double, sx As Double, sy As Double

If ActiveSelection.Shapes.Count = 1 Then

Set s = ActiveShape

s.GetBoundingBox x, y, sx, sy

Set r = ActiveLayer.CreateRectangle2(x, y, sx, sy)

r.Fill.UniformColor.RGBAssign 225, 225, 225

r.OrderBackOf s

End If

End Sub

 Related Topics


Shape.OrderBackOne

Sub OrderBackOne()

Shape

Description

The OrderBackOne method moves a shape one step backward in the stacking order.

Example

The following example creates a gray rectangle behind the selected shape, and then moves the selected shape behind the rectangle.

Sub Test()

Dim s As Shape, r As Shape

Dim x As Double, y As Double, sx As Double, sy As Double

If ActiveSelection.Shapes.Count = 1 Then

Set s = ActiveShape

s.GetBoundingBox x, y, sx, sy

Set r = ActiveLayer.CreateRectangle2(x, y, sx, sy)

r.Fill.UniformColor.RGBAssign 225, 225, 225

r.OrderBackOf s

s.OrderBackOne

End If

End Sub

 Related Topics


Shape.OrderForwardOne

Sub OrderForwardOne()

Shape

Description

The OrderForwardOne method moves a shape one step forward in the stacking order.

Example

The following example moves the active shape one step forward.

Sub Test()

ActiveShape.OrderForwardOne

End Sub

 Related Topics


Shape.OrderFrontOf

Sub OrderFrontOf(ByVal Shape As Shape)

Shape

Description

The OrderFrontOf method places a shape in front of a specified shape in the stacking order within the same layer.

Parameters	Description

Shape	Identifies the shape that will have another shape placed in front of it in the stacking order [in]

Example

The following example creates a gray rectangle in front of the selected shape, and then moves the selected shape in front of the rectangle.

Sub Test()

Dim s As Shape, r As Shape

Dim x As Double, y As Double, sx As Double, sy As Double

If ActiveSelection.Shapes.Count = 1 Then

Set s = ActiveLayer.CreateEllipse(2, 2, 5, 5)

s.GetBoundingBox x, y, sx, sy

Set r = ActiveLayer.CreateRectangle2(x, y, sx, sy)

r.Fill.UniformColor.RGBAssign 225, 225, 225

s.OrderFrontOf r

End If

End Sub

 Related Topics


Shape.OrderIsInFrontOf

Function OrderIsInFrontOf(ByVal Shape As Shape) As Boolean

Shape

Description

The OrderIsInFrontOf method determines whether a shape is in front a specified shape in the stacking order.

Parameters	Description

Shape	Identifies the shape that will be checked to determine if another shape is in front of it (above) in the stacking order [in]

Return value

Returns Boolean

Example

The following example fills all shapes above the selected one with red.

Sub Test()

Dim s As Shape, ss As Shape

Set s = ActiveShape

For Each ss In ActiveLayer.Shapes

If ss.OrderIsInFrontOf(s) And Not ss Is s Then

ss.Fill.UniformColor.RGBAssign 255, 0, 0

End If

Next ss

End Sub

 Related Topics


Shape.OrderReverse

Sub OrderReverse()

Shape

Description

The OrderReverse method reverses the stacking order of selected shapes. This method can be applied only to a selection shape.

Example

The following example reverses the order of the selected shapes in the active document.

Sub Test()

ActiveSelection.OrderReverse

End Sub

 Related Topics


Shape.OrderToBack

Sub OrderToBack()

Shape

Description

The OrderToBack method moves a shape to the front of the stacking order.

Example

The following example creates a page frame rectangle and places it behind all other shapes on the current layer.

Sub Test()

Dim Frame As Shape

Set Frame = ActiveLayer.CreateRectangle(0, 0, ActivePage.SizeWidth, ActivePage.SizeHeight)

Frame.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(0, 0, 0)

Frame.OrderToBack

Frame.Locked = True

End Sub

 Related Topics


Shape.OrderToFront

Sub OrderToFront()

Shape

Description

The OrderToFront method moves a shape to the front of the stacking order.

Example

The following example creates a page frame rectangle and places it in front of all other shapes on the active layer.

Sub Test()

Dim Frame As Shape

Set Frame = ActiveLayer.CreateRectangle(0, 0, ActivePage.SizeWidth, _

ActivePage.SizeHeight)

Frame.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), _

CreateRGBColor(0, 0, 0)

Frame.OrderToFront

Frame.Locked = True

End Sub

 Related Topics


Shape.PlaceTextInside

Function PlaceTextInside(ByVal TextShape As Shape) As Shape

Shape

Description

The PlaceTextInside method places the specified text inside of a shape.

Parameters	Description

TextShape	Specifies the shape in which the text is placed [in]

Return value

Returns Shape

Example

The following example places the text inside the ellipse.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Set s1 = ActiveLayer.CreateEllipse(0, 0, 2, 2)

Set s = ActiveLayer.CreateArtisticText(0, 0, "My Text", , , "Arial Black", 24)

s1.PlaceTextInside s

End Sub

 Related Topics


Shape.RemoveFromContainer

Sub RemoveFromContainer([ByVal Level As Long = 0])

Shape

Description

The RemoveFromContainer method removes a shape from its PowerClip container.

If there are several nested PowerClip objects, you can remove a shape from several containers at a time by specifying the Level parameter value.

Parameters	Description

Level	Specifies the lowest level from which you want to remove a shape. The shape is removed from this level and all levels above it. [in]
Optional
Default value = 0

Example

The following example removes all ellipses from all PowerClips on the current page.

Sub Test()

Dim s As Shape, ss As Shape

Dim p As PowerClip

On Error Resume Next

For Each s In ActivePage.Shapes

Set p = Nothing

Set p = s.PowerClip

If Not p Is Nothing Then

For Each ss In p.Shapes

If ss.Type = cdrEllipseShape Then

ActiveDocument.ClearSelection

ss.RemoveFromContainer

End If

Next ss

End If

Next s

End Sub

 Related Topics


Shape.RemoveFromSelection

Sub RemoveFromSelection()

Shape

Description

The RemoveFromSelection method removes a shape from a selection. This method does not work if the shape is a Selection Shape.

Example

The following example removes all text objects from the selection.

Sub Test()

Dim sr As ShapeRange

Dim s As Shape

Set sr = ActiveDocument.SelectionRange

For Each s In sr

If s.Type = cdrTextShape Then s.RemoveFromSelection

Next s

End Sub

 Related Topics


Shape.Rotate

Sub Rotate(ByVal Angle As Double)

Shape

Description

The Rotate method rotates a shape. The center of rotation is specified by the RotationCenterX and RotationCenterY properties of the shape.

Parameters	Description

Angle	Specifies the number of degrees to rotate the shape [in]

Example

The following example creates a flower with randomly colored petals.

Sub Test()

Const NumLeafs As Long = 11

Dim pal As Palette

Dim s As Shape

Dim i As Long, NumColors As Long

Set s = Nothing

If ActivePalette Is Nothing Then

Set pal = Palettes.Open(Application.SetupPath & "Custom\coreldrw.cpl")

Else

Set pal = ActivePalette

End If

NumColors = pal.ColorCount

For i = 1 To NumLeafs

If s Is Nothing Then

Set s = ActiveLayer.CreateEllipse(5, 5, 7, 6)

s.RotationCenterX = 4

s.RotationCenterY = 5.5

Else

s.Duplicate

End If

s.Fill.ApplyUniformFill pal.Color(Rnd() * NumColors + 1)

s.Rotate 360 / NumLeafs

Next i

End Sub

 Related Topics


Shape.RotateEx

Sub RotateEx(ByVal Angle As Double, ByVal CenterX As Double, ByVal CenterY As Double)

Shape

Description

The RotateEx method rotates a shape around a specified center of rotation.

Parameters	Description

Angle	Sets the angle measurement, in degrees, in which the shape is rotated [in]

CenterX	Sets the x-coordinate for the center of rotation [in]

CenterY	Sets the y-coordinate for the center of rotation [in]

Example

The following example creates a flower with randomly-colored petals.

Sub Test()

Const NumLeafs As Long = 11

Dim pal As Palette

Dim s As Shape

Dim i As Long, NumColors As Long

Set s = Nothing

If ActivePalette Is Nothing Then

Set pal = Palettes.Open(Application.SetupPath & "Custom\coreldrw.cpl")

Else

Set pal = ActivePalette

End If

NumColors = pal.ColorCount

For i = 1 To NumLeafs

If s Is Nothing Then

Set s = ActiveLayer.CreateEllipse(5, 5, 7, 6)

s.RotationCenterX = 4

s.RotationCenterY = 5.5

Else

s.Duplicate

End If

s.Fill.ApplyUniformFill pal.Color(Rnd() * NumColors + 1)

s.RotateEx 360 / NumLeafs, ActivePage.SizeHeight / 2, ActivePage.SizeWidth / 2

Next i

End Sub

 Related Topics


Shape.Separate

Sub Separate()

Shape

Description

The Separate method separates effect shapes (combined shapes or a linked groups, such as blend groups, drop shadows, and so on).

This method is provided for compatibility reasons. The suggested method is Effect.Separate.

Examples

The following example creates a blend between two ellipses and separates it.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateEllipse(0, 10, 2, 8)

Set s2 = s1.Duplicate(5, -7)

s1.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s2.Fill.UniformColor.CMYKAssign 0, 100, 100, 0

s2.CreateBlend(s1).Blend.BlendGroup.CreateSelection

s2.Selected = True

s1.Selected = True

ActiveSelection.Separate

End Sub

The following example performs the same procedure as the previous example using the Effect.Separate method.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateEllipse(0, 10, 2, 8)

Set s2 = s1.Duplicate(5, -7)

s1.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s2.Fill.UniformColor.CMYKAssign 0, 100, 100, 0

s2.CreateBlend(s1).Separate

End Sub

 Related Topics


Shape.SetBoundingBox

Sub SetBoundingBox(ByVal X As Double, ByVal Y As Double, ByVal Width As Double, ByVal Height As Double, [ByVal KeepAspect As Boolean = False], [ByVal ReferencePoint As cdrReferencePoint = cdrCenter (9)])

Shape

Description

The SetBoundingBox method moves and resizes a shape so that it fits the specified bounding box.

You can resize a shape with or without maintaining its proportions. The default shape position within the bounding box can be specified.

Parameters	Description

X	Sets the horizontal position, or x-coordinate, of the center of the bounding box, in document units. [in]

Y	Sets the vertical position, or y-coordinate, of the center of the bounding box, in document units. [in]

Width	Sets the width of the bounding box, in document units [in]

Height	Sets the height of the bounding box, in document units [in]

KeepAspect	Specifies whether the size proportions of the bounding box are maintained relative to its contents [in]
Optional
Default value = False

ReferencePoint	Sets the reference point [in]
Optional
Default value = cdrCenter (9)

Example

The following example creates a new document and imports all images from the specified folder, arranging them in an array of thumbnails on the page.

Sub Test()

Const NumX As Long = 4 ' Number of thumbnails horizontally

Const NumY As Long = 5 ' Number of thumbnails vertically

Const Margin As Double = 0.5 ' Page margin in inches

Const Gutter As Double = 0.1 ' Thumbnail gutter in inches

Const Caption As Double = 0.2 ' Image caption size in inches

Const Folder As String = "C:\Temp\Images\" ' Folder path

Dim s As Shape, doc As Document

Dim nx As Long, ny As Long

Dim x As Double, y As Double, sx As Double, sy As Double

Dim f As String

nx = 0

ny = 0

Set doc = CreateDocument()

sx = (doc.ActivePage.SizeWidth - 2 * Margin - (NumX - 1) * Gutter) / NumX

sy = (doc.ActivePage.SizeHeight - 2 * Margin - (NumY - 1) * Gutter) / NumY

' Find first file in the folder

f = Dir(Folder & "*.*")

While f <> ""

x = Margin + nx * (Gutter + sx)

y = Margin + ny * (Gutter + sy)

' Create a rectangle to hold a thumbnail

doc.ActiveLayer.CreateRectangle2 x, y + Caption, sx, sy - Caption

' Place a file name caption below the rectangle

With doc.ActiveLayer.CreateArtisticText(x + sx / 2, y, f).Text

.AlignProperties.Alignment = cdrCenterAlignment

With .FontProperties

.Name = "Arial"

.Size = 10

End With

End With

doc.ClearSelection

' Import the file

doc.ActiveLayer.Import Folder & f

If Not doc.ActiveShape Is Nothing Then

' If anything is imported, place it inside the rectangle

ActiveShape.SetBoundingBox x, y + Caption, sx, sy - Caption, True, cdrCenter

End If

nx = nx + 1

If nx = NumX Then

nx = 0

ny = ny + 1

If ny = NumY Then

doc.AddPages 1 ' Add the page if the current one is full

ny = 0

End If

End If

' Find next file

f = Dir()

Wend

End Sub

 Related Topics


Shape.SetMatrix

Sub SetMatrix(ByVal d11 As Double, ByVal d12 As Double, ByVal d21 As Double, ByVal d22 As Double, ByVal tx As Double, ByVal ty As Double)

Shape

Description

The SetMatrix method sets the values of the transformation matrix of a shape.

A transformation matrix is four numbers that include two transformations and two translations (movements). Each matrix element is referred to as D11, D12, D21, and D22 respectively, left to right, and top to bottom.

Parameters	Description

d11	Returns the horizontal stretch factor multiplied by the cosine of the rotation angle [in]

d12	Returns the vertical stretch factor multiplied by the sine of the sum of the rotation and skew angles. This value is expressed as the negative of the resultant value. [in]

d21	Returns the horizontal stretch factor multiplied by the sine of the rotation angle [in]

d22	Returns the vertical stretch factor multiplied by the cosine of the sum of the rotation and skew angles [in]

tx	[in]

ty	[in]

Example

The following example stretches each object along their x-axis by 200%. When applied to rotated objects, it causes the stretch along the rotated axies. For example, a rotated text object will be stretched along its baseline without skewing it.

Sub Test()

Dim d11 As Double, d12 As Double, d21 As Double, d22 As Double

Dim tx As Double, ty As Double, s As Shape

For Each s In ActivePage.Shapes

s.GetMatrix d11, d12, d21, d22, tx, ty

s.SetMatrix d11 * 2, d12, d21 * 2, d22, tx, ty

Next s

End Sub

 Related Topics


Shape.SetPosition

Sub SetPosition(ByVal PositionX As Double, ByVal PositionY As Double)

Shape

Description

The SetPosition method moves the shape to a given position on the page. The specified coordinates of the new position are relative to the shape reference point specified by the Document.ReferencePoint property.

Parameters	Description

PositionX	Sets the horizontal position of the shape object, in document units. [in]

PositionY	Sets the vertical position of the shape object, in document units. [in]

Example

The following example sets the current position of each shape on the page to the bottom left corner of the page.

Sub Test()

Dim s As Shape

Dim x As Double, y As Double

For Each s In ActivePage.Shapes

s.SetPosition 0, 0

Next s

End Sub

 Related Topics


Shape.SetRotationCenter

Sub SetRotationCenter(ByVal X As Double, ByVal Y As Double)

Shape

Description

The SetRotationCenter method specifies both the horizontal and veritcal position of the center of rotation for a shape.

See also RotationCenterX and RotationCenterY properties

Parameters	Description

X	Defines the horizontal coordinate of the center of rotation [in]

Y	Defines the horizontal coordinate of the center of rotation [in]

Example

The following example creates a flower with randomly colored petals.

Sub Test()

Const NumLeafs As Long = 11

Dim pal As Palette

Dim s As Shape

Dim i As Long, NumColors As Long

Set s = Nothing

If ActivePalette Is Nothing Then

Set pal = Palettes.Open(Application.SetupPath & "Custom\coreldrw.cpl")

Else

Set pal = ActivePalette

End If

NumColors = pal.ColorCount

For i = 1 To NumLeafs

If s Is Nothing Then

Set s = ActiveLayer.CreateEllipse(5, 5, 7, 6)

s.SetRotationCenter 4, 5.5

Else

s.Duplicate

End If

s.Fill.ApplyUniformFill pal.Color(Rnd() * NumColors + 1)

s.Rotate 360 / NumLeafs

Next i

End Sub

 Related Topics


Shape.SetSize

Sub SetSize([ByVal Width As Double = 0], [ByVal Height As Double = 0])

Shape

Description

The SetSize method stretches the shape so it becomes of the specified width and height.

The shape is stretched relative to the reference point specified by the Document.ReferencePoint property. If either parameter is omitted, the other parameter is calculated based on the other dimension to maintain proportions. You cannot omit both parameters though.

See also the SetBoundingBox method, as well as the SizeWidth and SizeHeight properties of the Shape object.

Parameters	Description

Width	Sets the width of the shape object, in document units [in]
Optional
Default value = 0

Height	Sets the height of the shape object, in document units [in]
Optional
Default value = 0

Example

The following example resizes all existing shapes on the active page.

Sub Test()

Dim s As Shape

ActiveDocument.ReferencePoint = cdrBottomLeft

For Each s In ActivePage.Shapes

s.SetSize 1, 1

Next s

End Sub

 Related Topics


Shape.SetSizeEx

Sub SetSizeEx(ByVal CenterX As Double, ByVal CenterY As Double, [ByVal Width As Double = 0], [ByVal Height As Double = 0])

Shape

Description

The SetSizeEx method stretches a shape to the specified width and height, relative to the coordinates specified as the anchor point. The anchor point remains stationary when you stretch the shape, and therefore, represents the center of the distortion. If any of the parameters is omitted, the size is calculated based on the other dimension to maintain proportions.

See also the SetBoundingBox method as well as the SizeWidth and SizeHeight properties.

Parameters	Description

CenterX	Defines the horizontal coordinate of the anchor point [in]

CenterY	Defines the vertical coordinate of the anchor point [in]

Width	Defines the horizontal measurement. This value is measured in document units. [in]
Optional
Default value = 0

Height	Defines the vertical measurement. This value is measured in document units. [in]
Optional
Default value = 0

Example

The following example stretches all shapes on the active layer proportionally so that their horizontal size is 2".

Sub Test()

Dim x As Double, y As Double

Dim sr As ShapeRange

Set sr = ActiveLayer.Shapes.All

If sr.Count > 0 Then

ActiveDocument.ReferencePoint = cdrCenter

sr.GetPosition x, y

sr.SetSizeEx x, y, 2

End If

End Sub

 Related Topics


Shape.Skew

Sub Skew(ByVal AngleX As Double, ByVal AngleY As Double)

Shape

Description

The Skew method skews a shape relative to the reference point specified by the Document.ReferencePoint property.

Parameters	Description

AngleX	Specifies the degree in which to slant the shape object horizontally [in]

AngleY	Specifies the degree in which to slant the shape object vertically [in]

Example

The following example creates an isometric cube.

Sub Test()

Dim s1 As Shape, s2 As Shape, s3 As Shape

Set s1 = ActiveLayer.CreateRectangle(2.5, 8.5, 4.5, 6.5)

s1.Fill.UniformColor.CMYKAssign 0, 100, 100, 0

Set s2 = s1.Duplicate

s2.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

ActiveDocument.ReferencePoint = cdrTopLeft

s2.Stretch 0.866025, 1

s2.Skew 0, -30

s2.Move -0.866025, 0.5

Set s3 = s1.Duplicate

s3.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s3.Stretch 0.866025, 1

s3.Skew 0, 30

s3.Move 0.866025, -0.5

s1.Stretch 0.866025, 1

s1.Skew 0, 30

s1.Rotate -60

s1.Move 0, 1

End Sub

 Related Topics


Shape.SkewEx

Sub SkewEx(ByVal AngleX As Double, ByVal AngleY As Double, ByVal CenterX As Double, ByVal CenterY As Double)

Shape

Description

The SkewEx method skews a shape using the point coordinates specified as the center of distortion.

Parameters	Description

AngleX	Sets the horizontal angle, in degrees, in which to skew the object [in]

AngleY	Sets the vertical angle, in degrees, in which to skew the object [in]

CenterX	Sets the x-coordinate for the center of distortion [in]

CenterY	Sets the y-coordinate for the center of distortion [in]

Example

The following example creates an isometric cube.

Sub Test()

Dim s1 As Shape, s2 As Shape, s3 As Shape

Set s1 = ActiveLayer.CreateRectangle(2.5, 8.5, 4.5, 6.5)

s1.Fill.UniformColor.CMYKAssign 0, 100, 100, 0

Set s2 = s1.Duplicate

s2.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

ActiveDocument.ReferencePoint = cdrTopLeft

s2.Stretch 0.866025, 1

s2.SkewEx 0, 30, 1, 1

s2.Move -0.866025, 0.5

Set s3 = s1.Duplicate

s3.Fill.UniformColor.CMYKAssign 0, 0, 100, 0

s3.Stretch 0.866025, 1

s3.SkewEx 0, 30, 1, 1

s3.Move 0.866025, -0.5

s1.Stretch 0.866025, 1

s1.SkewEx 0, 30, 1, 1

s1.Rotate -60

s1.Move 0, 1

End Sub

 Related Topics


Shape.Stretch

Sub Stretch(ByVal StretchX As Double, [ByVal StretchY As Double = 0], [ByVal StretchCharactersSize As Boolean = False])

Shape

Description

The Stretch method stretches a shape relative to the reference point specified by the Document.ReferencePoint property.

Parameters	Description

StretchX	Specifies the distance to stretch the shape horizontally [in]

StretchY	Specifies the distance to stretch the shape vertically. If this value is omitted, its value is assumed to be the same as the StretchX parameter value, resulting in a proportional stretch. [in]
Optional
Default value = 0

StretchCharactersSize	Specifies whether characters are stretched with the shape [in]
Optional
Default value = False

Example

The following example stretches each shape on the current layer by 200% relative to each shape's center.

Sub Test()

Dim s As Shape

ActiveDocument.ReferencePoint = cdrCenter

For Each s In ActiveLayer.Shapes

s.CreateSelection

s.Stretch 2

Next s

End Sub

 Related Topics


Shape.StretchEx

Sub StretchEx(ByVal CenterX As Double, ByVal CenterY As Double, ByVal StretchX As Double, [ByVal StretchY As Double = 0], [ByVal StretchCharactersSize As Boolean = False])

Shape

Description

The StretchEx method stretches a shape to the specified width and height, relative to the coordinates specified as the center of distortion. The vertical stretch factor, the StretchY parameter, can be omitted; in this case, CorelDRAW assigns the same the horizontal stretch factor as the as vertical stretch factor, resulting in a proportional stretch.

Parameters	Description

CenterX	Defines the x-coordinate of the center of distortion [in]

CenterY	Sets the y-coordinate of the center of distortion [in]

StretchX	Defines the horizontal stretch factor [in]

StretchY	Defines the vertical stretch factor [in]
Optional
Default value = 0

StretchCharactersSize	Specifies whether characters are stretched with the shape [in]
Optional
Default value = False

Example

The following example stretches all shapes on the page by 200% using the center of the page as the center of the distortion.

Sub Test()

ActiveDocument.ReferencePoint = cdrBottomLeft

With ActivePage

.Shapes.All.StretchEx .CenterX, .CenterY, 2

End With

End Sub

 Related Topics


Shape.Trim

Function Trim(ByVal TargetShape As Shape, [ByVal LeaveSource As Boolean = True], [ByVal LeaveTarget As Boolean = False]) As Shape

Shape

Description

The Trim method trims an object.

Parameters	Description

TargetShape	Specifies the object to trim [in]

LeaveSource	Determines whether to keep the object that trims the other object, after the trim is complete [in]
Optional
Default value = True

LeaveTarget	Determines whether to keep the target object after the trim is complete [in]
Optional
Default value = False

Return value

Returns Shape

Example

The following example creates a text embossed on a texturized surface.

Sub Test()

Const Offset As Double = 0.05

Dim sBase As Shape, sLight As Shape, sDark As Shape

Dim sRect As Shape

Set sRect = ActiveLayer.CreateRectangle2(0.75, 4, 7, 3)

Set sBase = ActiveLayer.CreateArtisticText(4.25, 4.75, "Bevel")

With sBase.Text

With .FontProperties

.Name = "Arial"

.Size = 150

.Style = cdrBoldFontStyle

End With

.AlignProperties.Alignment = cdrCenterAlignment

End With

Set sLight = sBase.Duplicate(-Offset, Offset)

Set sLight = sBase.Trim(sLight)

sLight.Fill.UniformColor.CMYKAssign 20, 0, 20, 0

Set sDark = sBase.Duplicate(Offset, -Offset)

sDark.Fill.UniformColor.CMYKAssign 100, 0, 100, 80

sBase.Trim sDark, False, False

sRect.Fill.ApplyTextureFill "Ivy on a Wall", "Samples 7"

End Sub

 Related Topics


Shape.Ungroup

Sub Ungroup()

Shape

Description

The Ungroup method ungroups all the shapes in the given group.

Example

The following example creates two circles and builds a blend between them. It then separates the blend, ungroups the blend steps and scatters them randomly.

Sub Test()

Dim s1 As Shape, s2 As Shape

Dim s As Shape

Dim g As ShapeRange, stps As ShapeRange

Set s1 = ActiveLayer.CreateEllipse(0, 0, 2, 2)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

Set s2 = ActiveLayer.CreateEllipse(6, 6, 7, 7)

s2.Fill.UniformColor.RGBAssign 255, 255, 0

s1.CreateBlend s2

Set g = s1.Effects(1).Separate

Set stps = g(1).Shapes.All

g(1).Ungroup

For Each s In stps

s.Move (Rnd() - 0.5) * s.SizeWidth, (Rnd() - 0.5) * s.SizeHeight

Next s

End Sub

 Related Topics


Shape.UngroupAll

Sub UngroupAll()

Shape

Description

The UngroupAll method ungroups all the shapes in the given group and any subgroups that the current group contains.

Example

The following example ungroups any nested groups on the active page. Top-level groups remain unchanged, while nested groups are ungrouped.

Sub Test()

Dim s As Shape, sg As Shape

For Each s In ActivePage.Shapes

If s.Type = cdrGroupShape Then

For Each sg In s.Shapes

If sg.Type = cdrGroupShape Then

sg.UngroupAll

End If

Next sg

End If

Next s

End Sub

 Related Topics


Shape.UngroupAllEx

Function UngroupAllEx() As ShapeRange

Shape

Description

The UngroupAllEx method ungroups all the shapes in the specified group and any subgroups that the current group contains. The shapes are returned as a ShapeRange object.

Return value

Returns ShapeRange

Example

The following example fills each subgroup with a random RGB color.

Sub Test()

Dim s As Shape, sg As Shape, sr As ShapeRange

For Each s In ActivePage.Shapes

If s.Type = cdrGroupShape Then

For Each sg In s.Shapes

If sg.Type = cdrGroupShape Then

Set sr = sg.UngroupAllEx

sr.ApplyUniformFill CreateRGBColor(255 * (Rnd() * 255), 255 * (Rnd * 255), 255 * (Rnd * 255))

End If

Next sg

End If

Next s

End Sub

 Related Topics


Shape.UngroupEx

Function UngroupEx() As ShapeRange

Shape

Description

The UngroupEx method ungroups all the shapes in the specified group and returns the ungrouped objects as a ShapeRange object.

Return value

Returns ShapeRange

Example

The following example creates two circles and builds a blend between them. The blend is separated, while the blend steps are ungrouped and scattered randomly.

Sub Test()

Dim s1 As Shape, s2 As Shape

Dim s As Shape

Dim g As ShapeRange, stps As ShapeRange

Set s1 = ActiveLayer.CreateEllipse(0, 0, 2, 2)

s1.Fill.UniformColor.RGBAssign 255, 0, 0

Set s2 = ActiveLayer.CreateEllipse(6, 6, 7, 7)

s2.Fill.UniformColor.RGBAssign 255, 255, 0

s1.CreateBlend s2

Set g = s1.Effects(1).Separate

Set stps = g(1).UngroupEx

For Each s In stps

s.Move (Rnd() - 0.5) * s.SizeWidth, (Rnd() - 0.5) * s.SizeHeight

Next s

End Sub

 Related Topics


Shape.Weld

Function Weld(ByVal TargetShape As Shape, [ByVal LeaveSource As Boolean = False], [ByVal LeaveTarget As Boolean = False]) As Shape

Shape

Description

The Weld method welds shapes together.

Parameters	Description

TargetShape	Specifies the object that welds with the shape object [in]

LeaveSource	Determines whether to keep the shape object after the weld is complete [in]
Optional
Default value = False

LeaveTarget	Determines whether to keep the target object after the weld is complete [in]
Optional
Default value = False

Return value

Returns Shape

Example

The following example creates a circle and a square, and welds them together.

Sub Test()

Dim s1 As Shape, s2 As Shape

Dim s As Shape

Set s1 = ActiveLayer.CreateEllipse2(4, 5, 2)

Set s2 = ActiveLayer.CreateRectangle2(2, 1, 4, 4)

Set s = s1.Weld(s2)

s.Fill.UniformColor.CMYKAssign 100, 0, 0, 0

End Sub

 Related Topics


ShapeRange properties

ShapeRange     Legend

    Application
    Count
  Item
    Parent
      PositionX
      PositionY
      RotationCenterX
      RotationCenterY
      SizeHeight
      SizeWidth


ShapeRange methods

ShapeRange     Legend

   Add
   AddRange
   AddToPowerClip
   AddToSelection
   ApplyFountainFill
   ApplyNoFill
   ApplyPatternFill
   ApplyPostscriptFill
   ApplyTextureFill
   ApplyUniformFill
   ClearEffect
   Clone
   Combine
   ConvertOutlineToObject
   ConvertToBitmap
   ConvertToBitmapEx
   ConvertToCurves
   Copy
   CreateSelection
   Cut
   Delete
   DeleteItem
   Duplicate
   Flip
   GetBoundingBox
   GetPosition
   GetSize
   Group
   IndexOf
   Move
   OrderBackOf
   OrderBackOne
   OrderForwardOne
   OrderFrontOf
   OrderReverse
   OrderToBack
   OrderToFront
   Remove
   RemoveAll
   RemoveFromContainer
   RemoveFromSelection
   RemoveRange
   RestoreCloneLink
   Rotate
   RotateEx
   SetBoundingBox
   SetOutlineProperties
   SetPosition
   SetRotationCenter
   SetSize
   SetSizeEx
   Skew
   SkewEx
   Stretch
   StretchEx
   UngroupAll


ShapeRange

Class ShapeRange

Properties     Methods     Referenced By

The ShapeRange class represents a dynamic array of Shape objects. Shape-specific properties and methods can be applied to each shape of the array (range).

You can create a ShapeRange object by using the New keyword in Visual Basic.

 Related Topics


ShapeRange.Application

Property Application As Application

ShapeRange

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


ShapeRange.Count

Property Count As Long

ShapeRange

Description

The Count property returns the number of shapes in the ShapeRange class.

Read-Only

Example

The following example displays the number of ellipses on the active page.

Sub Test()

Dim sr As ShapeRange

Set sr = ActivePage.FindShapes(Type:=cdrEllipseShape)

MsgBox "There are " & sr.Count & " ellipse(s) on the current page"

End Sub

 Related Topics


ShapeRange.Item

Property Item(ByVal IndexOrName As Variant) As Shape

ShapeRange

Description

The Item property returns the specified ShapeRange.

The Item property is the default property and its reference may be omitted when referencing items in the collection. For example, ShapeRange.Item(2) is the same as ShapeRange(2) - they both reference the second segment object in the Segments collection.

Read-Only

Parameters	Description

IndexOrName	Specifies the shape by its index number or name. You can use the integer number that represents the index of the shape in the range (starting from 1) or the name of the shape. If the shape with specified index or name is not in the range, a run-time error is issued. [in]

Examples

The following example finds the shape named "MyRectangle" from the selection, and fills "MyRectangle" with a uniform red fill.

Sub Test()

ActiveSelectionRange("MyRectangle").Fill.UniformColor.RGBAssign 255, 0, 0

End Sub

The following example fills every ellipse on the active page with a uniform blue fill

Sub Test()

Dim i As Long

Dim sr As ShapeRange

Set sr = ActivePage.FindShapes(Type:=cdrEllipseShape)

For i = 1 To sr.Count

sr(i).Fill.UniformColor.RGBAssign 0, 0, 255

Next i

End Sub

The following example performs the same procedure as the previous example. However, instead of using a For Next command, it uses the For Each command in Visual Basic to iterate through all shapes in the collection.

Sub Test()

Dim s As Shape

Dim sr As ShapeRange

Set sr = ActivePage.FindShapes(Type:=cdrEllipseShape)

For Each s In sr

s.Fill.UniformColor.RGBAssign 0, 0, 255

Next s

End Sub

 Related Topics


ShapeRange.Parent

Property Parent As Application

ShapeRange

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


ShapeRange.PositionX

Property PositionX As Double

ShapeRange

Description

The PositionX property returns or sets the horizontal coordinate of a range of shapes, treating the group of shapes as though it was a single object. The coordinate is specified relative to the anchor point specified by the Document.ReferencePoint property.

See also the GetPosition, SetPosition, Move, GetBoundingBox, and SetBoundingBox methods.

Example

The following example creates a range containing all the ellipses on the page and duplicates the range. The duplicated shapes are placed in the lower left corner of the page, treating the group of shapes as though it was a group.

Sub Test()

Dim sr1 As ShapeRange, sr2 As ShapeRange

Set sr1 = ActivePage.FindShapes(Type:=cdrEllipseShape)

Set sr2 = sr1.Duplicate

ActiveDocument.ReferencePoint = cdrBottomLeft

sr2.PositionX = 0

sr2.PositionY = 0

End Sub

 Related Topics


ShapeRange.PositionY

Property PositionY As Double

ShapeRange

Description

The PositionY property returns or sets the vertical coordinate of a range of shapes, treating the group of shapes as though it was a single object. The coordinate is specified relative to the anchor point specified by the Document.ReferencePoint property.

See also the GetPosition, SetPosition, Move, GetBoundingBox, and SetBoundingBox methods.

Example

The following example creates a range containing all the ellipses on the page and duplicates the range. The duplicated shapes are placed in the lower left corner of the page, treating the group of shapes as though it was a group.

Sub Test()

Dim sr1 As ShapeRange, sr2 As ShapeRange

Set sr1 = ActivePage.FindShapes(Type:=cdrEllipseShape)

Set sr2 = sr1.Duplicate

ActiveDocument.ReferencePoint = cdrBottomLeft

sr2.PositionX = 0

sr2.PositionY = 0

End Sub

 Related Topics


ShapeRange.RotationCenterX

Property RotationCenterX As Double

ShapeRange

Description

The RotationCenterX returns or sets the horizontal coordinate for the center of rotation of a range of shapes.

See also the SetRotationCenter method.

Example

The following example creates a "flower" by duplicating circles. It then creates a larger flower by duplicating this group of six circles five more times to form six petals of different colors.

Sub Test()

Dim n As Long

Dim sr As New ShapeRange, sr1 As ShapeRange

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(0, 0, 0.5)

s.RotationCenterX = 1

s.RotationCenterY = 1

For n = 1 To 5

sr.Add s.Duplicate

s.Rotate 60

Next n

sr.Add s

sr.ApplyUniformFill CreateRGBColor(255, 0, 0)

sr.RotationCenterX = ActivePage.SizeWidth / 2

sr.RotationCenterY = ActivePage.SizeHeight / 2

For n = 0 To 4

Set sr1 = sr.Duplicate

sr1.ApplyUniformFill CreateRGBColor(255, 255 * (1 - n / 5), 0)

sr.Rotate 60

Next n

End Sub

 Related Topics


ShapeRange.RotationCenterY

Property RotationCenterY As Double

ShapeRange

Description

The RotationCenterY returns or sets the vertical coordinate for the center of rotation of a range of shapes.

See also the SetRotationCenter method.

Example

The following example creates a "flower" by duplicating circles. It then creates a larger flower by duplicating this group of six circles five more times to form six petals of different colors.

Sub Test()

Dim n As Long

Dim sr As New ShapeRange, sr1 As ShapeRange

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(0, 0, 0.5)

s.RotationCenterX = 1

s.RotationCenterY = 1

For n = 1 To 5

sr.Add s.Duplicate

s.Rotate 60

Next n

sr.Add s

sr.ApplyUniformFill CreateRGBColor(255, 0, 0)

sr.RotationCenterX = ActivePage.SizeWidth / 2

sr.RotationCenterY = ActivePage.SizeHeight / 2

For n = 0 To 4

Set sr1 = sr.Duplicate

sr1.ApplyUniformFill CreateRGBColor(255, 255 * (1 - n / 5), 0)

sr.Rotate 60

Next n

End Sub

 Related Topics


ShapeRange.SizeHeight

Property SizeHeight As Double

ShapeRange

Description

The SizeHeight property returns or sets the vertical size of the shapes in the range, treating the group of shapes as though it was a single object.

See also the GetSize, SetSize, SetSizeEx, GetBoundingBox, and SetBoundingBox methods.

Example

The following example stretches all shapes on the active layer so that the range of shapes is 2" high.

Sub Test()

ActiveLayer.Shapes.All.SizeHeight = 2

End Sub

 Related Topics


ShapeRange.SizeWidth

Property SizeWidth As Double

ShapeRange

Description

The SizeWidth property returns or sets the horizontal size of the shapes in the range, treating the group of shapes as though it was a single object.

See also the GetSize, SetSize, SetSizeEx, GetBoundingBox, and SetBoundingBox methods.

Example

The following example stretches all shapes on the active layer so that the range of shapes is 2" wide.

Sub Test()

ActiveLayer.Shapes.All.SizeWidth = 2

End Sub

 Related Topics


ShapeRange.Add

Sub Add(ByVal Shape As Shape)

ShapeRange

Description

The Add method adds a specified shape to a range.

Parameters	Description

Shape	Specifies the shape object to be added [in]

Example

The following example creates a registration mark consisting of a circle and two lines, groups the objects, and moves them to the center of the page.

Sub Test()

Dim sGroup As Shape

Dim sr As New ShapeRange

sr.Add ActiveLayer.CreateEllipse2(0, 0, 0.25)

sr.Add ActiveLayer.CreateLineSegment(-0.5, 0, 0.5, 0)

sr.Add ActiveLayer.CreateLineSegment(0, -0.5, 0, 0.5)

sr.SetOutlineProperties 0.03

Set sGroup = sr.Group

sGroup.Move ActivePage.SizeWidth / 2, ActivePage.SizeHeight / 2

End Sub

 Related Topics


ShapeRange.AddRange

Sub AddRange(ByVal ShapeRange As ShapeRange)

ShapeRange

Description

The AddRange method adds a specified range of shapes to the current range.

Parameters	Description

ShapeRange	Specifies the range that is added to the current range. [in]

Example

The following example finds all ellipses and rectangles on a page, and fills the shapes with a radial fountain fill.

Sub Test()

Dim sr As ShapeRange

Set sr = ActivePage.FindShapes(Type:=cdrEllipseShape)

sr.AddRange ActivePage.FindShapes(Type:=cdrRectangleShape)

sr.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(255, 255, 0), cdrRadialFountainFill

End Sub

 Related Topics


ShapeRange.AddToPowerClip

Sub AddToPowerClip(ByVal Shape As Shape)

ShapeRange

Description

The AddToPowerClip method adds the range of shapes to the specified PowerClip container.

Parameters	Description

Shape	Identifies the range that is added to the PowerClip. [in]

Example

The following example places 150 randomly sized and colored circles inside a text object.

Sub Test()

Dim sr As New ShapeRange

Dim s As Shape, n As Long

For n = 1 To 150

Set s = ActiveLayer.CreateEllipse2(Rnd() * 4, Rnd() * 2, Rnd() * 0.3)

s.Fill.UniformColor.RGBAssign Rnd() * 256, Rnd() * 256, Rnd() * 256

sr.Add s

Next n

Set s = ActiveLayer.CreateArtisticText(0, 0, "Clip")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 150

End With

sr.AddToPowerClip s

End Sub

 Related Topics


ShapeRange.AddToSelection

Sub AddToSelection()

ShapeRange

Description

The AddToSelection method adds all the shapes from the range to the current selection.

See also the CreateSelection and RemoveFromSelection methods

Example

The following example selects all ellipses and rectangles on the current page.

Sub Test()

ActivePage.FindShapes(Type:=cdrEllipseShape).CreateSelection

ActivePage.FindShapes(Type:=cdrRectangleShape).AddToSelection

End Sub

 Related Topics


ShapeRange.ApplyFountainFill

Sub ApplyFountainFill([ByVal StartColor As Color = Nothing], [ByVal EndColor As Color = Nothing], [ByVal Type As cdrFountainFillType = cdrLinearFountainFill (1)], [ByVal Angle As Double = 0], [ByVal Steps As Long = 0], [ByVal EdgePad As Long = 0], [ByVal MidPoint As Long = 50], [ByVal BlendType As cdrFountainFillBlendType = cdrDirectFountainFillBlend (0)])

ShapeRange

Description

The ApplyFountainFill method applies the specified fountain fill to all objects in the range.

Parameters	Description

StartColor	Specifes the color that appears at the beginning of a fountain fill [in]
Optional
Default value = Nothing

EndColor	Specifies the color that appears at the end of a fountain fill [in]
Optional
Default value = Nothing

Type	Specifies the type of fountain fill. The Type parameter returns cdrFountainFillType. [in]
Optional
Default value = cdrLinearFountainFill (1)

Angle	Specifies the degree of the angle in a linear, conical, or square fountain fill. Changing the angle of gradation affects the slant of the fountain fill. Positive values rotate the fill counterclockwise; negative values rotate it clockwise. [in]
Optional
Default value = 0

Steps	Specifies the number of bands (steps) used to display a fountain fill [in]
Optional
Default value = 0

EdgePad	Specifies the length of solid colors at the beginning and end of the fountain fill before they start blending with the next color in the fountain fill. You can change the edge pad of linear, radial, and square fountain fills. Higher values let the colors remain solid longer before blending, causing the colors to spread more quickly. Lower values result in a smooth transformation between the two colors. [in]
Optional
Default value = 0

MidPoint	Represents an imaginary line between two colors in a fountain fill. By changing this value, you can set the point at which two colors in a fountain fill converge. [in]
Optional
Default value = 50

BlendType	Specifies the type of blend for the fountain fill [in]
Optional
Default value = cdrDirectFountainFillBlend (0)

Example

The following example applies a conical fountain fill to each text shape on the page.

Sub Test()

Dim sr As ShapeRange

Set sr = ActivePage.FindShapes(Type:=cdrTextShape)

sr.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(255, 255, 0), cdrConicalFountainFill, 45

End Sub

 Related Topics


ShapeRange.ApplyNoFill

Sub ApplyNoFill()

ShapeRange

Description

The ApplyNoFill method removes the fill from each shape in the range.

Example

The following example removes all fountain fills on the page.

Sub Test()

Dim sr As New ShapeRange

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrFountainFill Then sr.Add s

Next s

sr.ApplyNoFill

End Sub

 Related Topics


ShapeRange.ApplyPatternFill

Sub ApplyPatternFill(ByVal Type As cdrPatternFillType, [ByVal FileName As String], [ByVal PatternCanvasIndex As Long = 1], [ByVal FrontColor As Color = Nothing], [ByVal EndColor As Color = Nothing], [ByVal TransformWithShape As Boolean = False])

ShapeRange

Description

The ApplyPatternFill method applies the specified pattern fill to all objects in the range.

Parameters	Description

Type	Specifies the type of pattern fill and returns a value of cdrPatternFillType [in]

FileName	Identifies the full path name of the graphic that is imported for use as a pattern fill. A file name contains the computer's path and the name of the graphic file. [in]
Optional

PatternCanvasIndex	Identifies the pattern canvas in a pattern fill. Each canvas has an index number that uniquely identifies the canvas. [in]
Optional
Default value = 1

FrontColor	Identifies the foreground color in a pattern fill [in]
Optional
Default value = Nothing

EndColor	Identifies the background color in a pattern fill [in]
Optional
Default value = Nothing

TransformWithShape	Determines whether the pattern fill changes to fit its shape when the shape object is altered. If the value is True, the pattern fill will change according to changes in its shape object. [in]
Optional
Default value = False

Example

The following example applies a two-color pattern fill and an outline to each text shape on the page.

Sub Test()

Dim sr As ShapeRange

Set sr = ActivePage.FindShapes(Type:=cdrTextShape)

sr.ApplyPatternFill cdrTwoColorPattern, , 4, CreateRGBColor(255, 0, 0)

sr.SetOutlineProperties 0.05

End Sub

 Related Topics


ShapeRange.ApplyPostscriptFill

Sub ApplyPostscriptFill(ByVal IndexOrName As Variant)

ShapeRange

Description

The ApplyPostscriptFill method applies the specified PostScript fill to all objects in the range.

Parameters	Description

IndexOrName	Specifies the fill by its index number or name [in]

Example

The following example applies a PostScript fill to each text shape on the page.

Sub Test()

Dim sr As ShapeRange

Set sr = ActivePage.FindShapes(Type:=cdrTextShape)

sr.ApplyPostscriptFill "Bricks"

End Sub

 Related Topics


ShapeRange.ApplyTextureFill

Sub ApplyTextureFill(ByVal TextureName As String, [ByVal LibraryName As String])

ShapeRange

Description

The ApplyTextureFill method applies the specified texture fill effect to all objects in the range.

Parameters	Description

TextureName	Specifies the texture fill pattern [in]

LibraryName	Specifies the texture fill library for the texture fill pattern [in]
Optional

Example

The following example applies a texture fill to each shape that has an Overprint fill.

Sub Test()

Dim sr As New ShapeRange

Dim s As Shape

For Each s In ActivePage.Shapes

If s.OverprintFill Then sr.Add s

Next s

sr.ApplyTextureFill "Cement", "Samples 8"

End Sub

 Related Topics


ShapeRange.ApplyUniformFill

Sub ApplyUniformFill(ByVal Color As Color)

ShapeRange

Description

The ApplyUniformFill method applies a uniform fill color to all objects in the range.

Parameters	Description

Color	Specifies a color to be applied as a uniform color. It uses an existing color component in a palette a CreateColor method (for example, CreateCMYKColor, CreateRGBColor, and so on) to specify a color. A color in a palette is identified by referencing the palette and the index of the color in the palette. For example, ActivePalette.Colors(50), references the fiftieth color in the active palette. [in]

Example

The following example applies the color 50% PANTONE 875 CVU from the Metallic colors palette. The color is applied to each shape with an Overprint fill.

Sub Test()

Dim sr As New ShapeRange

Dim s As Shape

For Each s In ActivePage.Shapes

If s.OverprintFill Then sr.Add s

Next s

sr.ApplyUniformFill CreateFixedColor(cdrPANTONEMetallic, 5, 50)

End Sub

 Related Topics


ShapeRange.ClearEffect

Sub ClearEffect(ByVal Type As cdrEffectType)

ShapeRange

Description

The ClearEffect method removes effects from the shapes in the ShapeRange.

Parameters	Description

Type	Specifies the type of effect to remove [in]

Example

The following example removes the contour effect from all rectangles.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(2, 2, 4, 4)

s.Fill.ApplyUniformFill CreateRGBColor(255, 0, 0)

s.CreateContour cdrContourOutside

Set s = ActiveLayer.CreateRectangle2(1, 4, 5, 5)

s.Fill.ApplyUniformFill CreateRGBColor(0, 255, 0)

s.CreateContour cdrContourInside

ActivePage.FindShapes(, cdrRectangleShape).CreateSelection

ActiveSelection.ClearEffect cdrContour

End Sub

 Related Topics


ShapeRange.Clone

Function Clone([ByVal OffsetX As Double = 0], [ByVal OffsetY As Double = 0]) As ShapeRange

ShapeRange

Description

The Clone method clones each shape in a range and returns a new shape range containing all the clones.

Parameters	Description

OffsetX	Specifies the horizontal distance to offset the cloned shape range [in]
Optional
Default value = 0

OffsetY	Specifies the vertical distance to offset the cloned shape range [in]
Optional
Default value = 0

Return value

Returns ShapeRange

Example

The following example creates two rectangles and clones them.

Sub Test()

Dim sr As New ShapeRange

Dim srClone As ShapeRange

sr.Add ActiveLayer.CreateRectangle(0, 0, 1, 1)

sr.Add ActiveLayer.CreateRectangle(2, 0, 3, 1)

sr.ApplyUniformFill CreateRGBColor(255, 0, 0)

Set srClone = sr.Clone(0, 2)

sr.ApplyUniformFill CreateRGBColor(0, 0, 255)

End Sub

 Related Topics


ShapeRange.Combine

Function Combine() As Shape

ShapeRange

Description

The Combine method combines all shapes in the range into a single curve.

Return value

Returns Shape

Example

The following example creates a single shape by combining a set of circles.

Sub Test()

Const Num As Long = 15

Dim sr As New ShapeRange

Dim s As Shape, n As Long

Set s = ActiveLayer.CreateEllipse2(4, 4, 1)

s.SetRotationCenter 4, 5

For n = 1 To Num - 1

sr.Add s.Duplicate

s.Rotate 360 / Num

Next n

sr.Add s

Set s = sr.Combine

s.Fill.UniformColor.RGBAssign 255, 0, 0

End Sub

 Related Topics


ShapeRange.ConvertOutlineToObject

Sub ConvertOutlineToObject()

ShapeRange

Description

The ConvertOutlineToObject method converts the outlines of each shape in the range to separate fillable objects.

Example

The following example converts the outline of each curve to a closed curve shape.

Sub Test()

Dim sr As ShapeRange

Dim n As Long

Set sr = ActivePage.FindShapes(Type:=cdrCurveShape)

For n = sr.Count To 1 Step -1

If sr(n).Outline.Type = cdrNoOutline Then sr.Remove n

Next n

sr.ConvertOutlineToObject

End Sub

 Related Topics


ShapeRange.ConvertToBitmap

Function ConvertToBitmap([ByVal BitDepth As Long = 24], [ByVal Grayscale As Boolean = False], [ByVal Dithered As Boolean = True], [ByVal TransparentBG As Boolean = True], [ByVal Resolution As Long = 72], [ByVal AntiAliasing As cdrAntiAliasingType = cdrNormalAntiAliasing (1)], [ByVal UseColorProfile As Boolean = True]) As Shape

ShapeRange

Description

The ConvertToBitmap method converts all objects in the range to bitmaps.

This method is obsolete and provided for backward compatibility only. It is recommended that you use the ConvertToBitmapEx method instead.

Parameters	Description

BitDepth	Specifies the bit depth [in]
Optional
Default value = 24

Grayscale	Converts to grayscale if set to True (-1) [in]
Optional
Default value = False

Dithered	Enables dithering if set to True (-1) [in]
Optional
Default value = True

TransparentBG	Sets the background to transparent if set to True (-1) [in]
Optional
Default value = True

Resolution	Lets you specify the resolution [in]
Optional
Default value = 72

AntiAliasing	Lets you specify the type of anti-aliasing.This value returns cdrAntiAliasingType. [in]
Optional
Default value = cdrNormalAntiAliasing (1)

UseColorProfile	Uses the color profile if set to True (-1) [in]
Optional
Default value = True

Return value

Returns Shape

Example

The following example converts the selected shape or shapes to grayscale bitmaps with a transparent background.

Sub Test()

ActiveSelectionRange.ConvertToBitmapEx cdrGrayscaleImage, False, True

End Sub

 Related Topics


ShapeRange.ConvertToBitmapEx

Function ConvertToBitmapEx([ByVal Mode As cdrImageType = cdrRGBColorImage (4)], [ByVal Dithered As Boolean = False], [ByVal Transparent As Boolean = False], [ByVal Resolution As Long = 72], [ByVal AntiAliasing As cdrAntiAliasingType = cdrNormalAntiAliasing (1)], [ByVal UseColorProfile As Boolean = True]) As Shape

ShapeRange

Description

The ConvertToBitmapEx method converts all objects in a range to bitmaps.

Parameters	Description

Mode	Specifies the type of image, and returns cdrImageType [in]
Optional
Default value = cdrRGBColorImage (4)

Dithered	Specifies whether the image is dithered when exported [in]
Optional
Default value = False

Transparent	Specifies the transparency of the background [in]
Optional
Default value = False

Resolution	Specifies the resolution [in]
Optional
Default value = 72

AntiAliasing	Specifies the type of anti-aliasing.This value returns cdrAntiAliasingType. [in]
Optional
Default value = cdrNormalAntiAliasing (1)

UseColorProfile	Uses the color profile if set to True (-1) [in]
Optional
Default value = True

Return value

Returns Shape

Example

The following example converts the selected shape or shapes to a grayscale bitmap with a transparent background.

Sub Test()

ActiveSelectionRange.ConvertToBitmapEx cdrGrayscaleImage, False, True

End Sub

 Related Topics


ShapeRange.ConvertToCurves

Sub ConvertToCurves()

ShapeRange

Description

The ConvertToCurves method converts each shape in the range to a curve.

Example

The following example converts all artistic text objects to curves.

Sub Test()

Dim sr As ShapeRange

Set sr = ActivePage.FindShapes(Type:=cdrTextShape)

sr.ConvertToCurves

End Sub

 Related Topics


ShapeRange.Copy

Sub Copy()

ShapeRange

Description

The Copy method copies all the shapes in the range to the clipboard.

Example

The following example copies, page by page, all shapes from the current document into a new document.

Sub Test()

Dim p1 As Page, p2 As Page, bAddPage As Boolean

Dim doc1 As Document, doc2 As Document

Set doc1 = ActiveDocument

Set doc2 = CreateDocument()

bAddPage = False

Set p2 = doc2.Pages(1)

For Each p1 In doc1.Pages

p1.Activate

p1.Shapes.All.Copy

If bAddPage Then Set p2 = doc2.AddPages(1)

p2.ActiveLayer.Paste

bAddPage = True

Next p1

End Sub

 Related Topics


ShapeRange.CreateSelection

Sub CreateSelection()

ShapeRange

Description

The CreateSelection method creates a selection from the shapes in a range.

Unlike the AddToSelection method, the CreateSelection method destroys any previous selection.

Example

The following example selects all ellipses on the current page.

Sub Test()

ActivePage.FindShapes(Type:=cdrEllipseShape).CreateSelection

End Sub

 Related Topics


ShapeRange.Cut

Sub Cut()

ShapeRange

Description

The Cut method copies all the shapes in the range to the clipboard and deletes the copied shapes from the document.

Example

The following example creates a rectangle and an ellipse on the active page. It then adds a new page, cuts the shapes from the first page, and pastes them in the new page.

Sub Test()

Dim p1 As Page, p2 As Page

Dim s As Shape

Dim doc As Document

Set doc = ActiveDocument

Set s = doc.ActiveLayer.CreateRectangle(2, 2, 4, 4)

Set s = doc.ActiveLayer.CreateEllipse(1, 2, 3, 4)

For Each p1 In doc.Pages

p1.Activate

p1.Shapes.All.Cut

Set p2 = doc.AddPages(1)

p2.ActiveLayer.Paste

Next p1

End Sub

 Related Topics


ShapeRange.Delete

Sub Delete()

ShapeRange

Description

The Delete method deletes all the shapes in the range and empties the range object. The shapes are deleted from the document.

Example

The following example deletes all shapes from the active page.

Sub Test()

ActivePage.Shapes.All.Delete

End Sub

 Related Topics


ShapeRange.DeleteItem

Sub DeleteItem(ByVal Index As Long)

ShapeRange

Description

The DeleteItem method removes the specified shape from a ShapeRange object and deletes it from the document.

Parameters	Description

Index	Specifies the shape by its index number [in]

Example

The following example deletes the first shape from the shape range.

Sub Test()

Dim s As Shape

Dim sr As ShapeRange

Set s = ActiveLayer.CreateRectangle(2, 2, 4, 4)

s.Fill.ApplyUniformFill CreateRGBColor(255, 0, 0)

Set s = ActiveLayer.CreateRectangle2(1, 4, 5, 5)

s.Fill.ApplyUniformFill CreateRGBColor(0, 255, 0)

Set s = ActiveLayer.CreatePolygon(1, 2, 3, 4, 6)

Set sr = ActivePage.FindShapes(, cdrRectangleShape)

sr.DeleteItem 1

End Sub

 Related Topics


ShapeRange.Duplicate

Function Duplicate([ByVal OffsetX As Double = 0], [ByVal OffsetY As Double = 0]) As ShapeRange

ShapeRange

Description

The Duplicate method duplicates each shape in the range, and returns another shape range collection containing all the duplicates.

Parameters	Description

OffsetX	Specifies the horizontal distance to offset the duplicated shape range [in]
Optional
Default value = 0

OffsetY	Specifies the vertical distance to offset the duplicated shape range [in]
Optional
Default value = 0

Return value

Returns ShapeRange

Example

The following example duplicates each curve shape, removes any fills in the range, assigns a thick outline to each duplicate, and groups all the duplicated curves.

Sub Test()

Dim sr As ShapeRange

Set sr = ActiveLayer.FindShapes(, cdrCurveShape)

Set sr = sr.Duplicate

sr.ApplyNoFill

sr.SetOutlineProperties 0.1

sr.Group

End Sub

 Related Topics


ShapeRange.Flip

Sub Flip(ByVal Axes As cdrFlipAxes)

ShapeRange

Description

The Flip method flips all shapes in the range. Shapes can be flipped horizontally, vertically, or in both directions.

Parameters	Description

Axes	Sets the manner of the flip. This value returns cdrFlipAxes. [in]

Example

The following example flips all the shapes on the active page. They are flipped upside down.

Sub Test()

ActivePage.Shapes.All.Flip cdrFlipHorizontal + cdrFlipVertical

End Sub

 Related Topics


ShapeRange.GetBoundingBox

Sub GetBoundingBox(ByRef X As Double, ByRef Y As Double, ByRef Width As Double, ByRef Height As Double, [ByVal UseOutline As Boolean = False])

ShapeRange

Description

The GetBoundingBox method returns the position of the lower left corner of all objects in the range, treating the group of shapes as though it was a single object. It also returns the total size of all objects in the range.

If the UseOutline parameter is True, any outlines of shapes are taken into account when calculating the dimensions of the bounding box. Otherwise, the shapes are treated as if they had no outline.

See also the PositionX, PositionY, SizeWidth, and SizeHeight properties, as well as the GetPosition, SetPosition, GetSize, SetSize, SetSizeEx, and Move methods.

Parameters	Description

X	Returns the horizontal coordinate of the lower left corner [out]

Y	Returns the vertical coordinate of the lower left corner [out]

Width	Returns the width of all objects [out]

Height	Returns the height of all objects [out]

UseOutline	Specifies whether outlines are considered when calculating the size of the bounding box [in]
Optional
Default value = False

Example

The following example creates a rectangle that surrounds an ellipse.

Sub Test()

Dim s As Shape

Dim sr As ShapeRange

Dim x As Double, y As Double, w As Double, h As Double

Set s = ActiveLayer.CreateEllipse(1, 2, 3, 4)

ActiveDocument.ReferencePoint = cdrCenter

Set sr = ActivePage.Shapes.All

sr.GetBoundingBox x, y, w, h

ActiveLayer.CreateRectangle2 x, y, w, y

End Sub

 Related Topics


ShapeRange.GetPosition

Sub GetPosition(ByRef PositionX As Double, ByRef PositionY As Double)

ShapeRange

Description

The GetPosition method retrieves both the horizontal and vertical positions of all the shapes in the range, treating the group of shapes as though it was a single object.

The position of the range is set relative to the reference point specified by the Document.ReferencePoint property.

Parameters	Description

PositionX	Returns the horizontal position of the shape range, in document units [out]

PositionY	Returns the vertical position of the shape range, in document units [out]

Example

The following example creates an ellipse with the dimensions of the active selection range.

Sub Test()

Dim x As Double, y As Double

ActiveDocument.ReferencePoint = cdrCenter

ActiveSelectionRange.GetPosition x, y

ActiveLayer.CreateEllipse2 x, y, 0.05

End Sub

 Related Topics


ShapeRange.GetSize

Sub GetSize(ByRef Width As Double, ByRef Height As Double)

ShapeRange

Description

The GetSize method retrieves the size of the shapes in the range, treating the group of shapes as though it was a single object.

See also the SizeWidth and SizeHeight properties, as well as the GetBoundingBox and SetBoundingBox methods.

Parameters	Description

Width	Returns the width of the shape range, in document units [out]

Height	Returns the height of the shape range, in document units [out]

Example

The following example stretches all shapes on the active layer so that the vertical size of each shape is one.

Sub Test()

Dim x As Double, y As Double

Dim sr As ShapeRange

Set sr = ActiveLayer.Shapes.All

If sr.Count > 0 Then

ActiveDocument.ReferencePoint = cdrCenter

sr.GetSize x, y

sr.SetSize x, 1

End If

End Sub

 Related Topics


ShapeRange.Group

Function Group() As Shape

ShapeRange

Description

The Group method groups all the shapes in the range and returns a Shape object as the reference to the group.

Return value

Returns Shape

Example

The following example creates a jigsaw puzzle.

Sub Test()

Dim s As Shape, sp As SubPath, sbmp As Shape

Dim sr As New ShapeRange, n As Long

Dim x As Double, y As Double, sx As Double, sy As Double

Set s = ActiveLayer.CreateCurve

Set sp = s.Curve.CreateSubPath(1.351, 8.545)

sp.AppendCurveSegment False, 1.351, 8.926, 0.127, 89.901, 0.127, -64.56

sp.AppendCurveSegment False, 1.156, 8.952, 0.066, 115.44, 0.066, -48.906

sp.AppendCurveSegment False, 1.156, 9.15, 0.065, 131.09, 0.065, -133.149

sp.AppendCurveSegment False, 1.351, 9.163, 0.065, 46.846, 0.065, -116.315

sp.AppendCurveSegment False, 1.351, 9.545, 0.127, 63.683, 0.127, -89.902

sp.AppendCurveSegment False, 0.976, 9.545, 0.125, 179.951, 0.125, 25.612

sp.AppendCurveSegment False, 0.96, 9.342, 0.063, -154.391, 0.063, 40.943

sp.AppendCurveSegment False, 0.767, 9.339, 0.067, -139.06, 0.067, -41.987

sp.AppendCurveSegment False, 0.752, 9.547, 0.063, 138.014, 0.065, -33.906

sp.AppendCurveSegment False, 0.351, 9.545, 0.134, 146.087, 0.134, 0.045

sp.AppendCurveSegment False, 0.351, 9.163, 0.127, -90#, 0.127, 63.681

sp.AppendCurveSegment False, 0.156, 9.15, 0.065, -116.317, 0.065, 46.846

sp.AppendCurveSegment False, 0.156, 8.952, 0.065, -133.152, 0.065, 131.093

sp.AppendCurveSegment False, 0.351, 8.926, 0.066, -48.906, 0.066, 115.439

sp.AppendCurveSegment False, 0.351, 8.545, 0.127, -64.561, 0.127, 90#

sp.AppendCurveSegment False, 0.752, 8.547, 0.134, 0.002, 0.134, 146.087

sp.AppendCurveSegment False, 0.767, 8.339, 0.065, -33.908, 0.063, 138.012

sp.AppendCurveSegment False, 0.96, 8.342, 0.067, -41.987, 0.067, -139.058

sp.AppendCurveSegment False, 0.976, 8.545, 0.063, 40.943, 0.063, -154.388

sp.AppendCurveSegment False, 1.351, 8.545, 0.125, 25.613, 0.125, 179.998

sp.Closed = True

For n = 1 To 7

sr.Add s.Duplicate

s.Move 1, 0

Next n

sr.Add s

sr.AddRange sr.Duplicate(0, -1)

sr.AddRange sr.Duplicate(0, -2)

Set s = sr.Group

s.GetBoundingBox x, y, sx, sy

Set sbmp = ActiveLayer.CreateRectangle2(x, y, sx, sy)

sbmp.Fill.ApplyTextureFill "Gouache wash", "Samples"

Set sbmp = sbmp.ConvertToBitmapEx(cdrRGBColorImage, , , 120)

sbmp.AddToPowerClip s

s.Ungroup

For Each s In sr

s.Move (Rnd() - 0.5) * 0.25, (Rnd() - 0.5) * 0.25

Next s

End Sub

 Related Topics


ShapeRange.IndexOf

Function IndexOf(ByVal Shape As Shape) As Long

ShapeRange

Description

The IndexOf property returns the index number of the specified shape in the range. If the shape is not in the range, 0 is returned.

Parameters	Description

Shape	Specifies a shape in the range [in]

Return value

Returns Long

Example

The following example determines whether the selected shape is a curve residing on the active layer of the document.

Sub Test()

Dim sr As ShapeRange

Set sr = ActiveLayer.FindShapes(, cdrCurveShape)

If sr.IndexOf(ActiveShape) = 0 Then

MsgBox "The selected shape is not a curve residing on the current layer"

End If

End Sub

 Related Topics


ShapeRange.Move

Sub Move(ByVal DeltaX As Double, ByVal DeltaY As Double)

ShapeRange

Description

The Move method moves all shapes in the range. You specify the offset.

Parameters	Description

DeltaX	Specifies the horizontal distance to move a range of shapes [in]

DeltaY	Specifies the vertical distance to move a range of shapes [in]

Example

The following example moves all shapes on the active page by 2" to the right.

Sub Test()

ActivePage.Shapes.All.Move 2, 0

End Sub

 Related Topics


ShapeRange.OrderBackOf

Sub OrderBackOf(ByVal Shape As Shape)

ShapeRange

Description

The OrderBackOf method moves all the shapes in the range. The shapes are moved behind the the specified shape in the stacking order of the current layer.

Parameters	Description

Shape	Specifies the Shape object that will have another shape placed behind it [in]

Example

The following example creates a set of circles behind the outline of the selected curve.

Sub Test()

Dim s As Shape, sr As New ShapeRange

Dim crv As Shape, sp As SubPath, lr As Layer

Dim x As Double, y As Double, i As Long

Set crv = ActiveShape

If crv.Type <> cdrCurveShape Then

MsgBox "Please select a curve"

Exit Sub

End If

Set sp = crv.Curve.Subpaths(1)

Set lr = crv.Layer

For i = 0 To 10

sp.GetPointPositionAt i / 10, cdrRelativeSegmentOffset, x, y

Set s = lr.CreateEllipse2(x, y, 0.3)

s.Fill.UniformColor.RGBAssign 255, 255, 0

sr.Add s

Next i

sr.OrderBackOf crv

End Sub

 Related Topics


ShapeRange.OrderBackOne

Sub OrderBackOne()

ShapeRange

Description

The OrderBackOne method moves all the shapes in the range. The shapes are moved one step backward in the stacking order of the current layer.

Example

The following example creates a shadow for each selected object by duplicating the objects, offsets the duplicates by a small distance, and fills the duplicates with gray.

Sub Test()

Dim srOld As ShapeRange, srNew As ShapeRange

Set srOld = ActiveSelectionRange

If srOld.Count <> 0 Then

Set srNew = srOld.Duplicate(0.05, -0.05)

srNew.ApplyUniformFill CreateRGBColor(50, 50, 50)

srNew.OrderBackOne

End If

End Sub

 Related Topics


ShapeRange.OrderForwardOne

Sub OrderForwardOne()

ShapeRange

Description

The OrderForwardOne method moves all the shapes in the range. The shapes are moved one step forward in the stacking order of the current layer.

 Related Topics


ShapeRange.OrderFrontOf

Sub OrderFrontOf(ByVal Shape As Shape)

ShapeRange

Description

The OrderFrontOf method moves all the shapes in the range. The shapes are moved in front of the the specified shape in the stacking order of the current layer.

Parameters	Description

Shape	Specifies the Shape object that will have another shape placed in front of it [in]

 Related Topics


ShapeRange.OrderReverse

Sub OrderReverse()

ShapeRange

Description

The OrderReverse method reverses the stacking order of shapes in a range.

Example

The following example reverses the order of the selected shapes in the active document.

Sub Test()

ActiveSelectionRange.OrderReverse

End Sub

 Related Topics


ShapeRange.OrderToBack

Sub OrderToBack()

ShapeRange

Description

The OrderToBack method moves the range of shapes to the back of the stacking order of the current layer.

Example

The following example creates four rectangles and places them in front all the other shapes of the current layer.

Sub Test()

Dim s As Shape, sr As New ShapeRange

Dim w As Double, h As Double

Dim c1 As New Color, c2 As New Color

w = ActivePage.SizeWidth / 2

h = ActivePage.SizeHeight / 2

c1.RGBAssign 255, 0, 0

c2.RGBAssign 255, 255, 255

Set s = ActiveLayer.CreateRectangle2(0, 0, w, h)

s.Fill.ApplyFountainFill c1, c2, , 45

sr.Add s

Set s = ActiveLayer.CreateRectangle2(w, 0, w, h)

s.Fill.ApplyFountainFill c1, c2, , 135

sr.Add s

Set s = ActiveLayer.CreateRectangle2(0, h, w, h)

s.Fill.ApplyFountainFill c1, c2, , -45

sr.Add s

Set s = ActiveLayer.CreateRectangle2(w, h, w, h)

s.Fill.ApplyFountainFill c1, c2, , -135

sr.Add s

sr.OrderToBack

End Sub

 Related Topics


ShapeRange.OrderToFront

Sub OrderToFront()

ShapeRange

Description

The OrderToFront method moves the range of shapes to the front of the stacking order of the current layer.

 Related Topics


ShapeRange.Remove

Sub Remove(ByVal Index As Long)

ShapeRange

Description

The Remove method removes a specified shape from the range.

The shape is removed only from a specific range object and not from any other ranges of which it may be a part.

The shape is not deleted from the document.

Parameters	Description

Index	Represents the index number of the shape to be removed from the range [in]

Example

The following example moves the selected rectangles by 1" to the right. Any other selected shapes that are not rectangles are not moved.

Sub Test()

Dim sr As ShapeRange

Dim i As Long

Set sr = ActiveSelectionRange

For i = sr.Count To 1 Step -1

If sr(i).Type <> cdrRectangleShape Then sr.Remove i

Next i

sr.Move 1, 0

End Sub

 Related Topics


ShapeRange.RemoveAll

Sub RemoveAll()

ShapeRange

Description

The RemoveAll method removes all shapes from the range.

The shapes are removed only from a specific range object and not from any other ranges of which it may be a part.

The shapes are not deleted from the document.

Example

The following example creates ten circles and randomly places them on a page. It fills them with red and groups them. It then creates 10 more rectangles, fills them with yellow, and groups them.

Sub Test()

Dim sr As New ShapeRange

Dim n As Long

For n = 1 To 10

sr.Add ActiveLayer.CreateEllipse2(Rnd() * 8, Rnd() * 11, 0.5)

Next n

sr.ApplyUniformFill CreateRGBColor(255, 0, 0)

sr.Group

sr.RemoveAll

For n = 1 To 10

sr.Add ActiveLayer.CreateRectangle2(Rnd() * 8, Rnd() * 11, 1, 1)

Next n

sr.ApplyUniformFill CreateRGBColor(255, 255, 0)

sr.Group

End Sub

 Related Topics


ShapeRange.RemoveFromContainer

Sub RemoveFromContainer([ByVal Level As Long = 0])

ShapeRange

Description

The RemoveFromContainer method removes all the shapes in the range from their PowerClip container.

If there are several nested PowerClips, you can remove the shapes from several containers at one time by specifying the Level parameter value

Parameters	Description

Level	Specifies the lowest level from which you want to remove a shape. The shape is removed from this level and all levels above it. [in]
Optional
Default value = 0

Example

The following example removes all shapes from their PowerClip containers.

Sub Test()

Dim s As Shape

Dim p As PowerClip

On Error Resume Next

For Each s In ActivePage.Shapes

Set p = Nothing

Set p = s.PowerClip

If Not p Is Nothing Then

ActiveDocument.ClearSelection

p.Shapes.All.RemoveFromContainer

End If

Next s

End Sub

 Related Topics


ShapeRange.RemoveFromSelection

Sub RemoveFromSelection()

ShapeRange

Description

The RemoveFromSelection method deselects any shape in the specified range.

Example

The following example removes all rectangles from the current selection.

Sub Test()

ActivePage.FindShapes(Type:=cdrRectangleShape).RemoveFromSelection

End Sub

 Related Topics


ShapeRange.RemoveRange

Sub RemoveRange(ByVal Range As ShapeRange)

ShapeRange

Description

The RemoveRange method removes a range of shapes from the ShapeRange.

Parameters	Description

Range	Specifies the range to be removed [in]

Example

The following example creates two ShapeRange objects and removes the rectangle shapes from the entire collection of shapes.

Sub Test()

Dim s As Shape

Dim sr As ShapeRange, sr2 As ShapeRange, sr3 As ShapeRange

Set s = ActiveLayer.CreateRectangle(2, 2, 4, 4)

s.Fill.ApplyUniformFill CreateRGBColor(255, 0, 0)

Set s = ActiveLayer.CreateRectangle2(1, 4, 5, 5)

s.Fill.ApplyUniformFill CreateRGBColor(0, 255, 0)

Set s = ActiveLayer.CreatePolygon(1, 2, 3, 4, 6)

Set sr = ActivePage.FindShapes(, cdrRectangleShape)

Set sr2 = ActivePage.FindShapes(, cdrPolygonShape)

Set sr3 = ActivePage.FindShapes(, cdrNoShape, True)

sr3.RemoveRange sr

End Sub

 Related Topics


ShapeRange.RestoreCloneLink

Sub RestoreCloneLink(ByVal LinkToRestore As cdrCloneLinkType)

ShapeRange

Description

The RestoreCloneLink method restores clone links of the specified property for the shapes in the ShapeRange.

Parameters	Description

LinkToRestore	Specifies the link to be restored [in]

Example

The following example creates a ShapeRange, clones it, and fills the clone. The clone link is then restored.

Sub Test()

Dim s As Shape

Dim sr1 As ShapeRange

Dim sr2 As ShapeRange

Set s = ActiveLayer.CreateRectangle(2, 2, 4, 4)

s.Fill.ApplyUniformFill CreateRGBColor(255, 0, 0)

Set s = ActiveLayer.CreateRectangle2(1, 4, 5, 5)

s.Fill.ApplyUniformFill CreateRGBColor(0, 255, 0)

Set s = ActiveLayer.CreatePolygon(1, 2, 3, 4, 6)

Set sr = ActivePage.FindShapes(, cdrRectangleShape)

Set sr2 = sr.Clone

sr2.ApplyUniformFill CreateRGBColor(0, 0, 255)

sr2.RestoreCloneLink cdrCloneFill

End Sub

 Related Topics


ShapeRange.Rotate

Sub Rotate(ByVal Angle As Double)

ShapeRange

Description

The Rotate method rotates all the shapes in a range, treating the group as though it was a single object. The center of rotation is specified by the RotationCenterX and RotationCenterY properties, while RotateEx allows you to specify the center of rotation directly.

Parameters	Description

Angle	Specifies, in degrees, the amount to rotate a range of shapes [in]

Example

The following example creates a "flower" by duplicating circles. It then creates a larger flower by duplicating this group of six circles five more times to form six petals of different colors.

Sub Test()

Dim n As Long

Dim sr As New ShapeRange, sr1 As ShapeRange

Dim s As Shape

Set s = ActiveLayer.CreateEllipse2(0, 0, 0.5)

s.SetRotationCenter 1, 1

For n = 1 To 5

sr.Add s.Duplicate

s.Rotate 60

Next n

sr.Add s

sr.ApplyUniformFill CreateRGBColor(255, 0, 0)

sr.SetRotationCenter ActivePage.SizeWidth / 2, ActivePage.SizeHeight / 2

For n = 0 To 4

Set sr1 = sr.Duplicate

sr1.ApplyUniformFill CreateRGBColor(255, 255 * (1 - n / 5), 0)

sr.Rotate 60

Next n

End Sub

 Related Topics


ShapeRange.RotateEx

Sub RotateEx(ByVal Angle As Double, ByVal CenterX As Double, ByVal CenterY As Double)

ShapeRange

Description

The RotateEx method rotates all the shapes in a range, treating the group as though it was a single object. The range is rotated around a specified center of rotation.

Parameters	Description

Angle	Specifies the angle, in degrees, in which the range is rotated [in]

CenterX	Specifies the x-coordinate for the center of rotation [in]

CenterY	Specifies the y-coordinate for the center of rotation [in]

 Related Topics


ShapeRange.SetBoundingBox

Sub SetBoundingBox(ByVal X As Double, ByVal Y As Double, ByVal Width As Double, ByVal Height As Double, [ByVal KeepAspect As Boolean = False], [ByVal ReferencePoint As cdrReferencePoint = cdrCenter (9)])

ShapeRange

Description

The SetBoundingBox method moves and resizes the range so that it fits the specified bounding box.

See also the PositionX, PositionY, SizeWidth, and SizeHeight properties, as well as the GetPosition, SetPosition, GetSize, SetSize, SetSizeEx, and Move methods.

Parameters	Description

X	Sets the horizontal position of the center of the bounding box, in document units [in]

Y	Sets the vertical position of the center of the bounding box, in document units [in]

Width	Sets the width of the bounding box, in document units [in]

Height	Sets the height of the bounding box, in document units [in]

KeepAspect	Maintains the proportions of the bounding box relative to its contents [in]
Optional
Default value = False

ReferencePoint	Sets the reference point [in]
Optional
Default value = cdrCenter (9)

Example

The following example imports a specified file and places it inside the selected shape(s), while maintaining proportions.

Sub Test()

Dim x As Double, y As Double, sx As Double, sy As Double

Dim FileName As String, sr As ShapeRange

If Documents.Count = 0 Then

MsgBox "No document is open", vbCritical

Exit Sub

End If

Set sr = ActiveSelectionRange

If sr.Count = 0 Then

MsgBox "No shapes selected", vbCritical

Exit Sub

End If

sr.GetBoundingBox x, y, sx, sy

FileName = CorelScriptTools.GetFileBox("All Files(*.*)|*.*", "Select a file to import")

If FileName <> "" Then

ActiveLayer.Import FileName

Set sr = ActiveSelectionRange

If sr.Count > 0 Then

sr.SetBoundingBox x, y, sx, sy, True

End If

End If

End Sub

 Related Topics


ShapeRange.SetOutlineProperties

Sub SetOutlineProperties([ByVal Width As Double = -1], [ByVal Style As OutlineStyle = Nothing], [ByVal Color As Color = Nothing], [ByVal StartArrow As ArrowHead = Nothing], [ByVal EndArrow As ArrowHead = Nothing], [ByVal BehindFill As cdrTriState = cdrUndefined (-2)], [ByVal ScaleWithShape As cdrTriState = cdrUndefined (-2)], [ByVal LineCaps As cdrOutlineLineCaps = cdrOutlineUndefinedLineCaps (-1)], [ByVal LineJoin As cdrOutlineLineJoin = cdrOutlineUndefinedLineJoin (-1)], [ByVal NibAngle As Double = -9999], [ByVal NibStretch As Long = 0])

ShapeRange

Description

The SetOutlineProperties method sets the outline properties of each shape in the range.

Parameters	Description

Width	Specifies the width of an object's outline. An outline's width is measured in points. [in]
Optional
Default value = -1

Style	Specifies the outline style of an object's outline [in]
Optional
Default value = Nothing

Color	Specifies the color of an object's outline [in]
Optional
Default value = Nothing

StartArrow	Specifies the start arrow of an object's outline [in]
Optional
Default value = Nothing

EndArrow	Specifies the end arrow of an object's outline [in]
Optional
Default value = Nothing

BehindFill	Specifies whether an outline's fill is behind the outline [in]
Optional
Default value = cdrUndefined (-2)

ScaleWithShape	Specifies whether an object's outline maintains the size proportions of the object [in]
Optional
Default value = cdrUndefined (-2)

LineCaps	Specifies the endpoint style of an open path outline [in]
Optional
Default value = cdrOutlineUndefinedLineCaps (-1)

LineJoin	Specifies the appearance of lines that intersect each other in an outline. This value returns cdrOutlineLineJoin.
Optional
Default value = cdrOutlineUndefinedLineJoin (-1)

NibAngle	Specifies the orientation of the pen nib relative to the drawing surface for a calligraphic outline [in]
Optional
Default value = -9999

NibStretch	Specifies the thickness of the pen nib of a calligraphic outline [in]
Optional
Default value = 0

Example

The following example applies blue, dashed outlines with a width of 0.05 inch to all ellipses on the active page.

Sub Test()

Dim sr As ShapeRange

Set sr = ActivePage.FindShapes(, cdrEllipseShape)

sr.SetOutlineProperties 0.05, OutlineStyles(5), CreateRGBColor(0, 0, 255)

End Sub

 Related Topics


ShapeRange.SetPosition

Sub SetPosition(ByVal PositionX As Double, ByVal PositionY As Double)

ShapeRange

Description

The SetPosition method sets both the horizontal and vertical positions of all the shapes in the range, treating the group of shapes as though it was a single object.

The position of the range is set relative to a reference point specified by the Document.ReferencePoint property.

Parameters	Description

PositionX	Sets the horizontal position of the range, in document units [in]

PositionY	Sets the vertical position of the range, in document units [in]

Example

The following example aligns the selected shapes to the upper right corner of the page.

Sub Test()

ActiveDocument.ReferencePoint = cdrTopRight

ActiveSelectionRange.SetPosition ActivePage.SizeWidth, ActivePage.SizeHeight

End Sub

 Related Topics


ShapeRange.SetRotationCenter

Sub SetRotationCenter(ByVal X As Double, ByVal Y As Double)

ShapeRange

Description

The SetRotationCenter method sets both the horizontal and vertical coordinates of the center of rotation for the range.

See also the RotationCenterX and RotationCenterY properties.

Parameters	Description

X	Sets the horizontal coordinate of the center of rotation [in]

Y	Sets the vertical coordinate of the center of rotation [in]

Example

The following example rotates all rectangles by 45°. The rectangles are rotated relative to the center of the page.

Sub Test()

Dim sr As ShapeRange

Set sr = ActivePage.FindShapes(, cdrRectangleShape)

sr.SetRotationCenter ActivePage.SizeWidth / 2, ActivePage.SizeHeight / 2

sr.Rotate 45

End Sub

 Related Topics


ShapeRange.SetSize

Sub SetSize([ByVal Width As Double = 0], [ByVal Height As Double = 0])

ShapeRange

Description

The SetSize method sets the size of the shapes in the range, treating the group of shapes as though it was a single object. The reference point around which the range is stretched is specified by the Document.ReferencePoint property.

See also the SizeWidth and SizeHeight properties, as well as the GetBoundingBox and SetBoundingBox methods.

Parameters	Description

Width	Sets the width of the range, in document units [in]
Optional
Default value = 0

Height	Sets the height of the range, in document units [in]
Optional
Default value = 0

Example

The following example stretches all shapes on the active layer so that the vertical size of each shape is one.

Sub Test()

Dim x As Double, y As Double

Dim sr As ShapeRange

Set sr = ActiveLayer.Shapes.All

If sr.Count > 0 Then

ActiveDocument.ReferencePoint = cdrCenter

sr.GetPosition x, y

sr.SetSize x, 1

End If

End Sub

 Related Topics


ShapeRange.SetSizeEx

Sub SetSizeEx(ByVal CenterX As Double, ByVal CenterY As Double, [ByVal Width As Double = 0], [ByVal Height As Double = 0])

ShapeRange

Description

The SetSizeEx method sets the size of the shapes in the range, treating the group of shapes as though it was a single object. You can specify the reference point around which the range is stretched.

See also the SizeWidth and SizeHeight properties, as well as the GetBoundingBox and SetBoundingBox methods.

Parameters	Description

CenterX	Specifies the horizontal coordinate of the reference point [in]

CenterY	Specifies the vertical coordinate of the reference point [in]

Width	Specifies the horizontal size of the shape range after the stretch [in]
Optional
Default value = 0

Height	Specifies the vertical size of the shape range after the stretch [in]
Optional
Default value = 0

Example

The following example stretches the ShapeRange on the active layer proportionally, so that its width is 2 inches.

Sub Test()

Dim x As Double, y As Double

Dim sr As ShapeRange

Set sr = ActiveLayer.Shapes.All

If sr.Count > 0 Then

ActiveDocument.ReferencePoint = cdrCenter

sr.GetPosition x, y

sr.SetSizeEx x, y, 2

End If

End Sub

 Related Topics


ShapeRange.Skew

Sub Skew(ByVal AngleX As Double, ByVal AngleY As Double)

ShapeRange

Description

The Skew method skews the shapes in a range, treating the group of shapes as though it was a single object. The range is distorted relative to the reference point specified by the Document.ReferencePoint property, while SkewEx lets you specify the center of distortion directly.

Parameters	Description

AngleX	Specifies the degree in which to slant the shape range horizontally [in]

AngleY	Specifies the degree in which to slant the shape range vertically [in]

 Related Topics


ShapeRange.SkewEx

Sub SkewEx(ByVal AngleX As Double, ByVal AngleY As Double, ByVal CenterX As Double, ByVal CenterY As Double)

ShapeRange

Description

The SkewEx method skews the shapes in a range, treating the group of shapes as though it was a single object. The range is distorted relative to the specified center of distortion.

Parameters	Description

AngleX	Sets the horizontal angle, in degrees, in which the range is skewed [in]

AngleY	Sets the vertical angle, in degrees, in which the range is skewed [in]

CenterX	Sets the x-coordinate for the center of distortion [in]

CenterY	Sets the y-coordinate for the center of distortion [in]

 Related Topics


ShapeRange.Stretch

Sub Stretch(ByVal StretchX As Double, [ByVal StretchY As Double = 0], [ByVal StretchCharactersSize As Boolean = False])

ShapeRange

Description

ShapeRange

The Stretch method stretches the shapes in the range, treating the group of shapes as though it was a single object. The ShapeRange is distorted relative to the reference point specified by the Document.ReferencePoint property.

Parameters	Description

StretchX	Specifies the horizontal stretch factor [in]

StretchY	Specifies the vertical stretch factor. If this value is not specified, it is assigned the same value as the StretchX parameter, resulting in a proportional stretch. [in]
Optional
Default value = 0

StretchCharactersSize	[in]
Optional
Default value = False

Example

The following example proportionally stretches all shapes on the page by 200%. The position of the ShapeRange is relative to the upper right corner of the bounding box of the shape range.

Sub Test()

ActiveDocument.ReferencePoint = cdrTopRight

ActivePage.Shapes.All.Stretch 2

End Sub

 Related Topics


ShapeRange.StretchEx

Sub StretchEx(ByVal CenterX As Double, ByVal CenterY As Double, ByVal StretchX As Double, [ByVal StretchY As Double = 0], [ByVal StretchCharactersSize As Boolean = False])

ShapeRange

Description

The StretchEx method stretches the shapes in the range, treating the group of shapes as though it was a single object. The ShapeRange is distorted relative to a point that is specified as the center of distortion.

Parameters	Description

CenterX	Specifies the horizontal coordinate of the center of distortion [in]

CenterY	Specifies the vertical coordinate of the center of distortion [in]

StretchX	Specifies the horizontal stretch factor [in]

StretchY	Specifies the vertical stretch factor. If this value is not specified, it is assigned the same value as the StretchX parameter, resulting in a proportional stretch. [in]
Optional
Default value = 0

StretchCharactersSize	[in]
Optional
Default value = False

Example

The following example stretches all shapes on the page by 200%, using the center of the page as the center of the distortion.

Sub Test()

ActiveDocument.ReferencePoint = cdrBottomLeft

With ActivePage

.Shapes.All.StretchEx .CenterX, .CenterY, 2

End With

End Sub

 Related Topics


ShapeRange.UngroupAll

Sub UngroupAll()

ShapeRange

Description

The UngroupAll method ungroups all the groups in the range.

Example

The following example ungroups any groups on the active page.

Sub Test()

ActivePage.Shapes.All.UngroupAll

End Sub

 Related Topics


Shapes properties

Shapes     Legend

    Application
    Count
  Item
    Parent


Shapes methods

Shapes     Legend

   All
   AllExcluding
   FindShape
   FindShapes
   Range


Shapes

Class Shapes

Properties     Methods     Referenced By

The Shapes class represents a collection of shapes.

 Related Topics


Shapes.Application

Property Application As Application

Shapes

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Shapes.Count

Property Count As Long

Shapes

Description

The Count property returns the number of shapes in the Shapes collection.

Read-Only

Example

The following example displays the number of shape objects in the Shapes collection.

Sub ShapesCount()

With ActiveLayer.Shapes

MsgBox "There are " & .Count & " shapes in the Shapes collection."

End With

End Sub

 Related Topics


Shapes.Item

Property Item(ByVal IndexOrName As Variant) As Shape

Shapes

Description

The Item property returns the specified Shape.

The Item property is the default property and its reference may be omitted when referencing items in the collection. For example, Shapes.Item(2) is the same as Shapes(2) - they both reference the second shape in the Shapes collection.

Read-Only

Parameters	Description

IndexOrName	Specifies the shape by its index number or name [in]

Example

The following example removes any fill from the first shape object in the Shapes collection.

Sub ShapesItem()

ActiveLayer.Shapes.Item(1).Fill.ApplyNoFill

End Sub

 Related Topics


Shapes.Parent

Property Parent As Object

Shapes

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Shapes.All

Function All() As ShapeRange

Shapes

Description

The All method returns a or sets a ShapeRange object which contains all shapes from the collection.

Return value

Returns ShapeRange

Example

The following example selects all shapes in the Shapes collection with the All method, and applies a two-pattern fill to the shapes.

Sub ShapesAll()

ActiveLayer.Shapes.All.ApplyPatternFill cdrTwoColorPattern

End Sub

 Related Topics


Shapes.AllExcluding

Function AllExcluding(ByRef IndexArray() As Variant) As ShapeRange

Shapes

Description

The AllExcluding method returns a ShapeRange which contains all shapes, except for specified shapes, from the Shapes collection.

This function accepts a variable number of arguments. It also accepts arrays

Parameters	Description

IndexArray	Represents a range of index numbers that identify and group specific shapes [in]

Return value

Returns ShapeRange

Example

The following example deletes all of the shapes in the Shapes collection except the two shapes that were most recently created. There must be at least three shapes on the active layer in order to run this example.

Sub Test()

With ActiveLayer.Shapes

.AllExcluding(Array(1, 2)).Delete

MsgBox "There are " & .Count & " shapes in the Shapes collection."

End With

End Sub

 Related Topics


Shapes.FindShape

Function FindShape([ByVal Name As String], [ByVal Type As cdrShapeType = cdrNoShape (0)], [ByVal StaticID As Long = 0], [ByVal Recursive As Boolean = True], [ByVal Query As String]) As Shape

Shapes

Description

The FindShape method returns a shape based upon specified properties.

Parameters	Description

Name	Specifies a shape by its name [in]
Optional

Type	Specifies a shape by its type [in]
Optional
Default value = cdrNoShape (0)

StaticID	Specifies a value which represents a shape's unique ID [in]
Optional
Default value = 0

Recursive	Specifies whether to iterate through all the shapes [in]
Optional
Default value = True

Query	This parameter is reserved for future use. [in]
Optional

Return value

Returns Shape

Example

The following example finds a rectangle named "Frame" and selects it if it exists.

Sub Test()

Dim s As Shape

Set s = ActivePage.FindShape(Name:="Frame", Type:=cdrRectangleShape)

If s Is Nothing Then

MsgBox "The rectange 'Frame' cannot be found on page " & ActivePage.Index

Else

s.CreateSelection

End If

End Sub

 Related Topics


Shapes.FindShapes

Function FindShapes([ByVal Name As String], [ByVal Type As cdrShapeType = cdrNoShape (0)], [ByVal Recursive As Boolean = True], [ByVal Query As String]) As ShapeRange

Shapes

Description

The FindShapes method finds shapes with the specified properties and returns them as a ShapeRange object, which contains all shapes that are found.

Parameters	Description

Name	Specifies a shape by its name[in]
Optional

Type	Specifies a shape by its type[in]
Optional
Default value = cdrNoShape (0)

Recursive	Specifies whether to iterate through all the shapes [in]
Optional
Default value = True

Query	This parameter is reserved for future use. [in]
Optional

Return value

Returns ShapeRange

Example

The following example finds all rectangles on the current page and fills them with red.

Sub Test()

Dim sr As ShapeRange

Set sr = ActivePage.FindShapes(Type:=cdrRectangleShape)

If sr.Count <> 0 Then

sr.ApplyUniformFill CreateRGBColor(255, 0, 0)

Else

MsgBox "There are no rectangles on the current page"

End If

End Sub

 Related Topics


Shapes.Range

Function Range(ByRef IndexArray() As Variant) As ShapeRange

Shapes

Description

The Range method returns a ShapeRange object which contains all specified shapes from the collection.

This method accepts a variable number of arguments. It also accepts arrays.

Parameters	Description

IndexArray	Represents index numbers that identify specific shapes [in]

Return value

Returns ShapeRange

Example

The following example deletes a range of shape objects from the active document. The first (1) and the fourth (4) shape objects are deleted from the Shapes collection. A message box displays the number of shapes in the collection before and after the deletion, so as to confirm that the shapes were removed from the Shapes collection.

Sub ShapesRange()

With ActiveLayer.Shapes

MsgBox "There are " & .Count & " shapes in the Shapes collection."

.Range(Array(1, 4)).Delete

MsgBox "There are " & .Count & " shapes in the Shapes collection."

End With

End Sub

 Related Topics


SnapPoint properties

SnapPoint     Legend

    Application
    Node
    Parent
      PositionX
      PositionY
    Type


SnapPoint

Class SnapPoint

Properties     Referenced By

The SnapPoint class represents the properties of a snap point on a shape.

Basic shapes have several snap points. For example, a rectangle has the snap points in each corner, middle of sides and the center of the shape. A curve has a snap point on each its node.

You can create a SnapPoint object by using the New keyword in Visual Basic.

 Related Topics


SnapPoint.Application

Property Application As Application

SnapPoint

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


SnapPoint.Node

Property Node As Node

SnapPoint

Description

The Node property returns a corresponding Node object for a curve.

This property is accessible only for a snap point on a curve shape.

Read-Only

Example

The following example creates two stars and connects them with a connector line. It then converts one of the nodes attached to the connector to a smooth node.

Sub Test()

Dim s1 As Shape, s2 As Shape, sCon As Shape

Dim n As Node

Set s1 = ActiveLayer.CreatePolygon(1.6, 10, 4.5, 7, 5, 1, 2)

s1.ConvertToCurves

Set s2 = ActiveLayer.CreatePolygon(2.4, 5, 5.7, 2, 5, 1, 2)

s2.ConvertToCurves

Set sCon = ActiveLayer.CreateConnector(s1.SnapPoints(7), s2.SnapPoints(9))

Set n = sCon.Connector.StartPoint.Node

n.Segment.Type = cdrCurveSegment

n.Segment.Next.Type = cdrCurveSegment

n.Type = cdrSmoothNode

End Sub

 Related Topics


SnapPoint.Parent

Property Parent As Shape

SnapPoint

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

Example

The following example selects one of the shapes to which the selected connector line is attached.

Sub Test()

Dim sp As New SnapPoint

If ActiveShape.Type <> cdrConnectorShape Then

MsgBox "Select a connector line."

Exit Sub

End If

Set sp = ActiveShape.Connector.StartPoint

If sp.Type = cdrSnapPoint Then

sp.Parent.CreateSelection

End If

End Sub

 Related Topics


SnapPoint.PositionX

Property PositionX As Double

SnapPoint

Description

Definition

The PositionX property returns or sets the horizontal position of a snap point.

If the point is on a shape, its position cannot be changed.

Example

The following example creates a star and attaches a connector line to its center. The other end of the connector line is placed on the page at the coordinates (1", 2").

Sub Test()

Dim s1 As Shape, sCon As Shape

Dim sp As New SnapPoint

Set s1 = ActiveLayer.CreatePolygon(1.6, 10, 4.5, 7, 5, 1, 2)

sp.PositionX = 1

sp.PositionY = 2

Set sCon = ActiveLayer.CreateConnector(s1.SnapPoints(12), sp)

End Sub

 Related Topics


SnapPoint.PositionY

Property PositionY As Double

SnapPoint

Description

Definition

The PositionY property returns or sets the vertical position of a snap point.

If the point is on a shape, its position cannot be changed.

Example

The following example creates a star and attaches a connector line to its center. The other end of the connector line is placed on the page at the coordinates (1", 2").

Sub Test()

Dim s1 As Shape, sCon As Shape

Dim sp As New SnapPoint

Set s1 = ActiveLayer.CreatePolygon(1.6, 10, 4.5, 7, 5, 1, 2)

sp.PositionX = 1

sp.PositionY = 2

Set sCon = ActiveLayer.CreateConnector(s1.SnapPoints(12), sp)

End Sub

 Related Topics


SnapPoint.Type

Property Type As cdrPointType

SnapPoint

Description

The Type property returns the type of the snap point, whether it belongs to a shape or is a free-floating point on a page.

The Type property returns cdrPointType.

Read-Only

Example

The following example selects one of the shapes to which the selected connector line is attached.

Sub Test()

Dim sp As New SnapPoint

If ActiveShape.Type <> cdrConnectorShape Then

MsgBox "Select a connector line."

Exit Sub

End If

Set sp = ActiveShape.Connector.StartPoint

If sp.Type = cdrSnapPoint Then

sp.Parent.CreateSelection

End If

End Sub

 Related Topics


SnapPoints properties

SnapPoints     Legend

    Application
    Count
  Item
    Parent


SnapPoints

Class SnapPoints

Properties     Referenced By

The SnapPoints class represents a collection of snap points on a shape. See the SnapPoint object for more information.

 Related Topics


SnapPoints.Application

Property Application As Application

SnapPoints

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


SnapPoints.Count

Property Count As Long

SnapPoints

Description

The Count property returns the total number of snap point objects in the SnapPoints collection.

Read-Only

Example

The following example creates a rectangle with rounded corners and displays the number of snap points available for this shape.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle2(0, 0, 2, 2, 0.5, 0.5, 0.5, 0.5)

MsgBox s.SnapPoints.Count

End Sub

 Related Topics


SnapPoints.Item

Property Item(ByVal Index As Long) As SnapPoint

SnapPoints

Description

The Item property returns the specified SnapPoint object from the collection.

The Item property is the default property and its reference may be omitted when accessing an item in the collection. For example, SnapPoints.Item(5) is the same as SnapPoints(5) - they both reference the fifth point in the collection.

Read-Only

Parameters	Description

Index	Specifies the snap point by its index number [in]

Examples

The following example creates a rectangle with rounded corners and marks each snap point with a small circle.

Sub Test()

Dim s As Shape

Dim sp As SnapPoint, i As Long

Set s = ActiveLayer.CreateRectangle2(0, 0, 2, 2, 0.5, 0.5, 0.5, 0.5)

For i = 1 To s.SnapPoints.Count

Set sp = s.SnapPoints(i)

ActiveLayer.CreateEllipse2 sp.PositionX, sp.PositionY, 0.05

Next i

End Sub

The following example performs the same procedure as the previous example. However, instead of using a For Next command, it uses the For Each command in Visual Basic to iterate through all snap points in the collection.

Sub Test()

Dim s As Shape

Dim sp As SnapPoint

Set s = ActiveLayer.CreateRectangle2(0, 0, 2, 2, 0.5, 0.5, 0.5, 0.5)

For Each sp In s.SnapPoints

ActiveLayer.CreateEllipse2 sp.PositionX, sp.PositionY, 0.05

Next sp

End Sub

 Related Topics


SnapPoints.Parent

Property Parent As Shape

SnapPoints

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


StructAlignProperties properties

StructAlignProperties     Legend

      Alignment
      CharacterRotation
      FirstLineIndent
      HorizontalCharacterShift
      LeftIndent
      MaxCharacterSpacing
      MaxWordSpacing
      MinWordSpacing
      RightIndent
      VerticalCharacterShift


StructAlignProperties

Class StructAlignProperties

Properties     Referenced By

The StructAlignProperties class represents alignment settings of a text block.

 Related Topics


StructAlignProperties.Alignment

Property Alignment As cdrAlignment

StructAlignProperties

Description

The Alignment property returns or sets the alignment (justification).

The Alignment property returns a value of cdrAlignment.

Example

The following example creates a text object in the center of the page.

Sub Test()

Dim s As Shape

Dim x As Double, y As Double

x = ActivePage.SizeWidth / 2

y = ActivePage.SizeHeight / 2

Set s = ActiveLayer.CreateArtisticText(x, y, "A Text String" & vbCr & _

"With Two Lines")

s.Text.AlignProperties.Alignment = cdrCenterAlignment

End Sub

 Related Topics


StructAlignProperties.CharacterRotation

Property CharacterRotation As Single

StructAlignProperties

Description

The CharacterRotation property returns or sets the rotation angle of characters of text.

The CharacterRotation property is measured in degrees and has a maximum value of 360 degrees.

Example

The following example creates a text object and rotates each character at a random angle.

Sub Test()

Dim s As Shape, i As Long

Dim sText As String

sText = "Random Text"

Set s = ActiveLayer.CreateArtisticText(0, 0, sText)

For i = 1 To Len(sText)

s.Text.AlignPropertiesInRange(i, 1).CharacterRotation = (Rnd() - 0.5) * 90

Next i

End Sub

 Related Topics


StructAlignProperties.FirstLineIndent

Property FirstLineIndent As Double

StructAlignProperties

Description

The FirstLineIndent property returns or sets the indent for the first line text in a paragraph. This value is measured in document units.

Example

The following example indents the first line of the second paragraph of the selected paragraph by one inch. It also indents the left and right margins of the selected paragraph by 0.5 inch.

Sub Test()

If ActiveShape Is Nothing Then Exit Sub

If ActiveShape.Type = cdrTextShape Then

If ActiveShape.Text.Type = cdrParagraphText Then

With ActiveShape.Text.AlignPropertiesInRange(2, 1, cdrParagraphIndexing)

.FirstLineIndent = 1

.LeftIndent = 0.5

.RightIndent = 0.5

End With

End If

End If

End Sub

 Related Topics


StructAlignProperties.HorizontalCharacterShift

Property HorizontalCharacterShift As Long

StructAlignProperties

Description

The HorizontalCharacterShift property returns or sets the amount to horizontally shift characters of text.

The value of a horizontal character shift is measured as a percentage of the character's point size. For example, if .HorizontalCharacterShift=50, the character is horizontally shifted a distance that is 50% of the character's point size.

Example

The following example specifies a horizontal character shift of 10% for the second and third words of the text shape.

Sub Test()

ActiveShape.Text.AlignPropertiesInRange(2, 2, cdrWordIndexing).HorizontalCharacterShift = 10

End Sub

 Related Topics


StructAlignProperties.LeftIndent

Property LeftIndent As Double

StructAlignProperties

Description

The LeftIndent property returns or sets the indent for the left side of a paragraph. This value is measured in document units.

Example

The following example indents the first line of the second paragraph of the selected paragraph by one inch. It also indents the left and right margins of the selected paragraph by 0.5 inch.

Sub Test()

If ActiveShape Is Nothing Then Exit Sub

If ActiveShape.Type = cdrTextShape Then

If ActiveShape.Text.Type = cdrParagraphText Then

With ActiveShape.Text.AlignPropertiesInRange(2, 1, cdrParagraphIndexing)

.FirstLineIndent = 1

.LeftIndent = 0.5

.RightIndent = 0.5

End With

End If

End If

End Sub

 Related Topics


StructAlignProperties.MaxCharacterSpacing

Property MaxCharacterSpacing As Single

StructAlignProperties

Description

The MaxCharacterSpacing property returns or sets the maximum amount of space that can exist between characters. This value represents a percentage of the space character (the space inserted when you press the Spacebar). The maximum percentage value is 2000, and the minimum percentage value is -100.

Example

The following example specifies the adjustment range for character and word spacing in the selected text shape.

Sub Test()

With ActiveShape.Text.AlignProperties

.MaxCharacterSpacing = 200

.MinWordSpacing = 50

.MaxWordSpacing = 150

End With

End Sub

 Related Topics


StructAlignProperties.MaxWordSpacing

Property MaxWordSpacing As Single

StructAlignProperties

Description

The MaxWordSpacing property returns or sets the maximum amount of space that can exist between words. This value represents a percentage of the space character (the space inserted when you press the Spacebar). The maximum value is 2000; the minimum value is 0.

Example

The following example specifies the adjustment range for character and word spacing in the selected text shape.

Sub Test()

With ActiveShape.Text.AlignProperties

.MaxCharacterSpacing = 200

.MinWordSpacing = 50

.MaxWordSpacing = 150

End With

End Sub

 Related Topics


StructAlignProperties.MinWordSpacing

Property MinWordSpacing As Single

StructAlignProperties

Description

The MinWordSpacing property returns or sets the minimum amount of space that can exist between words. This value represents a percentage of the space character (the space inserted when you press the Spacebar). The maximum value is 2000; the minimum value is 0.

Example

The following example specifies the adjustment range for character and word spacing in the selected text shape.

Sub Test()

With ActiveShape.Text.AlignProperties

.MaxCharacterSpacing = 200

.MinWordSpacing = 50

.MaxWordSpacing = 150

End With

End Sub

 Related Topics


StructAlignProperties.RightIndent

Property RightIndent As Double

StructAlignProperties

Description

The RightIndent property returns or sets the indent for the left side of a paragraph. This value is measured in document units.

Example

The following example indents the first line of the second paragraph of the selected paragraph by one inch. It also indents the left and right margins of the selected paragraph by 0.5 inch.

Sub Test()

If ActiveShape Is Nothing Then Exit Sub

If ActiveShape.Type = cdrTextShape Then

If ActiveShape.Text.Type = cdrParagraphText Then

With ActiveShape.Text.AlignPropertiesInRange(2, 1, cdrParagraphIndexing)

.FirstLineIndent = 1

.LeftIndent = 0.5

.RightIndent = 0.5

End With

End If

End If

End Sub

 Related Topics


StructAlignProperties.VerticalCharacterShift

Property VerticalCharacterShift As Long

StructAlignProperties

Description

The VerticalCharacterShift property returns or sets the amount to vertically shift characters of text.

The value of a vertical character shift is measured as a percentage of the character's point size. For example, if .VerticalCharacterShift=50, the character is vertically shifted a distance that is 50% of the character's point size.

Example

The following example specifies a vertical character shift of -10% for the second and third words of the text shape.

Sub Test()

ActiveShape.Text.AlignPropertiesInRange(2, 2, cdrWordIndexing).VerticalCharacterShift = -10

End Sub

 Related Topics


StructExportOptions properties

StructExportOptions     Legend

      AntiAliasingType
      Compression
      Dithered
      ImageType
      MaintainAspect
      MaintainLayers
      Overwrite
      ResolutionX
      ResolutionY
      SizeX
      SizeY
      Transparent
      UseColorProfile


StructExportOptions

Class StructExportOptions

Properties     Referenced By

The StructExportOptions class represents export settings.

This class is used in conjunction with the ExportEx function.

You can create a StructExportOptions object by using the New keyword in Visual Basic.

Most of the settings specified in this object are bitmap-related. You can use the ExportBitmap method to specify these parameters as direct arguments of the function call.

 Related Topics


StructExportOptions.AntiAliasingType

Property AntiAliasingType As cdrAntiAliasingType

StructExportOptions

Description

The AntiAliasingType property returns or sets the anti-aliasing algorithm to be used when exporting to bitmapped image formats.

This property returns a value of cdrAntiAliasingType.

Example

The following example exports the current page to a GIF without anti-aliasing.

Sub Test()

Dim opt As New StructExportOptions

Dim flt As ExportFilter

opt.AntiAliasingType = cdrNoAntiAliasing

Set flt = ActiveDocument.ExportEx("C:\Temp\img.gif", cdrGIF, cdrCurrentPage, opt)

flt.Finish

End Sub

 Related Topics


StructExportOptions.Compression

Property Compression As cdrCompressionType

StructExportOptions

Description

The Compression property specifies the type of compression used when exporting to certain bitmap image formats. These image formats include export filters that do not provide their own built-in interfaces, including BMP, TIF, and others. This property is not used with filters that do not support compression or have a single compression method (such as GIF, PNG, JPG, CPT, and so on).

When using the FPX filter, the type of compression must be specified through the filter's interface returned by the ExportEx or ExportBitmap methods.

Example

The following example exports the current page to a TIFF bitmap using the CCITT4 compression method.

Sub Test()

Dim opt As New StructExportOptions

Dim flt As ExportFilter

opt.ImageType = cdrBlackAndWhiteImage

opt.Compression = cdrCompressionCCITT4

Set flt = ActiveDocument.ExportEx("C:\Temp\img.tif", cdrTIFF, cdrCurrentPage, opt)

flt.Finish

End Sub

 Related Topics


StructExportOptions.Dithered

Property Dithered As Boolean

StructExportOptions

Description

The Dithered property specifies whether the bitmap image should be dithered when exporting.

This property only applies to exporting to black and white bitmaps. You can specify the dithering method for paletted bitmaps using the DitherType property.

Example

The following example exports the drawing to a black and white dithered BMP file.

Sub Test()

Dim opt As New StructExportOptions

Dim flt As ExportFilter

opt.ImageType = cdrBlackAndWhiteImage

opt.Compression = cdrCompressionPackBits

opt.Dithered = True

Set flt = ActiveDocument.ExportEx("C:\Temp\img.bmp", cdrBMP, cdrCurrentPage, opt)

flt.Finish

End Sub

 Related Topics


StructExportOptions.ImageType

Property ImageType As cdrImageType

StructExportOptions

Description

The ImageType property returns or sets the color model of the exported image.

You must use only the color models supported by the filter. Specifying an incorrect color model may result in export failure.

When the Paletted color model is specified, you can use the ExportEx or ExportBitmap methods to specify the palette generation options by using the PaletteOptions parameter which returns the StructPaletteOptions object

This property returns a value of cdrImageType.

Example

The following example exports shapes on the current page to a GIF file. The file is exported using a 16-color optimized palette and the Stucki algorithm for dithering.

Sub Test()

Dim opt As New StructExportOptions

Dim pal As New StructPaletteOptions

Dim flt As ExportFilter

opt.ImageType = cdrPalettedImage

pal.DitherType = cdrDitherStucki

pal.DitherIntensity = 100

pal.NumColors = 16

pal.PaletteType = cdrPaletteOptimized

Set flt = ActiveDocument.ExportEx("C:\Temp\img.gif", cdrGIF, cdrCurrentPage, opt, pal)

flt.Finish

End Sub

 Related Topics


StructExportOptions.MaintainAspect

Property MaintainAspect As Boolean

StructExportOptions

 Related Topics


StructExportOptions.MaintainLayers

Property MaintainLayers As Boolean

StructExportOptions

Description

 Related Topics


StructExportOptions.Overwrite

Property Overwrite As Boolean

StructExportOptions

Description

The Overwrite property returns or sets whether an existing file with the specified name will be overwritten. The default value of this property is True.

If the file with the given name already exists and this property is set to False, the export operation fails.

Example

The following example will fail while exporting the active document if the file img.gif already exists in the folder C:\Temp.

Sub Test()

Dim opt As New StructExportOptions

Dim flt As ExportFilter

opt.Overwrite = False

Set flt = ActiveDocument.ExportEx("C:\Temp\img.gif", cdrGIF, cdrCurrentPage, opt)

flt.Finish

End Sub

 Related Topics


StructExportOptions.ResolutionX

Property ResolutionX As Long

StructExportOptions

Description

The ResolutionX property returns or sets the horizontal resolution of a bitmap image that is being exported.

Example

The following example exports the current selection to a CMYK TIFF image with 300 dpi resolution.

Sub Test()

Dim opt As New StructExportOptions

Dim flt As ExportFilter

opt.ResolutionX = 300

opt.ResolutionY = 300

opt.ImageType = cdrCMYKColorImage

opt.Compression = cdrCompressionLZW

Set flt = ActiveDocument.ExportEx("C:\Temp\img.tif", cdrTIFF, cdrSelection, opt)

flt.Finish

End Sub

 Related Topics


StructExportOptions.ResolutionY

Property ResolutionY As Long

StructExportOptions

Description

The ResolutionY property returns or sets the vertical resolution of a bitmap image that is being exported.

Example

The following example exports the current selection to a CMYK TIFF image with 300 dpi resolution.

Sub Test()

Dim opt As New StructExportOptions

Dim flt As ExportFilter

opt.ResolutionX = 300

opt.ResolutionY = 300

opt.ImageType = cdrCMYKColorImage

opt.Compression = cdrCompressionLZW

Set flt = ActiveDocument.ExportEx("C:\Temp\img.tif", cdrTIFF, cdrSelection, opt)

flt.Finish

End Sub

 Related Topics


StructExportOptions.SizeX

Property SizeX As Long

StructExportOptions

Description

The SizeX property returns or sets the horizontal size of an exported bitmap. This property is measured in pixels.

If neither SizeX nor SizeY is specified, the size of the bitmap is calculated based on the size of the objects being exported and the specified bitmap resolution.

Example

The following example exports the current selection to a 100x100 pixel TIFF image.

Sub Test()

Dim opt As New StructExportOptions

Dim flt As ExportFilter

opt.SizeX = 100

opt.SizeY = 100

opt.ImageType = cdrCMYKColorImage

opt.Compression = cdrCompressionLZW

Set flt = ActiveDocument.ExportEx("C:\Temp\img.tif", cdrTIFF, cdrSelection, opt)

flt.Finish

End Sub

 Related Topics


StructExportOptions.SizeY

Property SizeY As Long

StructExportOptions

Description

The SizeY property returns or sets the vertical size of an exported bitmap. This property is measured in pixels.

If neither SizeX nor SizeY is specified, the size of the bitmap is calculated based on the size of the objects being exported and the specified bitmap resolution.

Example

The following example exports the current selection to a 100x100 pixel TIFF image.

Sub Test()

Dim opt As New StructExportOptions

Dim flt As ExportFilter

opt.SizeX = 100

opt.SizeY = 100

opt.ImageType = cdrCMYKColorImage

opt.Compression = cdrCompressionLZW

Set flt = ActiveDocument.ExportEx("C:\Temp\img.tif", cdrTIFF, cdrSelection, opt)

flt.Finish

End Sub

 Related Topics


StructExportOptions.Transparent

Property Transparent As Boolean

StructExportOptions

Description

The Transparent property specifies whether the bitmap image being exported has no background, that is, has a transparent background.

You can use this property only with formats that support transparency (such as, CPT, PSD, and TIFF). This property cannot be used with any other filters, including GIF and PNG. (For GIF and PNG filters, you can use the filters' interfaces to specify a transparent color).

Example

The following example exports the selected objects to a Corel PHOTO-PAINT (CPT) format without a background.

Sub Test()

Dim opt As New StructExportOptions

Dim flt As ExportFilter

opt.ImageType = cdrRGBColorImage

opt.Transparent = True

Set flt = ActiveDocument.ExportEx("C:\Temp\img.cpt", cdrCPT10, cdrSelection, opt)

flt.Finish

End Sub

 Related Topics


StructExportOptions.UseColorProfile

Property UseColorProfile As Boolean

StructExportOptions

Description

The UseColorProfile property specifies whether the current color profile should be used when converting colors during export.

Example

The following example exports the selection to an RGB BMP image, with colors corrected using the current color profile.

Sub Test()

Dim opt As New StructExportOptions

Dim flt As ExportFilter

opt.ImageType = cdrRGBColorImage

opt.UseColorProfile = True

Set flt = ActiveDocument.ExportEx("C:\Temp\img.bmp", cdrBMP, cdrSelection, opt)

flt.Finish

End Sub

 Related Topics


StructFontProperties properties

StructFontProperties     Legend

      Fill
      Name
      Outline
      Overscore
      Position
      RangeKerning
      Size
      Strikethru
      Style
      Underline
      Uppercase


StructFontProperties

Class StructFontProperties

Properties     Referenced By

The StructFontProperties class represents the font properties of a text block.

 Related Topics


StructFontProperties.Fill

Property Fill As Fill

StructFontProperties

Description

The Fill property returns or sets the fill of individual characters of text.

This property is reserved for future development.

 Related Topics


StructFontProperties.Name

Property Name As String

StructFontProperties

Description

The Name property returns or specifies the name of a font face.

Example

The following example creates a centered text shape and applies a font face and size (Arial, 18 pt) to it.

Sub Test()

Dim s As Shape

Dim x As Double, y As Double

x = ActivePage.SizeWidth / 2

y = ActivePage.SizeHeight / 2

Set s = ActiveLayer.CreateArtisticText(x, y, "Some Text String" & vbCr & "With Two Lines")

s.Text.AlignProperties.Alignment = cdrCenterAlignment

With s.Text.FontProperties

.Name = "Arial"

.Size = 18

End With

End Sub

 Related Topics


StructFontProperties.Outline

Property Outline As Outline

StructFontProperties

Description

The Outline property returns or sets the outline of individual characters of text.

This property is reserved for future development.

 Related Topics


StructFontProperties.Overscore

Property Overscore As cdrFontLine

StructFontProperties

Description

The Overscore property returns or sets the type of line that appears above text.

The Overscore property returns a value of cdrFontLine.

Example

The following example creates a text object, and applies double lines above and below it

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(4, 5, "A Text String")

With s.Text.FontProperties

.Underline = cdrDoubleThinFontLine

.Overscore = cdrDoubleThinFontLine

End With

End Sub

 Related Topics


StructFontProperties.Position

Property Position As cdrFontPosition

StructFontProperties

Description

The Position property returns or sets the position of characters for a block of text.

The Position property returns a value of cdrFontPosition.

Example

The following example creates a text object with a subscript character.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(4, 5, "H2O")

s.Text.FontPropertiesInRange(2, 1).Position = cdrSubscriptFontPosition

End Sub

 Related Topics


StructFontProperties.RangeKerning

Property RangeKerning As Long

StructFontProperties

Description

The RangeKerning property returns or sets the amount of white space between characters of text.

This value represents a percentage of the space character (the space inserted when you press the Spacebar). The maximum value is 1000; the minimum value is -100.

Example

The following example creates a text string and adjusts the kerning of the second word.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(4, 5, "Some loose text")

s.Text.FontPropertiesInRange(2, 1, cdrWordIndexing).RangeKerning = 100

End Sub

 Related Topics


StructFontProperties.Size

Property Size As Single

StructFontProperties

Description

The Size property returns or sets the size of a font in points.

Example

The following example creates a centered text shape and applies a font face and size (Arial, 18 pt) to it.

Sub Test()

Dim s As Shape

Dim x As Double, y As Double

x = ActivePage.SizeWidth / 2

y = ActivePage.SizeHeight / 2

Set s = ActiveLayer.CreateArtisticText(x, y, "Some Text String" & vbCr & "With Two Lines")

s.Text.AlignProperties.Alignment = cdrCenterAlignment

With s.Text.FontProperties

.Name = "Arial"

.Size = 18

End With

End Sub

 Related Topics


StructFontProperties.Strikethru

Property Strikethru As cdrFontLine

StructFontProperties

Description

The Strikethrough property returns or sets the type of line that appears through text.

The Strikethrough property returns a value of cdrFontLine.

Example

The following example creates a text object and applies a thin double line through the text.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(4, 5, "A Text String")

s.Text.FontProperties.Strikethru = cdrDoubleThinFontLine

End Sub

 Related Topics


StructFontProperties.Style

Property Style As cdrFontStyle

StructFontProperties

Description

The Style property returns or sets the style of a font.

The Style property returns a value of cdrFontStyle.

Example

The following example creates a text string and applies a bold, italic style to the first word.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(4, 5, "Highlight your ideas!")

s.Text.FontPropertiesInRange(1, 1, cdrWordIndexing).Style = cdrBoldItalicFontStyle

End Sub

 Related Topics


StructFontProperties.Underline

Property Underline As cdrFontLine

StructFontProperties

Description

The Underline property returns or sets the type of line that appears under text.

The Underline property returns a value of cdrFontLine.

Example

The following example creates a text object and applies double underline to it.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(4, 5, "Some Text String")

s.Text.FontProperties.Underline = cdrDoubleThinFontLine

End Sub

 Related Topics


StructFontProperties.Uppercase

Property Uppercase As cdrFontCase

StructFontProperties

Description

The Uppercase property returns or sets the attributes of the case for the characters in the text.

The Uppercase property returns a value of cdrFontCase.

Example

The following example creates a text object and applies SmallCaps to it.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateArtisticText(4, 5, "Small Caps Text")

s.Text.FontProperties.Uppercase = cdrSmallCapsFontCase

End Sub

 Related Topics


StructFountainFillProperties properties

StructFountainFillProperties     Legend

      Angle
      BlendType
      CenterX
      CenterY
    ColorCount
      EdgePad
      FromColor
      MidPoint
      Steps
      ToColor
      Type


StructFountainFillProperties

Class StructFountainFillProperties

Properties     Referenced By

 Related Topics


StructFountainFillProperties.Angle

Property Angle As Double

StructFountainFillProperties

Description

Member of StructFountainFillProperties

 Related Topics


StructFountainFillProperties.BlendType

Property BlendType As cdrFountainFillBlendType

StructFountainFillProperties

Description

Member of StructFountainFillProperties

 Related Topics


StructFountainFillProperties.CenterX

Property CenterX As Long

StructFountainFillProperties

Description

Member of StructFountainFillProperties

 Related Topics


StructFountainFillProperties.CenterY

Property CenterY As Long

StructFountainFillProperties

Description

Member of StructFountainFillProperties

 Related Topics


StructFountainFillProperties.ColorCount

Property ColorCount As Long

StructFountainFillProperties

Description

Member of StructFountainFillProperties

Read-Only

 Related Topics


StructFountainFillProperties.EdgePad

Property EdgePad As Long

StructFountainFillProperties

Description

Member of StructFountainFillProperties

 Related Topics


StructFountainFillProperties.FromColor

Property FromColor As Color

StructFountainFillProperties

Description

Member of StructFountainFillProperties

 Related Topics


StructFountainFillProperties.MidPoint

Property MidPoint As Long

StructFountainFillProperties

Description

Member of StructFountainFillProperties

 Related Topics


StructFountainFillProperties.Steps

Property Steps As Long

StructFountainFillProperties

Description

Member of StructFountainFillProperties

 Related Topics


StructFountainFillProperties.ToColor

Property ToColor As Color

StructFountainFillProperties

Description

Member of StructFountainFillProperties

 Related Topics


StructFountainFillProperties.Type

Property Type As cdrFountainFillType

StructFountainFillProperties

Description

Member of StructFountainFillProperties

 Related Topics


StructHyphenationSettings properties

StructHyphenationSettings     Legend

      BreakCapitalized
      HotZone
      MinCharactersAfter
      MinCharactersBefore
      MinWordLength
      UseAutomaticHyphenation


StructHyphenationSettings

Class StructHyphenationSettings

Properties     Referenced By

The StructHyphenationSettings class represents hyphenation settings of a text block.

You can create a StructHyphenationSettings object by using the New keyword in Visual Basic.

 Related Topics


StructHyphenationSettings.BreakCapitalized

Property BreakCapitalized As Boolean

StructHyphenationSettings

Description

The BreakCapitalized property returns or sets whether the hyphenation of capitalized words is enabled. If the BreakCapitalized property is True, CorelDRAW automatically hyphenates words with initial or all capital letters.

In order to return or set the BreakCapitalized property, the UseAutomaticHyphenation property must be set to True.

Example

The following example disables hyphenation of capitalized words for the whole text object.

Sub Test()

ActiveShape.Text.HyphenationSettings.BreakCapitalized = False

End Sub

 Related Topics


StructHyphenationSettings.HotZone

Property HotZone As Double

StructHyphenationSettings

Description

The HotZone property returns or sets the distance between the last word in a line and the right margin before hyphenation occurs

In order to return or set the HotZone property, the UseAutomaticHyphenation property must be set to True.

Example

The following example specifies a hyphenation hot zone of seven millimeters for the whole, selected text object.

Sub Test()

ActiveDocument.Unit = cdrMillimeter

ActiveShape.Text.HyphenationSettings.HotZone = 7

End Sub

 Related Topics


StructHyphenationSettings.MinCharactersAfter

Property MinCharactersAfter As Long

StructHyphenationSettings

Description

The MinCharactersAfter property returns or sets the minimum number of characters (including spaces) that must appear in the hot zone after a hyphen. For example, if the MinCharactersAfter is set to four, a word in a paragraph text frame must contain at least four characters after a hyphen in order to apply hyphenation.

In order to return or set the MinCharactersAfter property, the UseAutomaticHyphenation property must be set to True.

Example

The following example enables automatic hyphenation for the selected text shape, and specifies a minimum of two characters to be left on a line or carried to the next line following a hyphen.

Sub Test()

With ActiveShape.Text.HyphenationSettings

.UseAutomaticHyphenation = True

.MinCharactersBefore = 2

.MinCharactersAfter = 2

End With

End Sub

 Related Topics


StructHyphenationSettings.MinCharactersBefore

Property MinCharactersBefore As Long

StructHyphenationSettings

Description

The MinCharactersBefore property returns or sets the minimum number of characters (including spaces) that must appear in the hot zone before a hyphen. For example, if the MinCharactersBefore property is set to three, a word in a paragraph text frame must contain at least three characters before a hyphen in order to apply hyphenation.

In order to return or set the MinCharactersBefore property, the UseAutomaticHyphenation property must be set to True.

Example

The following example enables automatic hyphenation for the selected text shape, and specifies a minimum of two characters to be left on a line or carried to the next line following a hyphen.

Sub Test()

With ActiveShape.Text.HyphenationSettings

.UseAutomaticHyphenation = True

.MinCharactersBefore = 2

.MinCharactersAfter = 2

End With

End Sub

 Related Topics


StructHyphenationSettings.MinWordLength

Property MinWordLength As Long

StructHyphenationSettings

Description

The MinWordLength property returns or sets the minimum number of characters a word must contain in order for it to be included in automatic hyphenation.

In order to return or set the MinWordLength property, the UseAutomaticHyphenation property must be set to True.

Example

The following example enables automatic hyphenation for the selected text shape, and specifies a minimum word length of six characters in order to be hyphenated.

Sub Test()

With ActiveShape.Text.HyphenationSettings

.UseAutomaticHyphenation = True

.MinWordLength = 6

End With

End Sub

 Related Topics


StructHyphenationSettings.UseAutomaticHyphenation

Property UseAutomaticHyphenation As Boolean

StructHyphenationSettings

Description

The UseAutomaticHyphenation property returns or sets whether automatic hyphenation for a portion of text is enabled. If the UseAutomaticHyphenation property is True, CorelDRAW automatically hyphenates text.

Example

The following example enables automatic hyphenation for the selected text shape, and specifies that a minimum of two characters are to be left on a line or carried to the next line following a hyphen.

Sub Test()

With ActiveShape.Text.HyphenationSettings

.UseAutomaticHyphenation = True

.MinCharactersBefore = 2

.MinCharactersAfter = 2

End With

End Sub

 Related Topics


StructImportCropOptions properties

StructImportCropOptions     Legend

    CustomData
    DpiX
    DpiY
    FileName
    FilterID
      Height
    ImageHeight
    ImageWidth
      Left
      Top
      Width


StructImportCropOptions

Class StructImportCropOptions

Properties     Referenced By

 Related Topics


StructImportCropOptions.CustomData

Property CustomData As Long

StructImportCropOptions

Description

Read-Only

Example

The following example creates a new crop options class. It then imports a JPEG file and crops it depending on the value for CustomData. Before the crop is applied, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cCrop."

Option Explicit

Implements IImportCropHandler

Private Function IImportCropHandler_Crop(ByVal Options As IStructImportCropOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

s = s & "ImageHeight:  " & Options.ImageHeight & vbCr

s = s & "ImageWidth:  " & Options.ImageWidth & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 7 then crop half of the original; otherwise, subtract 0.5 units from the height and width.

If Options.CustomData = 7 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Options.Top = Options.Top / 2

Options.Left = Options.Left / 2

Else

Options.Height = Options.Height - 0.5

Options.Width = Options.Width - 0.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testCrop()

' Declare a new crop class.

Dim MyCrop As New cCrop

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to crop.

io.Mode = cdrImportCrop

' Set the custom data.

io.CustomData = 7

' Set the import options crop handler to the one created.

Set io.CropHandler = MyCrop

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportCropOptions.DpiX

Property DpiX As Long

StructImportCropOptions

Description

Read-Only

Example

The following example creates a new crop options class. It then imports a JPEG file and crops it depending on the value for CustomData. Before the crop is applied, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cCrop."

Option Explicit

Implements IImportCropHandler

Private Function IImportCropHandler_Crop(ByVal Options As IStructImportCropOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

s = s & "ImageHeight:  " & Options.ImageHeight & vbCr

s = s & "ImageWidth:  " & Options.ImageWidth & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 7 then crop half of the original; otherwise, subtract 0.5 units from the height and width.

If Options.CustomData = 7 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Options.Top = Options.Top / 2

Options.Left = Options.Left / 2

Else

Options.Height = Options.Height - 0.5

Options.Width = Options.Width - 0.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testCrop()

' Declare a new crop class.

Dim MyCrop As New cCrop

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to crop.

io.Mode = cdrImportCrop

' Set the custom data.

io.CustomData = 7

' Set the import options crop handler to the one created.

Set io.CropHandler = MyCrop

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportCropOptions.DpiY

Property DpiY As Long

StructImportCropOptions

Description

Read-Only

Example

The following example creates a new crop options class. It then imports a JPEG file and crops it depending on the value for CustomData. Before the crop is applied, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cCrop."

Option Explicit

Implements IImportCropHandler

Private Function IImportCropHandler_Crop(ByVal Options As IStructImportCropOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

s = s & "ImageHeight:  " & Options.ImageHeight & vbCr

s = s & "ImageWidth:  " & Options.ImageWidth & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 7 then crop half of the original; otherwise, subtract 0.5 units from the height and width.

If Options.CustomData = 7 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Options.Top = Options.Top / 2

Options.Left = Options.Left / 2

Else

Options.Height = Options.Height - 0.5

Options.Width = Options.Width - 0.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testCrop()

' Declare a new crop class.

Dim MyCrop As New cCrop

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to crop.

io.Mode = cdrImportCrop

' Set the custom data.

io.CustomData = 7

' Set the import options crop handler to the one created.

Set io.CropHandler = MyCrop

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportCropOptions.FileName

Property FileName As String

StructImportCropOptions

Description

Read-Only

Example

The following example creates a new crop options class. It then imports a JPEG file and crops it depending on the value for CustomData. Before the crop is applied, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cCrop."

Option Explicit

Implements IImportCropHandler

Private Function IImportCropHandler_Crop(ByVal Options As IStructImportCropOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

s = s & "ImageHeight:  " & Options.ImageHeight & vbCr

s = s & "ImageWidth:  " & Options.ImageWidth & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 7 then crop half of the original; otherwise, subtract 0.5 units from the height and width.

If Options.CustomData = 7 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Options.Top = Options.Top / 2

Options.Left = Options.Left / 2

Else

Options.Height = Options.Height - 0.5

Options.Width = Options.Width - 0.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testCrop()

' Declare a new crop class.

Dim MyCrop As New cCrop

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to crop.

io.Mode = cdrImportCrop

' Set the custom data.

io.CustomData = 7

' Set the import options crop handler to the one created.

Set io.CropHandler = MyCrop

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportCropOptions.FilterID

Property FilterID As Long

StructImportCropOptions

Description

Read-Only

Example

The following example creates a new crop options class. It then imports a JPEG file and crops it depending on the value for CustomData. Before the crop is applied, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cCrop."

Option Explicit

Implements IImportCropHandler

Private Function IImportCropHandler_Crop(ByVal Options As IStructImportCropOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

s = s & "ImageHeight:  " & Options.ImageHeight & vbCr

s = s & "ImageWidth:  " & Options.ImageWidth & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 7 then crop half of the original; otherwise, subtract 0.5 units from the height and width.

If Options.CustomData = 7 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Options.Top = Options.Top / 2

Options.Left = Options.Left / 2

Else

Options.Height = Options.Height - 0.5

Options.Width = Options.Width - 0.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testCrop()

' Declare a new crop class.

Dim MyCrop As New cCrop

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to crop.

io.Mode = cdrImportCrop

' Set the custom data.

io.CustomData = 7

' Set the import options crop handler to the one created.

Set io.CropHandler = MyCrop

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportCropOptions.Height

Property Height As Long

StructImportCropOptions

Example

The following example creates a new crop options class. It then imports a JPEG file and crops it depending on the value for CustomData. Before the crop is applied, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cCrop."

Option Explicit

Implements IImportCropHandler

Private Function IImportCropHandler_Crop(ByVal Options As IStructImportCropOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

s = s & "ImageHeight:  " & Options.ImageHeight & vbCr

s = s & "ImageWidth:  " & Options.ImageWidth & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 7 then crop half of the original; otherwise, subtract 0.5 units from the height and width.

If Options.CustomData = 7 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Options.Top = Options.Top / 2

Options.Left = Options.Left / 2

Else

Options.Height = Options.Height - 0.5

Options.Width = Options.Width - 0.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testCrop()

' Declare a new crop class.

Dim MyCrop As New cCrop

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to crop.

io.Mode = cdrImportCrop

' Set the custom data.

io.CustomData = 7

' Set the import options crop handler to the one created.

Set io.CropHandler = MyCrop

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportCropOptions.ImageHeight

Property ImageHeight As Long

StructImportCropOptions

Description

Read-Only

Example

The following example creates a new crop options class. It then imports a JPEG file and crops it depending on the value for CustomData. Before the crop is applied, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cCrop."

Option Explicit

Implements IImportCropHandler

Private Function IImportCropHandler_Crop(ByVal Options As IStructImportCropOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

s = s & "ImageHeight:  " & Options.ImageHeight & vbCr

s = s & "ImageWidth:  " & Options.ImageWidth & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 7 then crop half of the original; otherwise, subtract 0.5 units from the height and width.

If Options.CustomData = 7 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Options.Top = Options.Top / 2

Options.Left = Options.Left / 2

Else

Options.Height = Options.Height - 0.5

Options.Width = Options.Width - 0.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testCrop()

' Declare a new crop class.

Dim MyCrop As New cCrop

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to crop.

io.Mode = cdrImportCrop

' Set the custom data.

io.CustomData = 7

' Set the import options crop handler to the one created.

Set io.CropHandler = MyCrop

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportCropOptions.ImageWidth

Property ImageWidth As Long

StructImportCropOptions

Description

Read-Only

Example

The following example creates a new crop options class. It then imports a JPEG file and crops it depending on the value for CustomData. Before the crop is applied, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cCrop."

Option Explicit

Implements IImportCropHandler

Private Function IImportCropHandler_Crop(ByVal Options As IStructImportCropOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

s = s & "ImageHeight:  " & Options.ImageHeight & vbCr

s = s & "ImageWidth:  " & Options.ImageWidth & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 7 then crop half of the original; otherwise, subtract 0.5 units from the height and width.

If Options.CustomData = 7 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Options.Top = Options.Top / 2

Options.Left = Options.Left / 2

Else

Options.Height = Options.Height - 0.5

Options.Width = Options.Width - 0.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testCrop()

' Declare a new crop class.

Dim MyCrop As New cCrop

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to crop.

io.Mode = cdrImportCrop

' Set the custom data.

io.CustomData = 7

' Set the import options crop handler to the one created.

Set io.CropHandler = MyCrop

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportCropOptions.Left

Property Left As Long

StructImportCropOptions

Example

The following example creates a new crop options class. It then imports a JPEG file and crops it depending on the value for CustomData. Before the crop is applied, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cCrop."

Option Explicit

Implements IImportCropHandler

Private Function IImportCropHandler_Crop(ByVal Options As IStructImportCropOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

s = s & "ImageHeight:  " & Options.ImageHeight & vbCr

s = s & "ImageWidth:  " & Options.ImageWidth & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 7 then crop half of the original; otherwise, subtract 0.5 units from the height and width.

If Options.CustomData = 7 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Options.Top = Options.Top / 2

Options.Left = Options.Left / 2

Else

Options.Height = Options.Height - 0.5

Options.Width = Options.Width - 0.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testCrop()

' Declare a new crop class.

Dim MyCrop As New cCrop

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to crop.

io.Mode = cdrImportCrop

' Set the custom data.

io.CustomData = 7

' Set the import options crop handler to the one created.

Set io.CropHandler = MyCrop

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportCropOptions.Top

Property Top As Long

StructImportCropOptions

Example

TThe following example creates a new crop options class. It then imports a JPEG file and crops it depending on the value for CustomData. Before the crop is applied, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cCrop."

Option Explicit

Implements IImportCropHandler

Private Function IImportCropHandler_Crop(ByVal Options As IStructImportCropOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

s = s & "ImageHeight:  " & Options.ImageHeight & vbCr

s = s & "ImageWidth:  " & Options.ImageWidth & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 7 then crop half of the original; otherwise, subtract 0.5 units from the height and width.

If Options.CustomData = 7 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Options.Top = Options.Top / 2

Options.Left = Options.Left / 2

Else

Options.Height = Options.Height - 0.5

Options.Width = Options.Width - 0.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testCrop()

' Declare a new crop class.

Dim MyCrop As New cCrop

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to crop.

io.Mode = cdrImportCrop

' Set the custom data.

io.CustomData = 7

' Set the import options crop handler to the one created.

Set io.CropHandler = MyCrop

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportCropOptions.Width

Property Width As Long

StructImportCropOptions

Example

The following example creates a new crop options class. It then imports a JPEG file and crops it depending on the value for CustomData. Before the crop is applied, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cCrop."

Option Explicit

Implements IImportCropHandler

Private Function IImportCropHandler_Crop(ByVal Options As IStructImportCropOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

s = s & "ImageHeight:  " & Options.ImageHeight & vbCr

s = s & "ImageWidth:  " & Options.ImageWidth & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 7 then crop half of the original; otherwise, subtract 0.5 units from the height and width.

If Options.CustomData = 7 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Options.Top = Options.Top / 2

Options.Left = Options.Left / 2

Else

Options.Height = Options.Height - 0.5

Options.Width = Options.Width - 0.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testCrop()

' Declare a new crop class.

Dim MyCrop As New cCrop

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to crop.

io.Mode = cdrImportCrop

' Set the custom data.

io.CustomData = 7

' Set the import options crop handler to the one created.

Set io.CropHandler = MyCrop

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportOptions properties

StructImportOptions     Legend

      CombineMultilayerBitmaps
      CropHandler
      CustomData
      DetectWatermark
      ExtractICCProfile
      ICCFileName
      ImageIndex
      LinkBitmapExternally
      MaintainLayers
      Mode
      ResampleHandler
      UseOPILinks


StructImportOptions

Class StructImportOptions

Properties     Referenced By

 Related Topics


StructImportOptions.CombineMultilayerBitmaps

Property CombineMultilayerBitmaps As Boolean

StructImportOptions

Example

The following example sets import options for a StructImportOptions object and then imports a JPEG file using those options.

Sub testImportOptions()

' Declare a new import options structure

Dim io As New StructImportOptions

With io

.Mode = cdrImportFull

.CombineMultilayerBitmaps = False

.DetectWatermark = True

.ExtractICCProfile = False

.ICCFileName = "C:\Test.icc"

.ImageIndex = 3

.LinkBitmapExternally = False

.MaintainLayers = True

.UseOPILinks = False

End With

' Import the jpeg file passing the import option structure

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportOptions.CropHandler

Property CropHandler As IImportCropHandler

StructImportOptions

Example

The following example creates a new crop options class. It then imports a JPEG file and crops it depending on the value for CustomData. Before the crop is applied, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cCrop."

Option Explicit

Implements IImportCropHandler

Private Function IImportCropHandler_Crop(ByVal Options As IStructImportCropOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

s = s & "ImageHeight:  " & Options.ImageHeight & vbCr

s = s & "ImageWidth:  " & Options.ImageWidth & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 7 then crop half of the original; otherwise, subtract 0.5 units from the height and width.

If Options.CustomData = 7 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Options.Top = Options.Top / 2

Options.Left = Options.Left / 2

Else

Options.Height = Options.Height - 0.5

Options.Width = Options.Width - 0.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testCrop()

' Declare a new crop class.

Dim MyCrop As New cCrop

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to crop.

io.Mode = cdrImportCrop

' Set the custom data.

io.CustomData = 7

' Set the import options crop handler to the one created.

Set io.CropHandler = MyCrop

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportOptions.CustomData

Property CustomData As Long

StructImportOptions

Example

The following example creates a new resample options class. It then imports a JPEG file and resamples it depending on the value for CustomData. Before it applies the resampling, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cResample."

Option Explicit

Implements IImportResampleHandler

Private Function IImportResampleHandler_Resample(ByVal Options As IStructImportResampleOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 8, then resample half of the original; otherwise 1.5

If Options.CustomData = 8 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Else

Options.Height = Options.Height / 1.5

Options.Width = Options.Width / 1.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testResample()

' Declare a new resample class.

Dim MyResampler As New cResample

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to resample.

io.Mode = cdrImportResample

' Set the custom data.

io.CustomData = 8

' Set the import options resample handler to the one created.

Set io.ResampleHandler = MyResampler

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportOptions.DetectWatermark

Property DetectWatermark As Boolean

StructImportOptions

Example

The following example sets import options for a StructImportOptions object and then imports a JPEG file using those options.

Sub testImportOptions()

' Declare a new import options structure

Dim io As New StructImportOptions

With io

.Mode = cdrImportFull

.CombineMultilayerBitmaps = False

.DetectWatermark = True

.ExtractICCProfile = False

.ICCFileName = "C:\Test.icc"

.ImageIndex = 3

.LinkBitmapExternally = False

.MaintainLayers = True

.UseOPILinks = False

End With

' Import the jpeg file passing the import option structure

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportOptions.ExtractICCProfile

Property ExtractICCProfile As Boolean

StructImportOptions

Example

The following example sets import options for a StructImportOptions object and then imports a JPEG file using those options.

Sub testImportOptions()

' Declare a new import options structure

Dim io As New StructImportOptions

With io

.Mode = cdrImportFull

.CombineMultilayerBitmaps = False

.DetectWatermark = True

.ExtractICCProfile = False

.ICCFileName = "C:\Test.icc"

.ImageIndex = 3

.LinkBitmapExternally = False

.MaintainLayers = True

.UseOPILinks = False

End With

' Import the jpeg file passing the import option structure

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportOptions.ICCFileName

Property ICCFileName As String

StructImportOptions

Example

The following example sets import options for a StructImportOptions object and then imports a JPEG file using those options.

Sub testImportOptions()

' Declare a new import options structure

Dim io As New StructImportOptions

With io

.Mode = cdrImportFull

.CombineMultilayerBitmaps = False

.DetectWatermark = True

.ExtractICCProfile = False

.ICCFileName = "C:\Test.icc"

.ImageIndex = 3

.LinkBitmapExternally = False

.MaintainLayers = True

.UseOPILinks = False

End With

' Import the jpeg file passing the import option structure

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportOptions.ImageIndex

Property ImageIndex As Long

StructImportOptions

Example

The following example sets import options for a StructImportOptions object and then imports a JPEG file using those options.

Sub testImportOptions()

' Declare a new import options structure

Dim io As New StructImportOptions

With io

.Mode = cdrImportFull

.CombineMultilayerBitmaps = False

.DetectWatermark = True

.ExtractICCProfile = False

.ICCFileName = "C:\Test.icc"

.ImageIndex = 3

.LinkBitmapExternally = False

.MaintainLayers = True

.UseOPILinks = False

End With

' Import the jpeg file passing the import option structure

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportOptions.LinkBitmapExternally

Property LinkBitmapExternally As Boolean

StructImportOptions

Example

The following example sets import options for a StructImportOptions object and then imports a JPEG file using those options.

Sub testImportOptions()

' Declare a new import options structure

Dim io As New StructImportOptions

With io

.Mode = cdrImportFull

.CombineMultilayerBitmaps = False

.DetectWatermark = True

.ExtractICCProfile = False

.ICCFileName = "C:\Test.icc"

.ImageIndex = 3

.LinkBitmapExternally = False

.MaintainLayers = True

.UseOPILinks = False

End With

' Import the jpeg file passing the import option structure

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportOptions.MaintainLayers

Property MaintainLayers As Boolean

StructImportOptions

Example

The following example sets import options for a StructImportOptions object and then imports a JPEG file using those options.

Sub testImportOptions()

' Declare a new import options structure

Dim io As New StructImportOptions

With io

.Mode = cdrImportFull

.CombineMultilayerBitmaps = False

.DetectWatermark = True

.ExtractICCProfile = False

.ICCFileName = "C:\Test.icc"

.ImageIndex = 3

.LinkBitmapExternally = False

.MaintainLayers = True

.UseOPILinks = False

End With

' Import the jpeg file passing the import option structure

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportOptions.Mode

Property Mode As cdrImportMode

StructImportOptions

Example

The following example sets import options for a StructImportOptions object and then imports a JPEG file using those options.

Sub testImportOptions()

' Declare a new import options structure

Dim io As New StructImportOptions

With io

.Mode = cdrImportFull

.CombineMultilayerBitmaps = False

.DetectWatermark = True

.ExtractICCProfile = False

.ICCFileName = "C:\Test.icc"

.ImageIndex = 3

.LinkBitmapExternally = False

.MaintainLayers = True

.UseOPILinks = False

End With

' Import the jpeg file passing the import option structure

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportOptions.ResampleHandler

Property ResampleHandler As IImportResampleHandler

StructImportOptions

Example

The following example creates a new resample options class. It then imports a JPEG file and resamples it depending on the value for CustomData. Before it applies the resampling, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cResample."

Option Explicit

Implements IImportResampleHandler

Private Function IImportResampleHandler_Resample(ByVal Options As IStructImportResampleOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 8, then resample half of the original; otherwise 1.5

If Options.CustomData = 8 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Else

Options.Height = Options.Height / 1.5

Options.Width = Options.Width / 1.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testResample()

' Declare a new resample class.

Dim MyResampler As New cResample

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to resample.

io.Mode = cdrImportResample

' Set the custom data.

io.CustomData = 8

' Set the import options resample handler to the one created.

Set io.ResampleHandler = MyResampler

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportOptions.UseOPILinks

Property UseOPILinks As Boolean

StructImportOptions

Example

The following example sets import options for a StructImportOptions object and then imports a JPEG file using those options.

Sub testImportOptions()

' Declare a new import options structure

Dim io As New StructImportOptions

With io

.Mode = cdrImportFull

.CombineMultilayerBitmaps = False

.DetectWatermark = True

.ExtractICCProfile = False

.ICCFileName = "C:\Test.icc"

.ImageIndex = 3

.LinkBitmapExternally = False

.MaintainLayers = True

.UseOPILinks = False

End With

' Import the jpeg file passing the import option structure

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportResampleOptions properties

StructImportResampleOptions     Legend

    CustomData
      DpiX
      DpiY
    FileName
    FilterID
      Height
      Width


StructImportResampleOptions

Class StructImportResampleOptions

Properties     Referenced By

 Related Topics


StructImportResampleOptions.CustomData

Property CustomData As Long

StructImportResampleOptions

Description

Read-Only

Example

The following example creates a new resample options class. It then imports a JPEG file and resamples it depending on the value for CustomData. Before it applies the resampling, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cResample."

Option Explicit

Implements IImportResampleHandler

Private Function IImportResampleHandler_Resample(ByVal Options As IStructImportResampleOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 8, then resample half of the original; otherwise 1.5

If Options.CustomData = 8 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Else

Options.Height = Options.Height / 1.5

Options.Width = Options.Width / 1.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testResample()

' Declare a new resample class.

Dim MyResampler As New cResample

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to resample.

io.Mode = cdrImportResample

' Set the custom data.

io.CustomData = 8

' Set the import options resample handler to the one created.

Set io.ResampleHandler = MyResampler

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportResampleOptions.DpiX

Property DpiX As Long

StructImportResampleOptions

Example

The following example creates a new resample options class. It then imports a JPEG file and resamples it depending on the value for CustomData. Before it applies the resampling, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cResample."

Option Explicit

Implements IImportResampleHandler

Private Function IImportResampleHandler_Resample(ByVal Options As IStructImportResampleOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 8, then resample half of the original; otherwise 1.5

If Options.CustomData = 8 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Else

Options.Height = Options.Height / 1.5

Options.Width = Options.Width / 1.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testResample()

' Declare a new resample class.

Dim MyResampler As New cResample

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to resample.

io.Mode = cdrImportResample

' Set the custom data.

io.CustomData = 8

' Set the import options resample handler to the one created.

Set io.ResampleHandler = MyResampler

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportResampleOptions.DpiY

Property DpiY As Long

StructImportResampleOptions

Example

The following example creates a new resample options class. It then imports a JPEG file and resamples it depending on the value for CustomData. Before it applies the resampling, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cResample."

Option Explicit

Implements IImportResampleHandler

Private Function IImportResampleHandler_Resample(ByVal Options As IStructImportResampleOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 8, then resample half of the original; otherwise 1.5

If Options.CustomData = 8 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Else

Options.Height = Options.Height / 1.5

Options.Width = Options.Width / 1.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testResample()

' Declare a new resample class.

Dim MyResampler As New cResample

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to resample.

io.Mode = cdrImportResample

' Set the custom data.

io.CustomData = 8

' Set the import options resample handler to the one created.

Set io.ResampleHandler = MyResampler

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportResampleOptions.FileName

Property FileName As String

StructImportResampleOptions

Description

Read-Only

Example

The following example creates a new resample options class. It then imports a JPEG file and resamples it depending on the value for CustomData. Before it applies the resampling, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cResample."

Option Explicit

Implements IImportResampleHandler

Private Function IImportResampleHandler_Resample(ByVal Options As IStructImportResampleOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 8, then resample half of the original; otherwise 1.5

If Options.CustomData = 8 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Else

Options.Height = Options.Height / 1.5

Options.Width = Options.Width / 1.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testResample()

' Declare a new resample class.

Dim MyResampler As New cResample

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to resample.

io.Mode = cdrImportResample

' Set the custom data.

io.CustomData = 8

' Set the import options resample handler to the one created.

Set io.ResampleHandler = MyResampler

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportResampleOptions.FilterID

Property FilterID As Long

StructImportResampleOptions

Description

Read-Only

Example

The following example creates a new resample options class. It then imports a JPEG file and resamples it depending on the value for CustomData. Before it applies the resampling, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cResample."

Option Explicit

Implements IImportResampleHandler

Private Function IImportResampleHandler_Resample(ByVal Options As IStructImportResampleOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 8, then resample half of the original; otherwise 1.5

If Options.CustomData = 8 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Else

Options.Height = Options.Height / 1.5

Options.Width = Options.Width / 1.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testResample()

' Declare a new resample class.

Dim MyResampler As New cResample

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to resample.

io.Mode = cdrImportResample

' Set the custom data.

io.CustomData = 8

' Set the import options resample handler to the one created.

Set io.ResampleHandler = MyResampler

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportResampleOptions.Height

Property Height As Long

StructImportResampleOptions

Example

The following example creates a new resample options class. It then imports a JPEG file and resamples it depending on the value for CustomData. Before it applies the resampling, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cResample."

Option Explicit

Implements IImportResampleHandler

Private Function IImportResampleHandler_Resample(ByVal Options As IStructImportResampleOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 8, then resample half of the original; otherwise 1.5

If Options.CustomData = 8 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Else

Options.Height = Options.Height / 1.5

Options.Width = Options.Width / 1.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testResample()

' Declare a new resample class.

Dim MyResampler As New cResample

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to resample.

io.Mode = cdrImportResample

' Set the custom data.

io.CustomData = 8

' Set the import options resample handler to the one created.

Set io.ResampleHandler = MyResampler

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructImportResampleOptions.Width

Property Width As Long

StructImportResampleOptions

Example

The following example creates a new resample options class. It then imports a JPEG file and resamples it depending on the value for CustomData. Before it applies the resampling, the original settings of the image are displayed.

Copy the following lines of code into a new Class Module named "cResample."

Option Explicit

Implements IImportResampleHandler

Private Function IImportResampleHandler_Resample(ByVal Options As IStructImportResampleOptions) As Boolean

Dim s As String

s = "Original Settings: " & vbCr

s = s & "DpiX:  " & Options.DpiX & vbCr

s = s & "DpiY:  " & Options.DpiY & vbCr

s = s & "FileName:  " & Options.FileName & vbCr

s = s & "Filter:  " & Options.FilterID & vbCr

' Display the original settings in a message box

MsgBox s

' If the custom data is set to 8, then resample half of the original; otherwise 1.5

If Options.CustomData = 8 Then

Options.Height = Options.Height / 2

Options.Width = Options.Width / 2

Else

Options.Height = Options.Height / 1.5

Options.Width = Options.Width / 1.5

End If

End Function

Copy the following subroutine into a regular module or ThisDocument.

Sub testResample()

' Declare a new resample class.

Dim MyResampler As New cResample

' Declare a new import options structure.

Dim io As New StructImportOptions

' Change the mode to resample.

io.Mode = cdrImportResample

' Set the custom data.

io.CustomData = 8

' Set the import options resample handler to the one created.

Set io.ResampleHandler = MyResampler

' Import the jpeg file passing the import option structure.

ActiveLayer.Import "C:\Test.jpg", , io

End Sub

 Related Topics


StructPaletteOptions properties

StructPaletteOptions     Legend

      ColorSensitive
      DitherIntensity
      DitherType
      Importance
      Lightness
      NumColors
      Palette
      PaletteType
      Smoothing
      TargetColor
      ToleranceA
      ToleranceB


StructPaletteOptions

Class StructPaletteOptions

Properties     Referenced By

The StructPaletteOptions class represents a set of options used when converting a full-color image into a paletted bitmap during export. This class is used in conjunction with the Document.ExportEx and Document.ExportBitmap commands.

You can create a new StructPaletteOptions object by using the New keyword in Visual Basic.

 Related Topics


StructPaletteOptions.ColorSensitive

Property ColorSensitive As Boolean

StructPaletteOptions

Description

The ColorSensitive property specifies whether color sensitivity is considered when building a palette.

Example

The following example exports the current page to a GIF image and ensures that the color blue is in the resulting palette.

Sub Test()

Dim pal As New StructPaletteOptions

Dim flt As ExportFilter

pal.NumColors = 10

pal.PaletteType = cdrPaletteOptimized

pal.ColorSensitive = True

pal.TargetColor = RGB(0, 0, 255)

pal.Importance = 200

pal.Lightness = 300

pal.ToleranceA = 100

pal.ToleranceB = 100

Set flt = ActiveDocument.ExportBitmap("C:\Temp\img.gif", cdrGIF, , cdrPalettedImage, PaletteOptions:=pal)

flt.Finish

End Sub

 Related Topics


StructPaletteOptions.DitherIntensity

Property DitherIntensity As Long

StructPaletteOptions

Description

The DitherIntensity specifies the dithering intensity when converting a bitmap to a paletted mode.

Example

The following example exports the image using Floyd dithering.

Sub Test()

Dim pal As New StructPaletteOptions

Dim flt As ExportFilter

pal.NumColors = 10

pal.PaletteType = cdrPaletteOptimized

pal.DitherType = cdrDitherFloyd

pal.DitherIntensity = 100

Set flt = ActiveDocument.ExportBitmap("C:\Temp\img.gif", cdrGIF, , cdrPalettedImage, PaletteOptions:=pal)

flt.Finish

End Sub

 Related Topics


StructPaletteOptions.DitherType

Property DitherType As cdrDitherType

StructPaletteOptions

Description

The DitherType specifies the type of dithering algorithm when converting a bitmap to a paletted mode.

Example

The following example exports the image using Floyd dithering.

Sub Test()

Dim pal As New StructPaletteOptions

Dim flt As ExportFilter

pal.NumColors = 10

pal.PaletteType = cdrPaletteOptimized

pal.DitherType = cdrDitherFloyd

pal.DitherIntensity = 100

Set flt = ActiveDocument.ExportBitmap("C:\Temp\img.gif", cdrGIF, , cdrPalettedImage, PaletteOptions:=pal)

flt.Finish

End Sub

 Related Topics


StructPaletteOptions.Importance

Property Importance As Long

StructPaletteOptions

Description

The Importance property specifies the target color importance when generating a palette.

Example

The following example exports the current page to a GIF image and ensures that the color blue is in the resulting palette.

Sub Test()

Dim pal As New StructPaletteOptions

Dim flt As ExportFilter

pal.NumColors = 10

pal.PaletteType = cdrPaletteOptimized

pal.ColorSensitive = True

pal.TargetColor = RGB(0, 0, 255)

pal.Importance = 200

pal.Lightness = 300

pal.ToleranceA = 100

pal.ToleranceB = 100

Set flt = ActiveDocument.ExportBitmap("C:\Temp\img.gif", cdrGIF, , cdrPalettedImage, PaletteOptions:=pal)

flt.Finish

End Sub

 Related Topics


StructPaletteOptions.Lightness

Property Lightness As Long

StructPaletteOptions

Description

The following example specifies sensitivity for lightness when generating a palette.

Example

The following example exports the current page to a GIF image and ensures that the color blue is in the resulting palette.

Sub Test()

Dim pal As New StructPaletteOptions

Dim flt As ExportFilter

pal.NumColors = 10

pal.PaletteType = cdrPaletteOptimized

pal.ColorSensitive = True

pal.TargetColor = RGB(0, 0, 255)

pal.Importance = 200

pal.Lightness = 300

pal.ToleranceA = 100

pal.ToleranceB = 100

Set flt = ActiveDocument.ExportBitmap("C:\Temp\img.gif", cdrGIF, , cdrPalettedImage, PaletteOptions:=pal)

flt.Finish

End Sub

 Related Topics


StructPaletteOptions.NumColors

Property NumColors As Long

StructPaletteOptions

Description

The following example specifies the maximum number of colors that can be added to the image palette.

The actual number of colors may be less than the specified number

Example

The following example exports the image using a 16-color optimized palette.

Sub Test()

Dim pal As New StructPaletteOptions

Dim flt As ExportFilter

pal.NumColors = 16

pal.PaletteType = cdrPaletteOptimized

Set flt = ActiveDocument.ExportBitmap("C:\Temp\img.gif", cdrGIF, , cdrPalettedImage, PaletteOptions:=pal)

flt.Finish

End Sub

 Related Topics


StructPaletteOptions.Palette

Property Palette As Variant

StructPaletteOptions

Description

The Palette property specifies the palette when exporting a full-color image to a paletted bitmap.

Examples

The following example exports a document with the new custom color palette.

Sub Test()

Dim d As Document

Dim e As ExportFilter

Dim s As Shape

Dim sp As New StructPaletteOptions

Dim p As Palette

Set d = CreateDocument

Set s = d.ActiveLayer.CreateRectangle(3, 3, 7, 7)

s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(0, 0, 255)

' Change the palette type to custom.

sp.PaletteType = cdrPaletteCustom

' Create a new palette and add some colors.

Set p = Palettes.Create("Temp")

p.AddColor CreateRGBColor(255, 0, 0)

p.AddColor CreateRGBColor(0, 0, 255)

p.AddColor CreateRGBColor(0, 255, 0)

' Set the palette to use for the export to the newly created palette.

sp.Palette = p

d.Export "C:\Test_ExportPalette_Passing_a_Palette.gif", cdrGIF, , , sp

End Sub

The following example exports a document with a custom palette that is identified by its path and filename.

Sub Test()

Dim d As Document

Dim e As ExportFilter

Dim s As Shape

Dim sp As New StructPaletteOptions

Set d = CreateDocument

Set s = d.ActiveLayer.CreateRectangle(3, 3, 7, 7)

s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(0, 0, 255)

' Change the palette type to custom.

sp.PaletteType = cdrPaletteCustom

' Set the palette to use for the export to the filename of the existing palette.

sp.Palette = SetupPath & "Custom Data\Palettes\CMYK\Nature\cEarthy.cpl"

d.Export "C:\Test_ExportPalette_Passing_a_Filename.gif", cdrGIF, , , sp

End Sub

The following example exports a document with a custom palette that is defined by an array of long values (which represent colors).

Sub Test()

Dim d As Document

Dim e As ExportFilter

Dim s As Shape

Dim sp As New StructPaletteOptions

Set d = CreateDocument

Set s = d.ActiveLayer.CreateRectangle(3, 3, 7, 7)

s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(0, 0, 255)

' Change the palette type to custom.

sp.PaletteType = cdrPaletteCustom

' Set the palette to use for the export to an array of longs which represent the colors to use.

sp.Palette = Array(RGB(255, 0, 0), RGB(0, 0, 255), RGB(125, 0, 0), RGB(0, 0, 125), RGB(155, 0, 0), RGB(0, 0, 155), RGB(175, 32, 175))

d.Export "C:\Test_ExportPalette_Passing_an_array_of_longs.gif", cdrGIF, , , sp

End Sub

The following example exports a document with a custom palette that is defined by an array of colors.

Sub Test()

Dim d As Document

Dim e As ExportFilter

Dim s As Shape

Dim sp As New StructPaletteOptions

Set d = CreateDocument

Set s = d.ActiveLayer.CreateRectangle(3, 3, 7, 7)

s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(0, 0, 255)

' Change the palette type to custom

sp.PaletteType = cdrPaletteCustom

' Set the palette to use for the export to an array of colors

sp.Palette = Array(CreateCMYKColor(0, 77, 23, 23), CreateCMYKColor(10, 23, 43, 54), CreateCMYKColor(54, 12, 88, 12))

d.Export "C:\Test_ExportPalette_Passing_an_array_of_colors.gif", cdrGIF, , , sp

End Sub

 Related Topics


StructPaletteOptions.PaletteType

Property PaletteType As cdrImagePaletteType

StructPaletteOptions

Description

The PaletteType property specifies the type of palette to use.

You can specify one of the predefined palettes (Windows, Internet Explorer, Netscape, Black Body, or VGA), or generate a new optimized, uniform, or adaptive palette.

Example

The following example exports the drawing using the Netscape Web-safe palette.

Sub Test()

Dim pal As New StructPaletteOptions

Dim flt As ExportFilter

pal.PaletteType = cdrPaletteNetscape

Set flt = ActiveDocument.ExportBitmap("C:\Temp\img.gif", cdrGIF, , cdrPalettedImage, PaletteOptions:=pal)

flt.Finish

End Sub

 Related Topics


StructPaletteOptions.Smoothing

Property Smoothing As Long

StructPaletteOptions

Description

The Smoothing property specifies the amount of smoothing of color transitions to minimize abrupt color changes.

Example

The following example exports the drawing to a GIF file using a 32-color optimized palette, and applies a smoothing of 50% to the image.

Sub Test()

Dim pal As New StructPaletteOptions

Dim flt As ExportFilter

pal.NumColors = 32

pal.PaletteType = cdrPaletteOptimized

pal.Smoothing = 50

Set flt = ActiveDocument.ExportBitmap("C:\Temp\img.gif", cdrGIF, , cdrPalettedImage, PaletteOptions:=pal)

flt.Finish

End Sub

 Related Topics


StructPaletteOptions.TargetColor

Property TargetColor As Long

StructPaletteOptions

Description

The TargetColor property is a value that represents an RGB color to be used as a color target when generating a palette. You can use the RGB function in Visual Basic to build the color value.

Example

The following example exports the current page to a GIF image and ensures that the color blue is in the resulting palette.

Sub Test()

Dim pal As New StructPaletteOptions

Dim flt As ExportFilter

pal.NumColors = 10

pal.PaletteType = cdrPaletteOptimized

pal.ColorSensitive = True

pal.TargetColor = RGB(0, 0, 255)

pal.Importance = 200

pal.Lightness = 300

pal.ToleranceA = 100

pal.ToleranceB = 100

Set flt = ActiveDocument.ExportBitmap("C:\Temp\img.gif", cdrGIF, , cdrPalettedImage, PaletteOptions:=pal)

flt.Finish

End Sub

 Related Topics


StructPaletteOptions.ToleranceA

Property ToleranceA As Long

StructPaletteOptions

Description

The ToleranceA property specifies the sensitivity for the A color component when generating a palette.

Example

The following example exports the current page to a GIF image and ensures that the color blue is in the resulting palette.

Sub Test()

Dim pal As New StructPaletteOptions

Dim flt As ExportFilter

pal.NumColors = 10

pal.PaletteType = cdrPaletteOptimized

pal.ColorSensitive = True

pal.TargetColor = RGB(0, 0, 255)

pal.Importance = 200

pal.Lightness = 300

pal.ToleranceA = 100

pal.ToleranceB = 100

Set flt = ActiveDocument.ExportBitmap("C:\Temp\img.gif", cdrGIF, , cdrPalettedImage, PaletteOptions:=pal)

flt.Finish

End Sub

 Related Topics


StructPaletteOptions.ToleranceB

Property ToleranceB As Long

StructPaletteOptions

Description

The ToleranceB property specifies the sensitivity for the B color component when generating a palette.

Example

The following example exports the current page to a GIF image and ensures that the color blue is in the resulting palette.

Sub Test()

Dim pal As New StructPaletteOptions

Dim flt As ExportFilter

pal.NumColors = 10

pal.PaletteType = cdrPaletteOptimized

pal.ColorSensitive = True

pal.TargetColor = RGB(0, 0, 255)

pal.Importance = 200

pal.Lightness = 300

pal.ToleranceA = 100

pal.ToleranceB = 100

Set flt = ActiveDocument.ExportBitmap("C:\Temp\img.gif", cdrGIF, , cdrPalettedImage, PaletteOptions:=pal)

flt.Finish

End Sub

 Related Topics


StructSaveAsOptions properties

StructSaveAsOptions     Legend

      EmbedICCProfile
      EmbedVBAProject
      Filter
      IncludeCMXData
      Overwrite
      Range
      ThumbnailSize
      Version


StructSaveAsOptions

Class StructSaveAsOptions

Properties     Referenced By

The StructSaveAsOptions class represents saving options for a document. This class is used in conjunction with the SaveAs command.

You can create a StructSaveAsOptions object by using the New keyword in Visual Basic.

 Related Topics


StructSaveAsOptions.EmbedICCProfile

Property EmbedICCProfile As Boolean

StructSaveAsOptions

Description

The EmbedICCProfile property returns or sets whether an ICC profile is embedded in the document when it is saved.

Example

The following example saves the active document to a file. The VBA Project is included in the file; however, an ICC color profile and a CMX data stream are not saved.

Sub Test()

Dim so As New StructSaveAsOptions

so.EmbedICCProfile = False

so.EmbedVBAProject = True

so.IncludeCMXData = False

ActiveDocument.SaveAs "C:\Temp\File.cdr", so

End Sub

 Related Topics


StructSaveAsOptions.EmbedVBAProject

Property EmbedVBAProject As Boolean

StructSaveAsOptions

Description

The EmbedVBAProject property returns or sets whether the VBA project associated with the document is saved when the document is saved.

Example

The following example saves the active document to a file. The VBA Project is included in the file; however, an ICC color profile and a CMX data stream are not saved.

Sub Test()

Dim so As New StructSaveAsOptions

so.EmbedICCProfile = False

so.EmbedVBAProject = True

so.IncludeCMXData = False

ActiveDocument.SaveAs "C:\Temp\File.cdr", so

End Sub

 Related Topics


StructSaveAsOptions.Filter

Property Filter As cdrFilter

StructSaveAsOptions

Description

The Filter property returns or sets the format that is used when saving a document.

For saving documents in formats other than CDR and CMX, use the ExportEx or ExportBitmap functions.

The Filter property returns a value of cdrFilter.

Example

The following example saves the current document in a CMX file with a 5K color thumbnail.

Sub Test()

Dim so As New StructSaveAsOptions

so.Filter = cdrCMX6

so.ThumbnailSize = cdr5KColorThumbnail

ActiveDocument.SaveAs "C:\Temp\File.cmx", so

End Sub

 Related Topics


StructSaveAsOptions.IncludeCMXData

Property IncludeCMXData As Boolean

StructSaveAsOptions

Description

The IncludeCMXData property returns or sets whether the saved document also includes a duplicate data stream in CMX format.

Example

The following example saves the active document to a file. The VBA Project is included in the file; however, an ICC color profile and a CMX data stream are not saved.

Sub Test()

Dim so As New StructSaveAsOptions

so.EmbedICCProfile = False

so.EmbedVBAProject = True

so.IncludeCMXData = False

ActiveDocument.SaveAs "C:\Temp\File.cdr", so

End Sub

 Related Topics


StructSaveAsOptions.Overwrite

Property Overwrite As Boolean

StructSaveAsOptions

Description

The Overwrite property returns or sets wheter an existing file with the specified name will be overwritten. The default value of the property is True.

If the file with the given name already exists and this property is set to False, the save operation fails.

Example

The following example will fail while saving the active document if the file file.cdr already exists in the folder C:\Temp.

Sub Test()

Dim so As New StructSaveAsOptions

so.Overwrite = False

ActiveDocument.SaveAs "C:\Temp\File.cdr", so

End Sub

 Related Topics


StructSaveAsOptions.Range

Property Range As cdrExportRange

StructSaveAsOptions

Description

The Range property returns or sets which part or parts of the document are saved.

The available options for this property are: current selection, current page, and whole document.

The Range property returns a value of cdrExportRange.

Example

The following example saves only the selected objects.

Sub Test()

Dim so As New StructSaveAsOptions

so.Range = cdrSelection

ActiveDocument.SaveAs "C:\Temp\File.cdr", so

End Sub

 Related Topics


StructSaveAsOptions.ThumbnailSize

Property ThumbnailSize As cdrThumbnailSize

StructSaveAsOptions

Description

The ThumbnailSize property returns or sets the size of a thumbnail when saving a CDR or CMX file.

The available options for this property are: no thumbnail, 1 KB monochrome, 5 KB color, and 10 KB color bitmap.

Including a thumbnail when you save a file lets you see a representation of the drawing before you open it in a different application, such as Corel VENTURA. A thumbnail of the drawing is displayed in the Open dialog box of the other application and lets you verify that you have chosen the right file before you continue.

The ThumbnailSize property returns a value of cdrThumbnailSize.

Example

The following example saves the current document to a file. The document is saved without a thumbnail.

Sub Test()

Dim so As New StructSaveAsOptions

so.ThumbnailSize = cdrNoThumbnail

ActiveDocument.SaveAs "C:\Temp\File.cdr", so

End Sub

 Related Topics


StructSaveAsOptions.Version

Property Version As cdrFileVersion

StructSaveAsOptions

Description

The Version property returns or sets the CDR file version when saving a document. It is possible to save the document in previous versions of CorelDRAW. You can save the file in the format for CorelDRAW 5 or later.

This property returns a value of cdrFileVersion.

Example

The following example saves the active document as a CorelDRAW 7 document.

Sub Test()

Dim so As New StructSaveAsOptions

so.Version = cdrVersion7

ActiveDocument.SaveAs "C:\Temp\File7.cdr", so

End Sub

 Related Topics


StructSpaceProperties properties

StructSpaceProperties     Legend

      AfterParagraphSpacing
      BeforeParagraphSpacing
      CharacterSpacing
      LineSpacing
      LineSpacingType
      WordSpacing


StructSpaceProperties

Class StructSpaceProperties

Properties     Referenced By

The StructSpaceProperties class represents the spacing settings of a text block.

You can create a StructSpaceProperties object by using the New keyword in Visual Basic.

 Related Topics


StructSpaceProperties.AfterParagraphSpacing

Property AfterParagraphSpacing As Single

StructSpaceProperties

Description

The AfterParagraphSpacing property returns or sets the amount of space after the last line of a paragraph.

The AfterParagraphSpacing value can vary in range depending on the type of paragraph spacing selected with the LineSpacingType property. For example, spacing can be measured as a percentage of character height, points, or a percentage of point size.

Example

The following example specifies a line spacing of 120% of the font size, spacing before paragraphs of 100%, and spacing after paragraphs of 50%.

Sub Test()

With ActiveShape.Text.SpaceProperties

.LineSpacingType = cdrPercentOfPointSizeLineSpacing

.LineSpacing = 120

.BeforeParagraphSpacing = 100

.AfterParagraphSpacing = 50

End With

End Sub

 Related Topics


StructSpaceProperties.BeforeParagraphSpacing

Property BeforeParagraphSpacing As Single

StructSpaceProperties

Description

The BeforeParagraphSpacing property returns or sets the amount of space before the first line of a paragraph.

The BeforeParagraphSpacing value can vary in range depending on the type of paragraph spacing selected with the LineSpacingType property. For example, spacing can be measured as a percentage of character height, points, or a percentage of point size.

Example

The following example specifies a line spacing of 120% of the font size, spacing before paragraphs of 100%, and spacing after paragraphs of 50%.

Sub Test()

With ActiveShape.Text.SpaceProperties

.LineSpacingType = cdrPercentOfPointSizeLineSpacing

.LineSpacing = 120

.BeforeParagraphSpacing = 100

.AfterParagraphSpacing = 50

End With

End Sub

 Related Topics


StructSpaceProperties.CharacterSpacing

Property CharacterSpacing As Single

StructSpaceProperties

Description

The CharacterSpacing property returns or sets the amount of space between characters in text. This value represents a percentage of the space character (the space inserted when you press the Spacebar). The maximum percentage value is 2000; the minimum percentage value is -100.

The value set with the CharacterSpacing property cannot exceed the maximum character spacing limit that is set with the MaxCharacterSpacing property.

Example

The following example specifies word spacing of 200% and character spacing of 10% for the selected text object.

Sub Test()

With ActiveShape.Text.SpaceProperties

.WordSpacing = 200

.CharacterSpacing = 10

End With

End Sub

 Related Topics


StructSpaceProperties.LineSpacing

Property LineSpacing As Single

StructSpaceProperties

Description

The LineSpacing property returns or sets the amount of space between lines (the leading) of text.

The LineSpacing value can vary in range depending on the type of line spacing selected with the LineSpacingType property. For example, line spacing can be measured as a percentage of character height, points, or a percentage of point size.

Example

The following example specifies a line spacing of 120% of the font size, spacing before paragraphs of 100%, and spacing after paragraphs of 50%.

Sub Test()

With ActiveShape.Text.SpaceProperties

.LineSpacingType = cdrPercentOfPointSizeLineSpacing

.LineSpacing = 120

.BeforeParagraphSpacing = 100

.AfterParagraphSpacing = 50

End With

End Sub

 Related Topics


StructSpaceProperties.LineSpacingType

Property LineSpacingType As cdrLineSpacingType

StructSpaceProperties

Description

The LineSpacingType property returns or sets the units used with the BeforeParagraphSpacing, AfterParagraphSpacing, and LineSpacing properties.

The LineSpacingType property returns a value of cdrLineSpacingType.

Example

The following example specifies a line spacing of 120% of the font size, spacing before paragraphs of 100%, and spacing after paragraphs of 50%.

Sub Test()

With ActiveShape.Text.SpaceProperties

.LineSpacingType = cdrPercentOfPointSizeLineSpacing

.LineSpacing = 120

.BeforeParagraphSpacing = 100

.AfterParagraphSpacing = 50

End With

End Sub

 Related Topics


StructSpaceProperties.WordSpacing

Property WordSpacing As Single

StructSpaceProperties

Description

The WordSpacing property returns or sets the amount of space between words in text. .This value represents a percentage of the space character (the space inserted when you press Spacebar). The maximum percentage value is 2000; the minimum percentage value is 0.

The value set with the WordSpacing property cannot exceed the maximum or minimum word spacing limits that are set with the MaxWordSpacing and MinWordSpacing properties.

Example

The following example specifies word spacing of 200% and character spacing of 10% for the selected text object.

Sub Test()

With ActiveShape.Text.SpaceProperties

.WordSpacing = 200

.CharacterSpacing = 10

End With

End Sub

 Related Topics


SubPath properties

SubPath     Legend

    Application
      Closed
    EndNode
    FirstSegment
    Index
    LastSegment
    Length
    Nodes
    Parent
      PositionX
      PositionY
    Segments
    SizeHeight
    SizeWidth
    StartNode


SubPath methods

SubPath     Legend

   AddNodeAt
   AppendCurveSegment
   AppendCurveSegment2
   AppendLineSegment
   BreakApartAt
   Delete
   Extract
   FindSegmentOffset
   GetCopy
   GetCurvatureAt
   GetCurveSpeedAt
   GetIntersections
   GetPerpendicularAt
   GetPointPositionAt
   GetPosition
   GetSegmentAt
   GetTangentAt
   IsOnSubPath
   Move
   Next
   Previous
   ReverseDirection
   Selection
   SetPosition


SubPath

Class SubPath

Properties     Methods     Referenced By

The Subpath class represents a subpath in a curve.

 Related Topics


SubPath.Application

Property Application As Application

SubPath

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


SubPath.Closed

Property Closed As Boolean

SubPath

Description

The Closed property returns or sets whether a curve's subpath is opened or closed.

If the Closed property is True, the subpath is closed, and the path's start and end points are connected, enclosing an area.

Example

The following example closes all subpaths in the selected curve are closed.

Sub Test()

Dim spath As SubPath

For Each spath In ActiveShape.Curve.Subpaths

spath.Closed = True

Next spath

End Sub

 Related Topics


SubPath.EndNode

Property EndNode As Node

SubPath

Description

The EndNode property returns the first Node of a subpath.

Read-Only

Example

The following example connects all open subpaths to each other, forming a single and larger closed subpath.

Sub Test()

Dim crv As Curve

Dim spath As SubPath, spath1 As SubPath

Set crv = ActiveShape.Curve

Set spath = crv.Subpaths(1)

Do

If Not spath.Closed Then

Set spath1 = spath.Next

Do

If Not spath1.Closed Then Exit Do

Set spath1 = spath1.Next

Loop

spath.EndNode.ConnectWith spath1.StartNode

Else

Set spath = spath.Next

If spath.Index = 1 Then Exit Do

End If

Loop

End Sub

 Related Topics


SubPath.FirstSegment

Property FirstSegment As Segment

SubPath

Description

The FirstSegment property returns the first Segment of a subpath.

Read-Only

Example

The following example converts the first segment of the first subpath of the selected curve to a line.

Sub Test()

ActiveShape.Curve.Subpaths(1).FirstSegment.Type = cdrLineSegment

End Sub

 Related Topics


SubPath.Index

Property Index As Long

SubPath

Description

The Index property returns the index number of a curve's subpath.

Read-Only

Example

The following example place a number next to each subpath.

Sub Test()

Dim spath As SubPath

Dim x As Double, y As Double, a As Double

Dim s As Shape

For Each spath In ActiveShape.Curve.Subpaths

spath.GetPointPositionAt 0.5, cdrRelativeSegmentOffset, x, y

a = spath.GetPerpendicularAt(0.5, cdrRelativeSegmentOffset)

If a < 0 Or a > 180 Then a = a + 180

a = a * 3.1415926 / 180

x = x + 0.2 * Cos(a)

y = y + 0.2 * Sin(a)

Set s = ActiveLayer.CreateArtisticText(x, y, CStr(spath.Index))

With s.Text

.AlignProperties.Alignment = cdrCenterAlignment

.FontProperties.Name = "Arial"

.FontProperties.Size = 18

End With

Next spath

End Sub

 Related Topics


SubPath.LastSegment

Property LastSegment As Segment

SubPath

Description

The LastSegment property returns the last Segment of a subpath.

Read-Only

Example

The following example converts the last segment of the first subpath of the selected curve to a line.

Sub Test()

ActiveShape.Curve.Subpaths(1).LastSegment.Type = cdrLineSegment

End Sub

 Related Topics


SubPath.Length

Property Length As Double

SubPath

Description

The Length property returns the length of a curve's subpath. The Length property is measured in document units.

Read-Only

Example

The following example uses the index value of two to identify the second subpath in the active shape. The length, in document units, of this subpath displays in a message box.

Sub App()

MsgBox ActiveShape.Curve.Subpaths(1).Length

End Sub

 Related Topics


SubPath.Nodes

Property Nodes As Nodes

SubPath

Description

The Nodes property returns a Nodes collection which contains all nodes on a subpath.

Read-Only

Example

The following example converts the type all nodes on the first subpath to symmetrical.

Sub Test()

Dim n As Node

For Each n In ActiveShape.Curve.Subpaths(1).Nodes

n.Type = cdrSymmetricalNode

Next n

End Sub

 Related Topics


SubPath.Parent

Property Parent As Curve

SubPath

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


SubPath.PositionX

Property PositionX As Double

SubPath

Description

The PositionX property returns or sets the horizontal position, or x-coordinate, of a subpath's starting point, as if it were a separate shape object. The position is relative to a reference point specified by the Document.ReferencePoint property.

Example

The following example aligns all subpaths horizontally so that their left sides are two inches from the left edge of the page.

Sub Test()

Dim sp As SubPath

ActiveDocument.ReferencePoint = cdrTopLeft

For Each sp In ActiveShape.Curve.Subpaths

sp.PositionX = 2

Next sp

End Sub

 Related Topics


SubPath.PositionY

Property PositionY As Double

SubPath

Description

The PositionY property returns or sets the vertical position, or y-coordinate, of a subpath's starting point, as if it were a separate shape object. The position is relative to a reference point specified by the Document.ReferencePoint property.

Example

The following example aligns all subpaths vertically so that their top sides are three document units from the bottom of the page.

Sub Test()

Dim sp As SubPath

ActiveDocument.ReferencePoint = cdrTopLeft

For Each sp In ActiveShape.Curve.Subpaths

sp.PositionY = 3

Next sp

End Sub

 Related Topics


SubPath.Segments

Property Segments As Segments

SubPath

Description

The Segments property returns a Segments collection which contains all segments of the subpath.

Read-Only

Example

The following example converts all segments in the first subpath to lines.

Sub Test()

Dim seg As Segment

For Each seg In ActiveShape.Curve.Subpaths(1).Segments

seg.Type = cdrLineSegment

Next seg

End Sub

 Related Topics


SubPath.SizeHeight

Property SizeHeight As Double

SubPath

Description

The SizeHeight property returns the vertical size of a subpath as if it were a separate shape object. This property is measured in document units.

Read-Only

Example

The following example draws a bounding rectangle around each subpath in the selected curve.

Sub Test()

Dim sp As SubPath

Dim x As Double, y As Double

ActiveDocument.ReferencePoint = cdrBottomLeft

For Each sp In ActiveShape.Curve.Subpaths

sp.GetPosition x, y

ActiveLayer.CreateRectangle2 x, y, sp.SizeWidth, sp.SizeHeight

Next sp

End Sub

 Related Topics


SubPath.SizeWidth

Property SizeWidth As Double

SubPath

Description

The SizeWidth property returns the horizontal size of a subpath as if it were a separate shape object. This property is measured in document units.

Read-Only

Example

The following example draws a bounding rectangle around each subpath in the selected curve.

Sub Test()

Dim sp As SubPath

Dim x As Double, y As Double

ActiveDocument.ReferencePoint = cdrBottomLeft

For Each sp In ActiveShape.Curve.Subpaths

sp.GetPosition x, y

ActiveLayer.CreateRectangle2 x, y, sp.SizeWidth, sp.SizeHeight

Next sp

End Sub

 Related Topics


SubPath.StartNode

Property StartNode As Node

SubPath

Description

The StartNode property returns the first Node of a subpath.

Read-Only

Example

The following example connects all open subpaths to each other, forming a single and larger closed subpath.

Sub Test()

Dim crv As Curve

Dim spath As SubPath, spath1 As SubPath

Set crv = ActiveShape.Curve

Set spath = crv.Subpaths(1)

Do

If Not spath.Closed Then

Set spath1 = spath.Next

Do

If Not spath1.Closed Then Exit Do

Set spath1 = spath1.Next

Loop

spath.EndNode.ConnectWith spath1.StartNode

Else

Set spath = spath.Next

If spath.Index = 1 Then Exit Do

End If

Loop

End Sub

 Related Topics


SubPath.AddNodeAt

Function AddNodeAt([ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrRelativeSegmentOffset (1)]) As Node

SubPath

Description

The AddNodeAt method inserts a node at a given point along a subpath.

An absolute or relative offset from the beginning of the subpath can be specified.

Parameters	Description

Offset	Specifies the offset distance, in document units, of the new node [in]
Optional
Default value = 0.5

OffsetType	Specifies the type of offset.. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrRelativeSegmentOffset (1)

Return value

Returns Node

Example

The following example adds a new node to the middle of each subpath.

Sub Test()

Dim sp As SubPath

For Each sp In ActiveShape.Curve.Subpaths

sp.AddNodeAt 0.5, cdrRelativeSegmentOffset

Next sp

End Sub

 Related Topics


SubPath.AppendCurveSegment

Function AppendCurveSegment(ByVal X As Double, ByVal Y As Double, [ByVal StartingControlPointLength As Double = -1], [ByVal StartingControlPointAngle As Double = 0], [ByVal EndingControlPointLength As Double = -1], [ByVal EndingControlPointAngle As Double = 0], [ByVal AppendAtBeginning As Boolean = False]) As Segment

SubPath

Description

The AppendCurveSegment method joins a new curve segment to the beginning or the end of an open subpath.

Parameters	Description

X	Specifies the horizontal position of the new line segment that is appended to the subpath object. The x-coordinate is measured in document units. [in]

Y	Specifies the vertical position of the new line segment that is appended to the subpath object. The y-coordinate is measured in document units. [in]

StartingControlPointLength	Specifies the distance from the node that lies between the new appended curve segment and the existing curve's subpath object. The length is measured in document units. [in]
Optional
Default value = -1

StartingControlPointAngle	Specifies the angle, measured in degrees, of the starting control point. [in]
Optional
Default value = 0

EndingControlPointLength	Specifies the distance from the node that lies between the new appended curve segment and the existing curve's subpath object. The length is measured in document units. [in]
Optional
Default value = -1

EndingControlPointAngle	Specifies the angle, measured in degrees, of the ending control point [in]
Optional
Default value = 0

AppendAtBeginning	Specifies whether the new line segment joins the subpath at the head of the subpath object [in]
Optional
Default value = False

Return value

Returns Segment

Example

The following example creates a closed curve and applies a fountain fill to it.

Sub Test()

Dim s As Shape

Dim crv As Curve

Dim sp As SubPath

Dim c As New Color

Set crv = CreateCurve(ActiveDocument)

Set sp = crv.CreateSubPath(0, 0)

sp.AppendLineSegment 3.6, 0, False

sp.AppendCurveSegment 3.6, 0.8, 0.43, 160, 0.43, -160, False

sp.AppendLineSegment 0, 0.8, False

sp.AppendCurveSegment 0, 0, 0.43, -20, 0.43, 20, False

sp.Closed = True

Set s = ActiveLayer.CreateCurve(crv)

c.CMYKAssign 0, 0, 0, 100

With s.Fill.ApplyFountainFill(c, c, , 90, , , , cdrCustomFountainFillBlend).Colors

.Add CreateCMYKColor(0, 0, 0, 0), 70

End With

End Sub

 Related Topics


SubPath.AppendCurveSegment2

Function AppendCurveSegment2(ByVal X As Double, ByVal Y As Double, ByVal StartingControlPointX As Double, ByVal StartingControlPointY As Double, ByVal EndingControlPointX As Double, ByVal EndingControlPointY As Double, [ByVal AppendAtBeginning As Boolean = False]) As Segment

SubPath

Description

The AppendCurveSegment2 method appends a new curve segment to the subpath.

Parameters	Description

X	Specifies the horizontal position of the new line segment that is appended to the subpath object. The x-coordinate is measured in document units. [in]

Y	Specifies the vertical position of the new line segment that is appended to the subpath object. The y-coordinate is measured in document units. [in]

StartingControlPointX	Specifies the horizontal position of the starting control point [in]

StartingControlPointY	Specifies the vertical position of the starting control point [in]

EndingControlPointX	Specifies the horizontal position of the ending control point [in]

EndingControlPointY	Specifies the vertical position of the ending control point [in]

AppendAtBeginning	Specifies whether the new line segment joins the subpath at the head of the subpath object [in]
Optional
Default value = False

Return value

Returns Segment

Example

The following example creates a closed curve and applies a fountain fill to it.

Sub Test()

Dim s As Shape

Dim crv As Curve

Dim sp As SubPath

Dim c As New Color

Set crv = CreateCurve(ActiveDocument)

Set sp = crv.CreateSubPath(0, 0)

sp.AppendLineSegment 3.6, 0, False

sp.AppendCurveSegment2 3.6, 0.8, 4.6, 3.1, 5.43, -1.6, False

sp.AppendLineSegment 0, 0.8, False

sp.AppendCurveSegment2 5, 4.8, 5, -2, 2, -5, False

sp.Closed = True

Set s = ActiveLayer.CreateCurve(crv)

c.CMYKAssign 0, 0, 0, 100

With s.Fill.ApplyFountainFill(c, c, , 90, , , , cdrCustomFountainFillBlend).Colors

.Add CreateCMYKColor(0, 0, 0, 0), 70

End With

End Sub

 Related Topics


SubPath.AppendLineSegment

Function AppendLineSegment(ByVal X As Double, ByVal Y As Double, [ByVal AppendAtBeginning As Boolean = False]) As Segment

SubPath

Description

The AppendLineSegment method joins a new line segment to the beginning or the end of an open subpath.

Parameters	Description

X	Specifies the horizontal position of the new line segment that is appended to the subpath. The x-coordinate is measured in document units. [in]

Y	Specifies the vertical position of the new line segment that is appended to the subpath. The y-coordinate is measured in document units. [in]

AppendAtBeginning	Specifies whether the new line segment joins the subpath at the head of the subpath. [in]
Optional
Default value = False

Return value

Returns Segment

Example

The following example creates a closed curve and applies a fountain fill to it.

Sub Test()

Dim s As Shape

Dim crv As Curve

Dim sp As SubPath

Dim c As New Color

Set crv = CreateCurve(ActiveDocument)

Set sp = crv.CreateSubPath(0, 0)

sp.AppendLineSegment 3.6, 0, False

sp.AppendCurveSegment 3.6, 0.8, 0.43, 160, 0.43, -160, False

sp.AppendLineSegment 0, 0.8, False

sp.AppendCurveSegment 0, 0, 0.43, -20, 0.43, 20, False

sp.Closed = True

Set s = ActiveLayer.CreateCurve(crv)

c.CMYKAssign 0, 0, 0, 100

With s.Fill.ApplyFountainFill(c, c, , 90, , , , cdrCustomFountainFillBlend).Colors

.Add CreateCMYKColor(0, 0, 0, 0), 70

End With

End Sub

 Related Topics


SubPath.BreakApartAt

Function BreakApartAt([ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrRelativeSegmentOffset (1)]) As Node

SubPath

Description

The BreakApartAt method separates a subpath into two subpaths at the specified offset from its beginning.

Parameters	Description

Offset	Specifies the offset distance, in document units [in]
Optional
Default value = 0.5

OffsetType	Specifies the type of offset. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrRelativeSegmentOffset (1)

Return value

Returns Node

Example

The following example breaks the subpath apart at 1.2" from its beginning.

Sub Test()

ActiveShape.Curve.Subpaths(1).BreakApartAt 1.2, cdrAbsoluteSegmentOffset

End Sub

 Related Topics


SubPath.Delete

Sub Delete()

SubPath

Description

The Delete method removes a subpath from a curve. If this is the last subpath of the curve, the curve is also destroyed.

Example

The following example creates a large letter "B" on the page, converts it to curves, and deletes the inner "holes" of it, leaving only the outside contour.

Sub Test()

Dim s As Shape

Dim sgr As SegmentRange

Set s = ActiveLayer.CreateArtisticText(0, 0, "B")

With s.Text.FontProperties

.Name = "Arial Black"

.Size = 200

End With

s.ConvertToCurves

s.Curve.Subpaths(3).Delete

s.Curve.Subpaths(2).Delete

End Sub

 Related Topics


SubPath.Extract

Function Extract([ByRef OldCurve As Shape = Nothing]) As Shape

SubPath

Description

The Extract method removes a subpath from a curve and creates a separate shape from the extracted subpath.

The original curve is modified and cannot be accessed through its previous reference. The new reference to the original curve after the extraction is returned though the OldShape parameter of the Extract method.

Parameters	Description

OldCurve	References the original curve after the extraction. The OldCurve parameter returns a shape object. [out]
Optional
Default value = Nothing

Return value

Returns Shape

Example

The following example extracts each subpath from a curve and changes the outline color of each extracted curve.

Sub Test()

Dim spath As SubPath

Dim s As Shape, sExt As Shape

Dim i As Long

Set s = ActiveShape

If s.Curve.Subpaths.Count < 2 Then Exit Sub

For i = s.Curve.Subpaths.Count To 1 Step -1

Set spath = s.Curve.Subpaths(i)

Set sExt = spath.Extract(s)

sExt.Outline.Width = 0.01

sExt.Outline.Color = ActivePalette.Color(13 + i)

Next i

End Sub

 Related Topics


SubPath.FindSegmentOffset

Function FindSegmentOffset(ByVal AbsoluteOffset As Double, ByRef Segment As Segment, ByRef ParamOffset As Double, [ByRef Remainder As Double = 0]) As Boolean

SubPath

Description

The FindSegmentOffset method finds a segment, and the offset for a specified point on a subpath belonging to the segment.

If the offset is longer than the length of the subpath, the function returns False, and the remaining offset is returned in the Remainder parameter. Otherwise, the function returns True, and the ParamOffset parameter returns the parametric offset for the subpath.

Parameters	Description

AbsoluteOffset	Lets you specify the absolute offset value [in]

Segment	Identifies the segment [out]

ParamOffset	Specifies the parametric offset value [out]

Remainder	Returns the value of the remainder [out]
Optional
Default value = 0

Return value

Returns Boolean

Example

The following example finds the segment that contains a point three inches from the beginning of the first subpath, and then converts the segment to a line.

Sub Test()

Dim seg As Segment

Dim t As Double

If ActiveShape.Curve.Subpaths(1).FindSegmentOffset(3, seg, t) Then

seg.Type = cdrLineSegment

Else

MsgBox "The first subpath is less than 3"" long."

End If

End Sub

 Related Topics


SubPath.GetCopy

Function GetCopy() As Curve

SubPath

Description

The GetCopy method returns a copy of the current subpath as a separate curve.

Return value

Returns Curve

 Related Topics


SubPath.GetCurvatureAt

Function GetCurvatureAt([ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrRelativeSegmentOffset (1)]) As Double

SubPath

Description

The GetCurvatureAt method returns the curvature of a subpath at a given point.

The value of the curvature is the inverse of curvature radius, and depends on the current document units.

Parameters	Description

Offset	Specifies the offset, in document units [in]
Optional
Default value = 0.5

OffsetType	Specifies the type of offset of a subpath. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrRelativeSegmentOffset (1)

Return value

Returns Double

Example

The following example draws a circle that touches the selected curve at the point that is 25% of the length of its first subpath, and has the same curvature as the curve in this point (shows the curvature radius).

Sub Test()

Dim c As Double, r As Double

Dim x As Double, y As Double, pa As Double

Dim sp As SubPath

Set sp = ActiveShape.Curve.Subpaths(1)

c = sp.GetCurvatureAt(0.25, cdrRelativeSegmentOffset)

If Abs(c) < 0.00001 Then

MsgBox "The curve is almost straight at this point", vbCritical

Exit Sub

End If

sp.GetPointPositionAt 0.25, cdrRelativeSegmentOffset, x, y

pa = sp.GetPerpendicularAt(0.25, cdrRelativeSegmentOffset)

pa = pa * 3.1415926 / 180

r = 1 / c

x = x + r * Cos(pa)

y = y + r * Sin(pa)

ActiveLayer.CreateEllipse2 x, y, r

End Sub

 Related Topics


SubPath.GetCurveSpeedAt

Function GetCurveSpeedAt([ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrRelativeSegmentOffset (1)]) As Double

SubPath

Description

The GetCurveSpeedAt method returns a value that indicates the rate at which the curvature changes at a given point.

A value close to 0 means that the curvature is steady, for example, in a circle. If it is greater than 0, the curvature increases, for example, in a spiral. A value of less than 0 value indicates that the curvature decreases, for example, in an unwinding spiral.

Parameters	Description

Offset	Specifies the offset, in document units, of a point. [in]
Optional
Default value = 0.5

OffsetType	Specifies the type of offset of a point. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrRelativeSegmentOffset (1)

Return value

Returns Double

Example

The following example shows how the curvature changes in the middle of the first subpath of the selected curve.

Sub Test()

Dim c As Double

Dim sp As SubPath

Set sp = ActiveShape.Curve.Subpaths(1)

c = sp.GetCurveSpeedAt(0.5, cdrRelativeSegmentOffset)

If Abs(c) < 0.01 Then

MsgBox "Curvature is steady: " & c

Else

If c > 0 Then

MsgBox "Curvature is increasing: " & c

Else

MsgBox "Curvature is decreasing: " & c

End If

End If

End Sub

 Related Topics


SubPath.GetIntersections

Function GetIntersections(ByVal Target As SubPath, [ByVal OffsetType As cdrSegmentOffsetType = cdrRelativeSegmentOffset (1)]) As CrossPoints

SubPath

Description

The GetIntersections method finds all points of intersection for two subpaths.

Parameters	Description

Target	Specifies the object you select second in an intersect operation [in]

OffsetType	Specifies the type of offset of the intersection point. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrRelativeSegmentOffset (1)

Return value

Returns CrossPoints

Example

The following example displays the number of times the two selected curves intersect, and marks each intersection point with a small circle.

Sub Test()

Dim sr As ShapeRange

Dim sp1 As SubPath, sp2 As SubPath

Dim cps As CrossPoints, cp As CrossPoint

Dim x As Double, y As Double, n As Long

Set sr = ActiveSelectionRange

If sr.Count <> 2 Then

MsgBox "Please select two curves", vbCritical

Exit Sub

End If

If sr(1).Type <> cdrCurveShape Or sr(2).Type <> cdrCurveShape Then

MsgBox "One of the selected shapes is not a curve", vbCritical

Exit Sub

End If

n = 0

For Each sp1 In sr(1).Curve.Subpaths

For Each sp2 In sr(2).Curve.Subpaths

Set cps = sp1.GetIntersections(sp2)

For Each cp In cps

ActiveLayer.CreateEllipse2 cp.PositionX, cp.PositionY, 0.05

Next cp

n = n + cps.Count

Next sp2

Next sp1

MsgBox n & " intersection point(s) found"

End Sub

 Related Topics


SubPath.GetPerpendicularAt

Function GetPerpendicularAt([ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrRelativeSegmentOffset (1)]) As Double

SubPath

Description

The GetPerpendicularAt method returns the perpendicular to a point on a curve's subpath.

Parameters	Description

Offset	Specifies the offset,, in document units, of the perpendicular [in]
Optional
Default value = 0.5

OffsetType	Specifies the type of offset.. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrRelativeSegmentOffset (1)

Return value

Returns Double

Example

The following example draws perpendicular and tangent vectors for several points uniformly distributed along the subpaths of the selected curve.

Sub Test()

Dim sp As SubPath

Dim t As Double

For Each sp In ActiveShape.Curve.Subpaths

For t = 0 To 0.9 Step 0.1

MarkPoint sp, t

Next t

Next sp

End Sub

Private Sub MarkPoint(sp As SubPath, t As Double)

Dim x As Double, y As Double

Dim dx As Double, dy As Double

Dim a1 As Double, a2 As Double

sp.GetPointPositionAt x, y, t, cdrRelativeSegmentOffset

a1 = sp.GetTangentAt(t, cdrRelativeSegmentOffset) * 3.1415926 / 180

a2 = sp.GetPerpendicularAt(t, cdrRelativeSegmentOffset) * 3.1415926 / 180

dx = 0.5 * Cos(a1)

dy = 0.5 * Sin(a1)

With ActiveLayer.CreateLineSegment(x, y, x + dx, y + dy)

.Outline.EndArrow = ArrowHeads(1)

End With

dx = 0.5 * Cos(a2)

dy = 0.5 * Sin(a2)

With ActiveLayer.CreateLineSegment(x, y, x + dx, y + dy)

.Outline.EndArrow = ArrowHeads(1)

End With

End Sub

 Related Topics


SubPath.GetPointPositionAt

Sub GetPointPositionAt(ByRef X As Double, ByRef Y As Double, [ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrRelativeSegmentOffset (1)])

SubPath

Description

The GetPointPositionAt method returns the coordinates of a point located on a curve's subpath.

Parameters	Description

X	Specifies the horizontal position of a point on a curve's subpath. The x-coordinate is measured in document units. [out]

Y	Specifies the vertical position of a point on a curve's subpath. The y-coordinate is measured in document units. [out]

Offset	Specifies the offset distance, in document units, of a point on a curve's subpath [in]
Optional
Default value = 0.5

OffsetType	Specifies the type of offset of a point on a curve's subpath. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrRelativeSegmentOffset (1)

Example

The following example creates five small ellipses distributed evenly along each subpath of the selected curve

Sub Test()

Dim sp As SubPath

Dim t As Double, x As Double, y As Double

For Each sp In ActiveShape.Curve.Subpaths

For t = 0 To 0.9 Step 0.1

sp.GetPointPositionAt t, cdrRelativeSegmentOffset, x, y

ActiveLayer.CreateEllipse2 x, y, 0.03

Next t

Next sp

End Sub

 Related Topics


SubPath.GetPosition

Sub GetPosition(ByRef PositionX As Double, ByRef PositionY As Double)

SubPath

Description

The GetPosition method returns the horizontal and vertical position of a subpaths' head as if the subpath were a separate shape object.

Parameters	Description

PositionX	Returns the x, or horizontal, coordinate of a subpath's starting point, measured in document units [out]

PositionY	Returns the y, or vertical, coordinate of a subpath's starting point, measured in document units [out]

Example

The following example draws a bounding rectangle around each subpath in the selected curve.

Sub Test()

Dim sp As SubPath

Dim x As Double, y As Double

ActiveDocument.ReferencePoint = cdrBottomLeft

For Each sp In ActiveShape.Curve.Subpaths

sp.GetPosition x, y

ActiveLayer.CreateRectangle2 x, y, sp.SizeWidth, sp.SizeHeight

Next sp

End Sub

 Related Topics


SubPath.GetSegmentAt

Function GetSegmentAt([ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrRelativeSegmentOffset (1)], [ByRef SegmentOffset As Double = 0]) As Segment

SubPath

Description

The GetSegmentAt method returns the segment that contains the specified point on the subpath.

Optionally, it returns the offset of the specified point within the returned segment.

Parameters	Description

Offset	Specifies the offset, in document units, of the point [in]
Optional
Default value = 0.5

OffsetType	Specifies the type of offset. This parameter returns cdrSegmentOffsetType.[in]
Optional
Default value = cdrRelativeSegmentOffset (1)

SegmentOffset	Returns the offset of a segment in the subpath [out]
Optional
Default value = 0

Return value

Returns Segment

Example

The following example converts the segment that is in the middle of the subpath to a line.

Sub Test()

Dim seg As Segment

Set seg = ActiveShape.Curve.Subpaths(1).GetSegmentAt(0.5, cdrRelativeSegmentOffset)

seg.Type = cdrLineSegment

End Sub

 Related Topics


SubPath.GetTangentAt

Function GetTangentAt([ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrRelativeSegmentOffset (1)]) As Double

SubPath

Description

The GetTangentAt method returns the tangent to a point on a curve's subpath.

Parameters	Description

Offset	Specifies the offset, in document units, of the tangent [in]
Optional
Default value = 0.5

OffsetType	Specifies the type of offset. This parameter returns cdrSegmentOffsetType. [in]
Optional
Default value = cdrRelativeSegmentOffset (1)

Return value

Returns Double

Example

The following example draws perpendicular and tangent vectors for several points uniformly distributed along the subpaths of the selected curve.

Sub Test()

Dim sp As SubPath

Dim t As Double

For Each sp In ActiveShape.Curve.Subpaths

For t = 0 To 0.9 Step 0.1

MarkPoint sp, t

Next t

Next sp

End Sub

Private Sub MarkPoint(sp As SubPath, t As Double)

Dim x As Double, y As Double

Dim dx As Double, dy As Double

Dim a1 As Double, a2 As Double

sp.GetPointPositionAt x, y, t, cdrRelativeSegmentOffset

a1 = sp.GetTangentAt(t, cdrRelativeSegmentOffset) * 3.1415926 / 180

a2 = sp.GetPerpendicularAt(t, cdrRelativeSegmentOffset) * 3.1415926 / 180

dx = 0.5 * Cos(a1)

dy = 0.5 * Sin(a1)

With ActiveLayer.CreateLineSegment(x, y, x + dx, y + dy)

.Outline.EndArrow = ArrowHeads(1)

End With

dx = 0.5 * Cos(a2)

dy = 0.5 * Sin(a2)

With ActiveLayer.CreateLineSegment(x, y, x + dx, y + dy)

.Outline.EndArrow = ArrowHeads(1)

End With

End Sub

 Related Topics


SubPath.IsOnSubPath

Function IsOnSubPath(ByVal X As Double, ByVal Y As Double, [ByVal HotArea As Double = -1]) As cdrPositionOfPointOverShape

SubPath

Description

The IsOnSubPath method returns the position of a point relative to a subpath. The coordinate can be inside or outside the subpath, or over the outline of the subpath.

The IsOnSubPath method returns a value of cdrPositionOfPointOverShape.

Parameters	Description

X	Specifies the horizontal position, measured in document units, of a point [in]

Y	Specifies the vertical position, measured in document units, of a point [in]

HotArea	Defines a restricted area on the curve's subpath in which to evaluate the position of a point [in]
Optional
Default value = -1

Return value

Returns cdrPositionOfPointOverShape

Example

The following example creates a rectangle and tests where various point coordinates are located relative to the rectangle.

Public Sub Test()

Dim s As Shape, spath As SubPath

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s.ConvertToCurves

Set spath = s.Curve.Subpaths(1)

ShowOnCurve 1, 1, spath.IsOnSubPath(1, 1)

ShowOnCurve 1, 0, spath.IsOnSubPath(1, 0)

ShowOnCurve 1, 3, spath.IsOnSubPath(1, 3)

End Sub

Private Function ShowOnCurve(x As Double, y As Double, v As cdrPositionOfPointOverShape)

Dim s As String

s = "Point (" & x & "," & y & ") is "

Select Case v

Case cdrOutsideShape

s = s & "outside the subpath"

Case cdrOnMarginOfShape

s = s & "over the outline"

Case cdrInsideShape

s = s & "inside the subpath"

End Select

MsgBox s

End Function

 Related Topics


SubPath.Move

Sub Move([ByVal DeltaX As Double = 0], [ByVal DeltaY As Double = 0])

SubPath

Description

The Move method changes the position of a curve's subpath by moving it a specified offset.

Parameters	Description

DeltaX	Specifies the horizontal distance to move a subpath [in]
Optional
Default value = 0

DeltaY	Specifies the vertical distance to move a subpath [in]
Optional
Default value = 0

Example

The following example moves each subpath of the selected curve randomly.

Sub Test()

Dim spath As SubPath

For Each spath In ActiveShape.Curve.Subpaths

spath.Move Rnd() * 2 - 1, Rnd() * 2 - 1

Next spath

End Sub

 Related Topics


SubPath.Next

Function Next() As SubPath

SubPath

Description

The Next method returns the next subpath of the curve.

Return value

Returns SubPath

Example

The following example connects all open subpaths to each other, forming a one larger closed subpath.

Sub Test()

Dim crv As Curve

Dim spath As SubPath, spath1 As SubPath

Set crv = ActiveShape.Curve

Set spath = crv.Subpaths(1)

Do

If Not spath.Closed Then

Set spath1 = spath.Next

Do

If Not spath1.Closed Then Exit Do

Set spath1 = spath1.Next

Loop

spath.EndNode.ConnectWith spath1.StartNode

Else

Set spath = spath.Next

If spath.Index = 1 Then Exit Do

End If

Loop

End Sub

 Related Topics


SubPath.Previous

Function Previous() As SubPath

SubPath

Description

The Previous method returns the previous subpath in the curve.

Return value

Returns SubPath

Example

The following example connects all open subpaths to each other, forming a one larger closed subpath.

Sub Test()

Dim crv As Curve

Dim spath As SubPath, spath1 As SubPath

Set crv = ActiveShape.Curve

Set spath = crv.Subpaths(1)

Do

If Not spath.Closed Then

Set spath1 = spath.Next

Do

If Not spath1.Closed Then Exit Do

Set spath1 = spath1.Next

Loop

spath.EndNode.ConnectWith spath1.StartNode

Else

Set spath = spath.Next

If spath.Index = 1 Then Exit Do

End If

Loop

End Sub

 Related Topics


SubPath.ReverseDirection

Sub ReverseDirection()

SubPath

Description

The ReverseDirection method reverses the direction of the subpath without affecting other subpaths of the curve. The ReverseDirection method reverses the node order by reversing the order of their index numbers.

Example

The following example creates a curve object containing 10 subpaths. It applies end arrowheads to them and then reverses the direction of the third subpath.

Sub Test()

Dim sr As New ShapeRange

Dim s As Shape

Dim n As Long

For n = 1 To 10

sr.Add ActiveLayer.CreateLineSegment(0, n / 2, 5, n / 2)

Next n

Set s = sr.Combine

s.Outline.EndArrow = ArrowHeads(2)

s.Curve.Subpaths(3).ReverseDirection

End Sub

 Related Topics


SubPath.Selection

Function Selection() As NodeRange

SubPath

Description

The Selection method returns a NodeRange object which contains all the selected nodes on a subpath. The Shape tool must be selected.

Return value

Returns NodeRange

Example

The following example displays the number of nodes selected in the first subpath of the active curve.

Sub Test()

Dim nr As NodeRange

Set nr = ActiveShape.Curve.Subpaths(1).Selection

MsgBox "There are " & nr.Count & " nodes selected in the first subpath"

End Sub

 Related Topics


SubPath.SetPosition

Sub SetPosition(ByVal PositionX As Double, ByVal PositionY As Double)

SubPath

Description

The SetPosition method sets the horizontal and vertical position of a subpaths' head as if the subpath were a separate shape object.

Parameters	Description

PositionX	Sets the x, or horizontal, coordinate of a subpath's starting point, measured in document units [in]

PositionY	Sets the y, or vertical, coordinate of a subpath's starting point, measured in document units [in]

Example

The following example sets the horizontal and vertical position of the first subpath in the active curve.

Sub App()

With ActiveShape.Curve.Subpaths(1)

.SetPosition 4, 4

End With

End Sub

 Related Topics


Subpaths properties

Subpaths     Legend

    Application
    Count
  Item
    Parent


Subpaths

Class Subpaths

Properties     Referenced By

The Subpaths class represents a collection of subpaths in a curve.

 Related Topics


Subpaths.Application

Property Application As Application

Subpaths

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Subpaths.Count

Property Count As Long

Subpaths

Description

The Count property returns the number of subpaths in the Subpaths collection.

Read-Only

Example

The following example extracts each subpath from a curve and changes the color of each extracted curve.

Sub Test()

Dim spath As SubPath

Dim s As Shape, sExt As Shape

Dim i As Long

Set s = ActiveShape

If s.Curve.Subpaths.Count < 2 Then Exit Sub

For i = s.Curve.Subpaths.Count To 1 Step -1

Set spath = s.Curve.Subpaths(i)

Set sExt = spath.Extract(s)

sExt.Outline.Width = 0.01

sExt.Outline.Color = ActivePalette.Color(13 + i)

Next i

End Sub

 Related Topics


Subpaths.Item

Property Item(ByVal Index As Long) As SubPath

Subpaths

Description

The Item property returns the specified SubPath.

The Item property is the default property and its reference may be omitted when referencing items in the collection. For example, Subpaths.Item(2) is the same as Subpaths(2) - they both reference the second subpath in the Subpaths collection.

Read-Only

Parameters	Description

Index	Represents a preset placeholder for each object in a Subpaths collection; it uniquely identifies each member of the collection. [in]

Example

The following example randomly moves each subpath in the selected curve.

Sub Test()

Dim spath As SubPath

Dim s As Shape

Dim i As Long

Set s = ActiveShape

For i = 1 To s.Curve.Subpaths.Count

Set spath = s.Curve.Subpaths(i)

spath.Move Rnd() * 2 - 1, Rnd() * 2 - 1

Next i

End Sub

Sub Test()

Dim spath As SubPath

For Each spath In ActiveShape.Curve.Subpaths

spath.Move Rnd() * 2 - 1, Rnd() * 2 - 1

Next spath

End Sub

 Related Topics


Subpaths.Parent

Property Parent As Curve

Subpaths

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


SystemPrinters properties

SystemPrinters     Legend

    Count
    Default
  Item


SystemPrinters

Class SystemPrinters

Properties     Referenced By

The SystemPrinters class represents all the installed printers on the user's system.

 Related Topics


SystemPrinters.Count

Property Count As Long

SystemPrinters

Description

The Count property returns the number of printers in the collection.

Read-Only

Example

The following example displays the number of installed printers.

Sub Test()

MsgBox "There are " & Printers.Count & " printers installed on your system."

End Sub

 Related Topics


SystemPrinters.Default

Property Default As Printer

SystemPrinters

Description

The Default property returns a reference to the user's default printer.

Read-Only

Example

The following example displays the name of the default printer.

Sub Test()

Dim Prn As Printer

Set Prn = Printers.Default

MsgBox "Your default printer is: " & Prn.Name

End Sub

 Related Topics


SystemPrinters.Item

Property Item(ByVal nIndex As Long) As Printer

SystemPrinters

Description

The Item property returns the specified Printer in the collection.

The Item property is the default property and its reference may be omitted when accessing an items in the collection. For example, Printers.Item(2) is the same as Printers(2) - they both reference the second printer in the SystemPrinters collection.

Read-Only

Parameters	Description

nIndex	Specifies the printer by its index number [in]

Example

The following example lists the printers installed on the system.

Sub Test()

Dim intCounter As Integer

Dim Prn As Printer

Dim s As String

For intCounter = 1 To Printers.Count

Set Prn = Printers(intCounter)

s = s & Prn.Name & vbCr

Next intCounter

MsgBox "The following printers are installed on your system: " & vbCr & vbCr & s

Set Prn = Nothing

End Sub

 Related Topics


Text properties

Text     Legend

    Frame
    Frames
    FramesInLink
    IsArtisticText
    IsEditing
    IsHTMLCompatible
    Overflow
    Selection
    Story
    Type
    UnusedFramesInLink


Text methods

Text     Legend

   BeginEdit
   ConvertToArtistic
   ConvertToParagraph
   ExportToFile
   Find
   FitTextToFrame
   FitToPath
   ImportFromFile
   MakeHTMLCompatible
   Range
   Replace


Text

Class Text

Properties     Methods     Referenced By

The Text class represents the text-specific properties of the Shape object.

 Related Topics


Text.Frame

Property Frame As TextFrame

Text

Description

The Frame property returns the active frame.

Read-Only

Example

The following example creates two paragraph text frames and links them together.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim d As Document

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, String$(400, "T"))

Set s1 = d.ActiveLayer.CreateParagraphText(6, 6, 8, 8)

Set t = s.Text

t.Frame.LinkTo s1

End Sub

 Related Topics


Text.Frames

Property Frames As TextFrames

Text

Description

The Frames property returns the collection of all frames in the text range.

Read-Only

Example

The following example creates two paragraph text frames and links them together. It then displays the number of frames in the collection.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim d As Document

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, String$(400, "T"))

Set s1 = d.ActiveLayer.CreateParagraphText(6, 6, 8, 8)

Set t = s.Text

' Link the frames together

t.Frame.LinkTo s1

' Display frames count

MsgBox t.Frames.Count

End Sub

 Related Topics


Text.FramesInLink

Property FramesInLink As Long

Text

Description

The FramesInLink property returns the total number of text frames in a chain of linked paragraph text frames.

Read-Only

Example

The following example displays the total number of frames in the text chain and the number of empty (unused) frames.

Sub Test()

If ActiveShape Is Nothing Then

MsgBox "Nothing Selected"

Exit Sub

End If

If ActiveShape.Type <> cdrTextShape Then

MsgBox "Please select a text object."

Exit Sub

End If

If ActiveShape.Text.Type <> cdrParagraphText And ActiveShape.Text.Type <> cdrParagraphFittedText Then

MsgBox "Please select a paragraph text object."

Exit Sub

End If

MsgBox "The number of frames in the text chain is: " & _

ActiveShape.Text.FramesInLink & vbCr & _

"Unused frames: " & ActiveShape.Text.UnusedFramesInLink

End Sub

 Related Topics


Text.IsArtisticText

Property IsArtisticText As Boolean

Text

Description

The IsArtisticText property returns whether the text is artistic text.

Read-Only

Example

The following example displays a message box if the text is artistic text.

Sub Test()

Dim s As Shape

Dim d As Document

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateArtisticText(3, 3, "This is a test")

Set t = s.Text

If t.IsArtisticText Then

MsgBox "Artistic Text"

End If

End Sub

 Related Topics


Text.IsEditing

Property IsEditing As Boolean

Text

Description

The IsEditing property returns the state of editing text.

Read-Only

Example

The following example creates paragraph text, places the text in the editing mode, and displays a message box confirming that the text is in the editing mode.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 7, 7, "This is a test.")

Set t = s.Text

t.BeginEdit

If t.IsEditing Then

MsgBox "The text shape is in edit mode."

End If

End Sub

 Related Topics


Text.IsHTMLCompatible

Property IsHTMLCompatible As Boolean

Text

Description

The IsHTMLCompatible property returns True if the specified paragraph text object can be exported to HTML with the current formatting.

Read-Only

Example

The following example ensures that all paragraph text objects on the page are HTML-compatible.

Sub Test()

Dim s As Shape

For Each s In ActivePage.FindShapes(Type:=cdrTextShape)

If s.Text.Type = cdrParagraphText Then

If Not s.Text.IsHTMLCompatible Then s.Text.MakeHTMLCompatible True

End If

Next s

End Sub

 Related Topics


Text.Overflow

Property Overflow As Boolean

Text

Description

The Overflow property returns True if the amount of text exceeds the space available in a chain of linked paragraph text frames.

Read-Only

Example

The following example adjusts the height of a frame to accommodate any overflowing text.

Sub Test()

Dim s As Shape

ActiveDocument.ReferencePoint = cdrTopLeft

For Each s In ActiveDocument.ActivePage.Shapes

If s.Type = cdrTextShape Then

If s.Text.Type = cdrParagraphText Then

If s.Text.Overflow Then AdjustFrame s

End If

End If

Next s

End Sub

Private Sub AdjustFrame(s As Shape)

Dim h As Double

h = s.SizeHeight / 10

While s.Text.Overflow

s.SizeHeight = s.SizeHeight + h

Wend

End Sub

 Related Topics


Text.Selection

Property Selection As TextRange

Text

Description

The Selection property returns the selected text in the text stream as a TextRange object.

Read-Only

Example

The following example displays the selected text if the active shape is a text shape.

Sub Test()

If ActiveShape.Type = cdrTextShape Then

MsgBox ActiveShape.Text.Selection.Text

End If

End Sub

 Related Topics


Text.Story

Property Story As TextRange

Text

Description

The Story property returns all text from all text frames.

Read-Only

Example

The following example creates artistic text and displays all the text.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateArtisticText(3, 3, "This is a test.")

Set t = s.Text

MsgBox "The entire text is:" & vbCr & t.Story

End Sub

 Related Topics


Text.Type

Property Type As cdrTextType

Text

Description

The Type property returns the type of the text. It indicates whether the text is an artistic or paragraph text, and if it is fitted to a curve.

The Type property returns a value of cdrTextType.

Read-Only

Example

The following example converts all paragraph text objects to curves by converting them to artistic text first and then converting them to curves.

Sub Test()

Dim s As Shape

For Each s In ActivePage.FindShapes(, cdrTextShape)

If s.Text.Type = cdrParagraphText Then

s.Text.ConvertToArtistic

s.ConvertToCurves

End If

Next s

End Sub

 Related Topics


Text.UnusedFramesInLink

Property UnusedFramesInLink As Long

Text

Description

The UnusedFramesInLink property returns the total number of empty frames in a chain of linked paragraph text frames.

Read-Only

Example

The following example displays the total number of frames in the text chain and the number of empty (unused) frames.

Sub Test()

If ActiveShape Is Nothing Then

MsgBox "Nothing Selected"

Exit Sub

End If

If ActiveShape.Type <> cdrTextShape Then

MsgBox "Please select a text object"

Exit Sub

End If

If ActiveShape.Text.Type <> cdrParagraphText And ActiveShape.Text.Type <> cdrParagraphFittedText Then

MsgBox "Please select a paragraph text object"

Exit Sub

End If

MsgBox "The number of frames in the text chain is: " & _

ActiveShape.Text.FramesInLink & vbCr & _

"Unused frames: " & ActiveShape.Text.UnusedFramesInLink

End Sub

 Related Topics


Text.BeginEdit

Sub BeginEdit()

Text

Description

The BeginEdit method sets the state for editing text.

Example

The following example creates paragraph text and places the text in the editing mode.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 7, 7, "This is a test.")

Set t = s.Text

t.BeginEdit

End Sub

 Related Topics


Text.ConvertToArtistic

Sub ConvertToArtistic()

Text

Description

The ConvertToArtistic method changes paragraph text to artistic text.

Example

The following example converts all paragraph text objects to curves by converting them to artistic text first and then converting them to curves.

Sub Test()

Dim s As Shape

For Each s In ActivePage.FindShapes(, cdrTextShape)

If s.Text.Type = cdrParagraphText Then

s.Text.ConvertToArtistic

s.ConvertToCurves

End If

Next s

End Sub

 Related Topics


Text.ConvertToParagraph

Sub ConvertToParagraph()

Text

Description

The ConvertToParagraph method changes artistic text to paragraph text.

Example

The following example converts the artistic text in the active shape to paragraph text, using the ConvertToArtistic method. The paragraph text is made HTML compatible using the MakeHTMLCompatible method:

Sub Test()

With ActiveShape.Text

.ConvertToParagraph

.MakeHTMLCompatible

End With

End Sub

 Related Topics


Text.ExportToFile

Sub ExportToFile(ByVal FileName As String, ByVal StartIndex As Long, ByVal Count As Long, [ByVal IndexingType As cdrTextIndexingType = cdrCharacterIndexing (0)])

Text

Description

The ExportToFile method saves a portion of a text block to a text file.

Parameters	Description

FileName	Specifies the full path and filename of the file to which the text is exported [in]

StartIndex	Specifies the first text object in a text range [in]

Count	Specifies the number of items in the range [in]

IndexingType	Specifies the type of text to be indexed. The indexing type can be character, word, or paragraph. The IndexingType parameter returns a value of cdrIndexingType. [in]
Optional
Default value = cdrCharacterIndexing (0)

Example

The following example saves the second to fifth paragraphs to a text file, and then inserts the text back at the beginning of the text block.

Sub Test()

ActiveShape.Text.ExportToFile "C:\Temp.txt", 2, 4, cdrParagraphIndexing

ActiveShape.Text.ImportFromFile "C:\Temp.txt", 1, cdrParagraphIndexing

End Sub

 Related Topics


Text.Find

Function Find(ByVal Text As String, ByVal CaseSensitive As Boolean, [ByVal StartIndex As Long = 1], [ByVal WrapAround As Boolean = False], [ByVal IndexingType As cdrTextIndexingType = cdrCharacterIndexing (0)]) As Long

Text

Description

The Find method locates a specified text string in a text stream.

Parameters	Description

Text	Specifies the text to find. The string must be contained within quotation marks. [in]

CaseSensitive	Determines whether to match the case of the text in the Text parameter [in]

StartIndex	Specifies the first text object in a text range. If the index type is set to word, and the start index is 3, the StartIndex parameter begins the range at the third word in the selected text frame. [in]
Optional
Default value = 1

WrapAround	Determines whether the text follows the path of an object's shape or bounding box. [in]
Optional
Default value = False

IndexingType	Specifies the type of text to find. The indexing type can be character, word, or paragraph. The IndexingType parameter has a value of cdrIndexingType. [in]
Optional
Default value = cdrCharacterIndexing (0)

Return value

Returns Long

Example

The following example creates a paragraph text block containing the text "Wild Rose Cafe." It then looks for the word "Rose" and inserts the word "Red " in front of it, resulting in the string "Wild Red Rose Cafe."

Sub Test()

Dim s As Shape, n As Long

Set s = ActiveLayer.CreateParagraphText(0, 0, 2, 1, "Wild Rose Cafe")

n = s.Text.Find("Rose", False)

If n <> 0 Then s.Text.Characters(n, 0) = "Red "

End Sub

 Related Topics


Text.FitTextToFrame

Sub FitTextToFrame()

Text

Description

The FitTextToFrame method fiits text to a frame.

Example

The following example creates paragraph text and fits the text to the frame.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 4, 6, 9, _

"This is a test for the frames.")

Set t = s.Text

t.FitTextToFrame

End Sub

 Related Topics


Text.FitToPath

Sub FitToPath(ByVal Path As Shape)

Text

Description

The FitToPath method positions artistic text along a path.

It is important to note that you can't fit text to the path of another text object.

Parameters	Description

Path	Specifies the path [in]

Example

The following example places a text on an ellipse.

Sub Test()

Dim sText As Shape, sEllipse As Shape

Set sText = ActiveLayer.CreateArtisticText(0, 0, "Text On Path")

Set sEllipse = ActiveLayer.CreateEllipse2(4, 5, 2)

sText.Text.FitToPath sEllipse

sText.Effects(1).TextOnPath.Quadrant = cdrBottomQuadrant

End Sub

 Related Topics


Text.ImportFromFile

Sub ImportFromFile(ByVal FileName As String, ByVal StartIndex As Long, [ByVal IndexingType As cdrTextIndexingType = cdrCharacterIndexing (0)])

Text

Description

The ImportFromFile method inserts the contents of a text file into a text block at specified position.

Parameters	Description

FileName	Specifies the full path and filename of the file to import [in]

StartIndex	Specifies the position of the inserted text file [in]

IndexingType	Specifies the type of text to be indexed in the StartIndex parameter . The indexing type can be character, word, or paragraph and the IndexingType parameter returns a value of cdrIndexingType. [in]
Optional
Default value = cdrCharacterIndexing (0)

Example

The following example saves the second to fifth paragraphs to a text file, and then inserts the text back at the beginning of the text block.

Sub Test()

ActiveShape.Text.ExportToFile "C:\Temp.txt", 2, 4, cdrParagraphIndexing

ActiveShape.Text.ImportFromFile "C:\Temp.txt", 1, cdrParagraphIndexing

End Sub

 Related Topics


Text.MakeHTMLCompatible

Function MakeHTMLCompatible(ByVal HTML As Boolean) As Boolean

Text

Description

The MakeHTMLCompatible property ensures that a paragraph text object is HTML-compatible.

Artistic text cannot be converted to HTML text and is always treated as a bitmap. However, you can convert it to paragraph text and then make it Web-compatible.

Parameters	Description

HTML	Determines whether the text is made HTML-compatible [in]

Return value

Returns Boolean

Example

The following example ensures that all paragraph text objects on the page are HTML-compatible.

Sub Test()

Dim s As Shape

For Each s In ActivePage.FindShapes(Type:=cdrTextShape)

If s.Text.Type = cdrParagraphText Then

If Not s.Text.IsHTMLCompatible Then s.Text.MakeHTMLCompatible True

End If

Next s

End Sub

 Related Topics


Text.Range

Function Range(ByVal Start As Long, ByVal End As Long) As TextRange

Text

Description

The Range method returns a range of characters.

Parameters	Description

Start	Specifies the starting character in the range [in]

End	Specifies the ending character in the range [in]

Return value

Returns TextRange

Example

The following example creates an artistic text and displays the first to the fifth characters in a message box. The ninth to the fourteenth characters are capitalized.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateArtisticText(4, 5, "This is a test.")

Set t = s.Text

MsgBox "The text between characters 1 and 5 is:  " & vbCr & t.Range(1, 5).Text

t.Range(9, 14).Case = cdrAllCapsFontCase

End Sub

 Related Topics


Text.Replace

Sub Replace(ByVal OldText As String, ByVal NewText As String, ByVal CaseSensitive As Boolean, [ByVal StartIndex As Long = 1], [ByVal ReplaceAll As Boolean = False], [ByVal WrapAround As Boolean = False], [ByVal IndexingType As cdrTextIndexingType = cdrCharacterIndexing (0)])

Text

Description

The Replace method replaces a text string with another in a text stream.

Parameters	Description

OldText	Specifies the text to be replaced. The string must be contained within quotation marks. [in]

NewText	Specifies the text that replaces the text in the OldText parameter. The string must be contained within quotation marks. [in]

CaseSensitive	Determines whether to match the case of the text in the Text parameter [in]

StartIndex	Specifies the first text object in a text range. If the index type is set to word, and the start index is 3, the StartIndex parameter begins the range at the third word in the selected text frame.  [in]
Optional
Default value = 1

ReplaceAll	Determines whether all instances of old text found in the text range are replaced with new text [in]
Optional
Default value = False

WrapAround	Determines whether the text follows the path of an object's shape or bounding box [in]
Optional
Default value = False

IndexingType	Specifies the type of text to find. The indexing type can be character, word, or paragraph. The IndexingType parameter has a value of cdrIndexingType. [in]
Optional
Default value = cdrCharacterIndexing (0)

Example

The following example replaces all occurrences of "#" on the page with the current date.

Sub Test()

Dim s As Shape

For Each s In ActivePage.FindShapes(, cdrTextShape)

s.Text.Replace "#", CStr(Date), False, ReplaceAll:=True

Next s

End Sub

 Related Topics


TextCharacters properties

TextCharacters     Legend

    All
    Count
    First
  Item
    Last


TextCharacters

Class TextCharacters

Properties     Referenced By

TexCharacters Class

 Related Topics


TextCharacters.All

Property All As TextRange

TextCharacters

Description

The All property returns a TextRange object which contains all the characters in the collection.

Read-Only

Example

The following example creates paragraph text and then changes all the characters to uppercase.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, _

"This is a test.")

Set t = s.Text

t.Story.Characters.All.Case = cdrAllCapsFontCase

End Sub

 Related Topics


TextCharacters.Count

Property Count As Long

TextCharacters

Description

The Count property returns the number of characters in the collection, including paragraph breaks.

Read-Only

Example

The following example creates paragraph text and then displays the number of characters that are in the text.

Sub Test()

Dim s As Shape

Dim d As Document

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, _

"This is a test.")

Set t = s.Text

MsgBox t.Story.Characters.Count

End Sub

 Related Topics


TextCharacters.First

Property First As TextRange

TextCharacters

Description

The First property returns a TextRange object which contains the first character in the collection.

Read-Only

Example

The following example creates paragraph text and then fills the first character with red.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, _

"This is a test.")

Set t = s.Text

t.Story.Characters.First.Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


TextCharacters.Item

Property Item(ByVal Index As Long, [ByVal Count As Long = 1]) As TextRange

TextCharacters

Description

The Item property returns a TextRange object that contains the specified characters.

Read-Only

Parameters	Description

Index	Specifies the index number of the character [in]

Count	Specifies the number of characters to include [in]
Optional
Default value = 1

Example

The following example creates paragraph text, applies bold formatting to the third character, and fills the tenth to the fifteenth characters with red.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Dim strText As String

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, "This is a test.")

Set t = s.Text

t.Story.Characters.Item(3).Bold = True

t.Story.Characters.Item(10, 5).Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


TextCharacters.Last

Property Last As TextRange

TextCharacters

Description

The Last property returns a TextRange object which contains the last character in the collection.

Read-Only

Example

The following example creates paragraph text and then fills the last character red.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, _

"This is a test.")

Set t = s.Text

t.Story.Characters.Last.Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


TextColumns properties

TextColumns     Legend

    All
    Count
    First
  Item
    Last


TextColumns

Class TextColumns

Properties     Referenced By

TextColumns Class

 Related Topics


TextColumns.All

Property All As TextRange

TextColumns

Description

The All property returns a TextRange object which contains all the columns in the collection.

Read-Only

Example

The following example links frames of paragraph text. It then creates three columns in the first frame and applies bold formatting to all the text in the columns.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim d As Document

Dim t As Text

Dim strText As String

strText = "This is a test. This text must be long enough to span " & _

"across multiple columns in this frame. By adding this sentence, " & _

"this text is now long enough."

strText = strText & " This is the next sentence. " & strText

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, strText)

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Set columns

t.Frame.SetColumns 3, False, Array(0.7, 0.1, 1, 0.1, 1)

t.Frame.Range.Columns.All.Bold = True

End Sub

 Related Topics


TextColumns.Count

Property Count As Long

TextColumns

Description

The Count property returns the number of text columns in the collection.

Read-Only

Example

The following example links frames of paragraph text. It then creates three columns in the first frame and displays the number of columns in the first frame.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim d As Document

Dim t As Text

Dim strText As String

strText = "This is a test. This sentence must be long enough " & _

"to span across multiple columns in this frame. I am sure " & _

"that it will cross multiple columns now."

strText = strText & " This is the next sentence. " & strText

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, strText)

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Set the columns

t.Frame.SetColumns 3, False, Array(0.7, 0.1, 1, 0.1, 1)

MsgBox "The column count for the frame is " & t.Frame.Range.Columns.Count

End Sub

 Related Topics


TextColumns.First

Property First As TextRange

TextColumns

Description

The First property returns a TextRange object which contains the first column in the collection.

Read-Only

Example

The following example links frames of paragraph text. It then creates three columns in the first frame and applies bold formatting to the first column.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim d As Document

Dim t As Text

Dim strText As String

strText = "This is a test. This sentence must be long enough " & _

"to span across multiple columns in this frame. I am sure " & _

"that it will cross multiple columns now."

strText = strText & " This is next part " & strText

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, strText)

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Set the columns

t.Frame.SetColumns 3, False, Array(0.7, 0.1, 1, 0.1, 1)

t.Frame.Range.Columns.First.Bold = True

End Sub

 Related Topics


TextColumns.Item

Property Item(ByVal Index As Long, [ByVal Count As Long = 1]) As TextRange

TextColumns

Description

The Item property returns a reference to the specified column.

Read-Only

Parameters	Description

Index	Specifies a column by its index number in base 1 [in]

Count	Specifies the number of columns [in]
Optional
Default value = 1

Example

The following example links frames of paragraph text. It then creates three columns in the first frame, and applies italic to the third column, strikethrough to the second column, and red to the first.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim d As Document

Dim t As Text

Dim tr As TextRange

Dim strText As String

strText = "This is a test. This sentence must be long enough " & _

"to span across multiple columns in this frame. I am sure " & _

"that it will cross multiple columns now."

strText = strText & " This is next part " & strText

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, strText)

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Set the columns

t.Frame.SetColumns 3, False, Array(0.7, 0.1, 1, 0.1, 1)

t.Frame.Range.Columns.Item(3).Italic = True

t.Frame.Range.Columns.Item(2).Strikethru = cdrDoubleThinFontLine

t.Frame.Range.Columns.Item(1).Fill.ApplyUniformFill CreateRGBColor(155, 0, 0)

End Sub

 Related Topics


TextColumns.Last

Property Last As TextRange

TextColumns

Description

The Last property returns a TextRange which contains the last column in the collection

Read-Only

Example

The following example links frames of paragraph text. It then creates three columns in the first frame and applies bold formatting to the third column.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim d As Document

Dim t As Text

Dim strText As String

strText = "This is a test. This sentence must be long enough " & _

"to span across multiple columns in this frame. I am sure " & _

"that it will cross multiple columns now."

strText = strText & " This is next part " & strText

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, strText)

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Set the columns

t.Frame.SetColumns 3, False, Array(0.7, 0.1, 1, 0.1, 1)

t.Frame.Range.Columns.Last.Bold = True

End Sub

 Related Topics


TextFrame properties

TextFrame     Legend

    ColumnCount
    ColumnGutter
    ColumnWidth
    Container
    Empty
    Index
    IsFirst
    IsFittedToPath
    IsInsideContainer
    IsLast
    Multicolumn
    Next
    Path
    Previous
  Range
      VerticalAlignment


TextFrame methods

TextFrame     Legend

   LinkTo
   SetColumns
   UnLink


TextFrame

Class TextFrame

Properties     Methods     Referenced By

TextFrames Class

 Related Topics


TextFrame.ColumnCount

Property ColumnCount As Long

TextFrame

Description

The ColumnCount property returns the number of columns in the frame.

Read-Only

Example

The following example links frames of paragraph text. It then creates three columns in the first frame, and displays the number of columns in the frame for each multicolumned frame.

Sub Test()

Dim d As Document

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Get the first frame

Set f = t.Frames(1)

' Set the columns

f.SetColumns 3, False, Array(1, 0.3, 2, 0.3, 3)

For Each f In t.Frames

If f.Multicolumn Then

MsgBox "There are " & f.ColumnCount & _

" columns in frame " & f.Index

End If

Next f

End Sub

 Related Topics


TextFrame.ColumnGutter

Property ColumnGutter(ByVal Index As Long) As Double

TextFrame

Description

The ColumnGutter property returns the amount of space between columns.

Read-Only

Parameters	Description

Index	Specifies the gutter by its index number [in]

Example

The following example links frames of paragraph text. It then creates three columns in the first frame and displays the amount of space between columns.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Get the first frame

Set f = t.Frames(1)

' Set the columns

f.SetColumns 3, False, Array(1, 0.25, 2, 0.3, 3)

MsgBox "Gutter 1:  " & f.ColumnGutter(1) & vbCr & _

"Gutter 2:  " & f.ColumnGutter(2)

End Sub

 Related Topics


TextFrame.ColumnWidth

Property ColumnWidth(ByVal Index As Long) As Double

TextFrame

Description

The ColumnWidth property returns the width of the specified column.

Read-Only

Parameters	Description

Index	Specifies the column by its index number [in]

Example

The following example links frames of paragraph text. It then creates three columns in the first frame and displays the width of each column.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Get the first frame

Set f = t.Frames(1)

' Set the columns

f.SetColumns 3, False, Array(1, 0.3, 1.4, 0.3, 1.5)

MsgBox "Column 1 Width:  " & f.ColumnWidth(1) & vbCr & _

"Column 2 Width:  " & f.ColumnWidth(2) & vbCr & _

"Column 3 Width:  " & f.ColumnWidth(3)

End Sub

 Related Topics


TextFrame.Container

Property Container As Shape

TextFrame

Description

The Container property returns a reference to the frame's container.

Read-Only

Example

The following example links frames of paragraph text. It places the first paragraph text inside an ellipse and the second inside a rectangle. The index number of each frame inside a container is then displayed.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim s3 As Shape

Dim t As Text

Dim f As TextFrame

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(1000, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateEllipse(8, 8, 10, 10)

Set s3 = d.ActiveLayer.CreateRectangle(1, 1, 4, 4)

Set t = s.Text

' Link the frames together

t.Frame.LinkTo s1

' Place the text inside the shapes

s2.PlaceTextInside s

s3.PlaceTextInside s1

' Go through the frames

For Each f In t.Frames

If f.IsInsideContainer = True Then

Select Case f.Container.Type

Case 1

MsgBox "Frame " & f.Index & " is inside a rectangle"

Case 2

MsgBox "Frame " & f.Index & " is inside a ellipse"

Case Else

MsgBox "Frame " & f.Index & " is inside a shape"

End Select

End If

Next f

End Sub

 Related Topics


TextFrame.Empty

Property Empty As Boolean

TextFrame

Description

The Empty propertey returns True if the frame is empty.

Read-Only

Example

The following example links frames of paragraph text together and displays which frames are empty.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Dim d As Document

Dim st As String

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(1000, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

For Each f In t.Frames

If f.Empty Then

st = st & "Frame " & f.Index & vbCr

End If

Next f

MsgBox st

End Sub

 Related Topics


TextFrame.Index

Property Index As Long

TextFrame

Description

The Index property returns the index number of the frame.

Read-Only

Example

The following example links frames of paragraph text. It places the first paragraph text inside an ellipse and the second inside a rectangle. The index number each frame inside a container is then displayed.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim s3 As Shape

Dim t As Text

Dim f As TextFrame

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(1000, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateEllipse(8, 8, 10, 10)

Set s3 = d.ActiveLayer.CreateRectangle(1, 1, 4, 4)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

' Place the text inside the shapes.

s2.PlaceTextInside s

s3.PlaceTextInside s1

' Iterate through the frames.

For Each f In t.Frames

If f.IsInsideContainer = True Then

Select Case f.Container.Type

Case 1

MsgBox "Frame " & f.Index & " is inside a rectangle"

Case 2

MsgBox "Frame " & f.Index & " is inside a ellipse"

Case Else

MsgBox "Frame " & f.Index & " is inside a shape"

End Select

End If

Next f

End Sub

 Related Topics


TextFrame.IsFirst

Property IsFirst As Boolean

TextFrame

Description

The IsFirst property returns True if the frame is the first text frame.

Read-Only

Example

The following example links frames of paragraph text. It then creates three columns of equal width and spacing.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(1000, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Iterate through each frame.

For Each f In t.Frames

If f.IsFirst Then

f.SetColumns 3, True, 1, 0.3

Exit For

End If

Next f

End Sub

 Related Topics


TextFrame.IsFittedToPath

Property IsFittedToPath As Boolean

TextFrame

Description

The IsFittedToPath property returns True if the frame is fitted to a path.

Read-Only

Example

The following example links frames of paragraph text. It fits text to an ellipse and then displays the index number of each frame that is fitted to a shape.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(1000, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateEllipse(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

' Fit the text to the ellipse.

s.Text.FitToPath s2

' Iterate through the frames.

For Each f In t.Frames

If f.IsFittedToPath = True Then

Select Case f.Path.Type

Case 2

MsgBox "Frame " & f.Index & " is fitted to an ellipse."

Case Else

MsgBox "Frame " & f.Index & " is fitted to a shape."

End Select

End If

Next f

End Sub

 Related Topics


TextFrame.IsInsideContainer

Property IsInsideContainer As Boolean

TextFrame

Description

The IsInsideContainer property returns True if the frame is inside a container shape.

Read-Only

Example

The following example links frames of paragraph text. It places the first paragraph text inside an ellipse and the second inside a rectangle. The index number of each frame inside a container is then displayed.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim s3 As Shape

Dim t As Text

Dim f As TextFrame

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(1000, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateEllipse(8, 8, 10, 10)

Set s3 = d.ActiveLayer.CreateRectangle(1, 1, 4, 4)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

' Place the text inside the shapes.

s2.PlaceTextInside s

s3.PlaceTextInside s1

' Iterate through the frames.

For Each f In t.Frames

If f.IsInsideContainer = True Then

Select Case f.Container.Type

Case 1

MsgBox "Frame " & f.Index & " is inside a rectangle"

Case 2

MsgBox "Frame " & f.Index & " is inside a ellipse"

Case Else

MsgBox "Frame " & f.Index & " is inside a shape"

End Select

End If

Next f

End Sub

 Related Topics


TextFrame.IsLast

Property IsLast As Boolean

TextFrame

Description

The IsLast property returns True if the frame is the last text frame.

Read-Only

Example

The following example links frames of paragraph text. In the last frame, it creates three columns of equal width and spacing.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, String$(1200, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 7, 7)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link frames together

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Go through each frame

For Each f In t.Frames

If f.IsLast Then

f.SetColumns 3, True, 1, 0.3

Exit For

End If

Next f

End Sub

 Related Topics


TextFrame.Multicolumn

Property Multicolumn As Boolean

TextFrame

Description

The Multicolumn property returns True if the frame has more than one column.

Read-Only

Example

The following example links frames of paragraph text. The text in the first frame is fitted to a path and is divided into three columns. The number of columns in each multicolumned frame is then displayed.

Sub Test()

Dim d As Document

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateEllipse(1, 1, 3, 3)

Set t = s.Text

' Fit the text to path.

s1.Text.FitToPath s2

' Link the frames together.

t.Frame.LinkTo s1

' Get the first frame.

Set f = t.Frames(1)

' Set the columns

f.SetColumns 3, False, Array(1, 0.3, 2, 0.3, 3)

For Each f In t.Frames

If f.Multicolumn Then

MsgBox "There are " & f.ColumnCount & " columns in frame " & f.Index

End If

Next f

End Sub

 Related Topics


TextFrame.Next

Property Next As TextFrame

TextFrame

Description

The Next property returns the next text frame, if any.

Read-Only

Example

The following example links frames of paragraph text. It then displays the index number of the frame following the first frame.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Get the first frame.

Set f = t.Frames(1)

MsgBox "The index of the next frame is: " & f.Next.Index

End Sub

 Related Topics


TextFrame.Path

Property Path As Shape

TextFrame

Description

The Path property returns a reference to the text's path, if the text is fitted to a path.

Read-Only

Example

The following example links frames of paragraph text. It then fits text to an ellipse and displays the index number of each frame that is fitted to a shape.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(1000, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateEllipse(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

' Fit the text to the ellipse.

s.Text.FitToPath s2

' Go through the frames.

For Each f In t.Frames

If f.IsFittedToPath = True Then

Select Case f.Path.Type

Case 2

MsgBox "Frame " & f.Index & " is fitted to an ellipse."

Case Else

MsgBox "Frame " & f.Index & " is fitted to a shape."

End Select

End If

Next f

End Sub

 Related Topics


TextFrame.Previous

Property Previous As TextFrame

TextFrame

Description

The Previous property returns the previous text frame, if any.

Read-Only

Example

The following example links frames of paragraph text. It then displays the index number of the frame before the last frame.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Get the first frame.

Set f = t.Frames(3)

MsgBox "The index of the previous frame is: " & f.Previous.Index

End Sub

 Related Topics


TextFrame.Range

Property Range As TextRange

TextFrame

Description

The Range returns a TextRange object which contains the text in the frame.

Read-Only

Example

The following example links frames of paragraph text. It then applies bold formatting to all the text in the first frame.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(1000, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

Set f = t.Frames(1)

f.Range.Bold = True

End Sub

 Related Topics


TextFrame.VerticalAlignment

Property VerticalAlignment As cdrVerticalAlignment

TextFrame

Description

The VerticalAlignment property returns or sets the vertical alignment of a text frame.

Example

The following example links frames of paragraph text and sets the vertical alignment of the first frame.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(1000, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Get the first frame.

Set f = t.Frames(1)

' Set the vertical alignment to Bottom Justify.

f.VerticalAlignment = cdrBottomJustify

End Sub

 Related Topics


TextFrame.LinkTo

Sub LinkTo(ByVal Shape As Shape)

TextFrame

Description

The LinkTo method links a text frame to the specified shape.

Parameters	Description

Shape	Specifies the shape [in]

Example

The following example links frames of paragraph text.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 5, 7, 9, "This is a test")

Set s1 = d.ActiveLayer.CreateParagraphText(0, 0, 4, 4)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

End Sub

 Related Topics


TextFrame.SetColumns

Sub SetColumns(ByVal NumColumns As Long, ByVal EqualColumns As Boolean, ByRef WidthsAndGutters() As Variant)

TextFrame

Description

The SetColumns property creates columns within a frame.

Parameters	Description

NumColumns	Specifies the number of columns [in]

EqualColumns	Specifies whether the columns are equal in width [in]

WidthsAndGutters	Specifies the sizes of the column and gutter, respectively, for each column and gutter [in]

Examples

The following example links frames of paragraph text. Using an array, it creates three columns of varying width and equal spacing in the first frame.

Sub Test()

Dim d As Document

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Get the first frame.

Set f = t.Frames(1)

' Set the columns

f.SetColumns 3, False, Array(1, 0.3, 2, 0.3, 3)

End Sub

The following example links frames of paragraph text. In the first frame, it creates three columns of equal width and spacing.

Sub Test()

Dim d As Document

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

Set f = t.Frames(1)

' Set the columns.

f.SetColumns 3, True, Array(1, 0.3)

End Sub

The following example links frames of paragraph text. Without using an array, it creates four columns of varying width and spacing in the first frame.

Sub Test()

Dim d As Document

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim f As TextFrame

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

Set f = t.Frames(1)

' Set the columns.

f.SetColumns 4, False, 1, 0.3, 1, 0.2, 0.5, 0.1, 0.4

End Sub

 Related Topics


TextFrame.UnLink

Sub UnLink()

TextFrame

Description

The UnLink method removes the link from a text frame.

Example

The following example links frames of paragraph text and then unlinks the first frame from the second.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 5, 7, 9, "This is a test.")

Set s1 = d.ActiveLayer.CreateParagraphText(0, 0, 4, 4)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

s1.Text.Frame.UnLink

End Sub

 Related Topics


TextFrames properties

TextFrames     Legend

    All
    Count
    First
  Item
    Last
    Range


TextFrames

Class TextFrames

Properties     Referenced By

TextFrames Class

 Related Topics


TextFrames.All

Property All As TextRange

TextFrames

Description

The All property returns a TextRange object which contains all frames in the collection.

Read-Only

Example

The following example links frames of paragraph text and applies bold formatting to the text in each frame.

Sub Test()

Dim d As Document

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

t.Frames.All.Bold = True

End Sub

 Related Topics


TextFrames.Count

Property Count As Long

TextFrames

Description

The Count property returns the number of text frames in the collection.

Read-Only

Example

The following example links frames of paragraph text and displays the number of frames in the collection.

Sub Test()

Dim d As Document

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

MsgBox "The number of frames in the collection is " & t.Frames.Count

End Sub

 Related Topics


TextFrames.First

Property First As TextFrame

TextFrames

Description

The First property returns a TextFrame object which contains the first frame in the collection.

Read-Only

Example

The following example links frames of paragraph text and applies bold formatting to the text in the first frame.

Sub Test()

Dim d As Document

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

t.Frames.First.Range.Bold = True

End Sub

 Related Topics


TextFrames.Item

Property Item(ByVal Index As Long) As TextFrame

TextFrames

Description

The Item property returns a reference to the specified frame.

Read-Only

Parameters	Description

Index	Specifies the frame by its index number in base 1 [in]

Example

The following example links paragraph text and displays whether the first item in the collection is inside a container.

Sub Test()

Dim d As Document

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

MsgBox t.Frames.Item(1).IsInsideContainer

End Sub

 Related Topics


TextFrames.Last

Property Last As TextFrame

TextFrames

Description

The Last property returns a TextFrame which contains the last frame in the collection.

Read-Only

Example

The following example links frames of paragraph text and applies bold formatting to the text in the last frame.

Sub Test()

Dim d As Document

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 7, 7)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

t.Frames.Last.Range.Bold = True

End Sub

 Related Topics


TextFrames.Range

Property Range(ByVal Index As Long, [ByVal Count As Long = 1]) As TextRange

TextFrames

Description

The Range property returns a TextRange object which contains the specified frames.

Read-Only

Parameters	Description

Index	Specifies a frame by it index number [in]

Count	Specifies the number of frames [in]
Optional
Default value = 1

Example

The following example links frames of paragraph text and applies bold formatting to the text in the second frame.

Sub Test()

Dim d As Document

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "Z"))

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

t.Frames.Range(2).Bold = True

End Sub

 Related Topics


TextLines properties

TextLines     Legend

    All
    Count
    First
  Item
    Last


TextLines

Class TextLines

Properties     Referenced By

TextLines Class

 Related Topics


TextLines.All

Property All As TextRange

TextLines

Description

The All property returns a TextRange object which contains all lines in the collection.

Read-Only

Example

The following example creates paragraph text and applies bold formatting to all the lines.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Dim strText As String

strText = "This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. This is a test."

strText = strText & " This is the next sentence. " & strText

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, strText)

Set t = s.Text

t.Story.Lines.All.Bold = True

End Sub

 Related Topics


TextLines.Count

Property Count As Long

TextLines

Description

The Count property returns the number of lines in the collection.

Read-Only

Example

The following example creates paragraph text and displays the number of lines in the paragraph.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Dim strText As String

strText = "This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. This is a test."

strText = strText & " This is the next sentence. " & strText

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, strText)

Set t = s.Text

MsgBox "The number of lines in the text is " & t.Story.Lines.Count

End Sub

 Related Topics


TextLines.First

Property First As TextRange

TextLines

Description

The First property returns a TextRange object which contains the first line in the collection.

Read-Only

Example

The following example creates paragraph text and fills the first line with red.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Dim strText As String

strText = "This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. This is a test."

strText = strText & " This is the next sentence. " & strText

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, strText)

Set t = s.Text

t.Story.Lines.First.Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


TextLines.Item

Property Item(ByVal Index As Long, [ByVal Count As Long = 1]) As TextRange

TextLines

Description

The Item property returns a TextRange object which contains the specified lines.

Read-Only

Parameters	Description

Index	Specifies the line by its index number [in]

Count	Specifies the number of lines [in]
Optional
Default value = 1

Example

The following example creates paragraph text, applies bold formatting to the first line, and fills the second and third lines with red.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Dim strText As String

strText = "This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. This is a test."

strText = strText & " This is the next sentence. " & strText

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, strText)

Set t = s.Text

t.Story.Lines.Item(1).Bold = True

t.Story.Lines.Item(2, 2).Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


TextLines.Last

Property Last As TextRange

TextLines

Description

The Last property returns a TextRange which contains the last line in the collection.

Read-Only

Example

The following example creates paragraph text and fills the last line with red.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Dim strText As String

strText = "This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. This is a test."

strText = strText & " This is the next sentence. " & strText

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, strText)

Set t = s.Text

t.Story.Lines.Last.Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


TextParagraphs properties

TextParagraphs     Legend

    All
    Count
    First
  Item
    Last


TextParagraphs

Class TextParagraphs

Properties     Referenced By

TextParagraphs Class

 Related Topics


TextParagraphs.All

Property All As TextRange

TextParagraphs

Description

The All property returns a TextRange object which contains all paragraphs in the collection.

Read-Only

Example

The following example creates paragraph text and applies bold formatting to all of paragraphs.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Dim strText As String

strText = "This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. "

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, strText)

Set t = s.Text

t.Story.Paragraphs.All.Bold = True

End Sub

 Related Topics


TextParagraphs.Count

Property Count As Long

TextParagraphs

Description

The Count property returns the number of paragraphs in the collection.

Read-Only

Example

The following example creates paragraph text and displays the number of paragraphs.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Dim strText As String

strText = "This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. "

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, strText)

Set t = s.Text

MsgBox "The number of paragraphs is: " & t.Story.Paragraphs.Count

End Sub

 Related Topics


TextParagraphs.First

Property First As TextRange

TextParagraphs

Description

The First property returns a TextRange which contains the first paragraph in the collection.

Read-Only

Example

The following example creates paragraph text and fills the first paragraph with red.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Dim strText As String

strText = "This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. "

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, strText)

Set t = s.Text

t.Story.Paragraphs.First.Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


TextParagraphs.Item

Property Item(ByVal Index As Long, [ByVal Count As Long = 1]) As TextRange

TextParagraphs

Description

The Item property returns a TextRange which contains the specified paragraphs.

Read-Only

Parameters	Description

Index	Specifies a paragraph by its index number [in]

Count	Specifies the number of paragraphs [in]
Optional
Default value = 1

Example

The following example creates paragraph text, applies bold formatting to the second paragraph, and fills the fifth and sixth paragraphs with uniform red.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Dim strText As String

strText = "This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. "

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, strText)

Set t = s.Text

t.Story.Paragraphs.Item(2).Bold = True

t.Story.Paragraphs.Item(5, 2).Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


TextParagraphs.Last

Property Last As TextRange

TextParagraphs

Description

The Last property returns a TextRange which contains the last paragraph in the collection.

Read-Only

Example

The following example creates paragraph text and fills the last paragraph with red.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Dim strText As String

strText = "This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. " & vbCr & _

"This is still a test. This is still a test. This is still a test. " & _

"This is still a test. This is still a test. " & vbCr & _

"This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. "

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, strText)

Set t = s.Text

t.Story.Paragraphs.Last.Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


TextRange properties

TextRange     Legend

      Alignment
      AutoHyphenate
      Bold
      Case
    Characters
      CharAngle
      CharSet
      CharSpacing
    Columns
      End
    Fill
      FirstLineIndent
      Font
    Frames
      HorizShift
      HyphenateCapitals
      HyphenHotZone
      HyphenMinCharsAfter
      HyphenMinCharsBefore
      HyphenMinWordLength
      Italic
      LanguageID
      LeftIndent
      Length
    Lines
      LineSpacing
    LineSpacingType
      MaxCharSpacing
      MaxWordSpacing
      MinWordSpacing
    Outline
      Overscore
    Paragraphs
      ParaSpacingAfter
      ParaSpacingBefore
      Position
      RightIndent
      Size
      Start
      Strikethru
      Style
    Text
      Underline
      VertShift
      WideText
    Words
      WordSpacing


TextRange methods

TextRange     Legend

   ChangeCase
   Collapse
   Combine
   Copy
   Delete
   Duplicate
   InRange
   InsertAfter
   InsertAfterWide
   InsertBefore
   InsertBeforeWide
   IsSame
   Paste
   Range
   Replace
   ReplaceWide
   Select
   SetLineSpacing
   SetRange


TextRange

Class TextRange

Properties     Methods     Referenced By

TextRange Class

 Related Topics


TextRange.Alignment

Property Alignment As cdrAlignment

TextRange

Description

The Alignment property returns or sets the alignment of the text in the range.

Example

The following example aligns the text in the paragraph to the center of each line.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, "This is an example.")

Set t = s.Text

t.Story.Alignment = cdrCenterAlignment

End Sub

 Related Topics


TextRange.AutoHyphenate

Property AutoHyphenate As cdrTriState

TextRange

Description

The AutoHyphenate property returns or specifies whether automatic hyphenation is enabled.

Example

The following example enables automatic hyphenation.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, "This is an example.")

Set t = s.Text

t.Story.AutoHyphenate = cdrTrue

End Sub

 Related Topics


TextRange.Bold

Property Bold As Boolean

TextRange

Description

The Bold property returns or specifies whether bold is applied to a range.

Example

The following example applies bold formatting to all of the text in the paragraph.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, "This is an example.")

Set t = s.Text

t.Story.Bold = True

End Sub

 Related Topics


TextRange.Case

Property Case As cdrFontCase

TextRange

Description

The Case property returns or sets the case of the text in the range.

Example

The following example capitalizes all the characters in the paragraph.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, "This is an example.")

Set t = s.Text

t.Story.Case = cdrAllCapsFontCase

End Sub

 Related Topics


TextRange.Characters

Property Characters As TextCharacters

TextRange

Description

The Characters property returns a collection of all characters in the range.

Read-Only

Example

The following example will bold all the characters in the paragraph text

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, "This is an example.")

Set t = s.Text

t.Story.Characters.All.Bold = True

End Sub

 Related Topics


TextRange.CharAngle

Property CharAngle As Single

TextRange

Description

The CharAngle property returns or sets the rotation angle of a text range.

Example

The following example sets the rotation angle for the text range to 77 degrees.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, "This is an example.")

Set t = s.Text

t.Story.CharAngle = 77

End Sub

 Related Topics


TextRange.CharSet

Property CharSet As cdrTextCharSet

TextRange

Description

The CharSet property returns or sets the character set of a text range.

Example

The following example changes the character set and the language to Greek, and adds characters which will be typed in Greek.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Dim tr As TextRange

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, "This is an example: ", Font:="Arial")

Set t = s.Text

Set tr = t.Story.InsertAfter("áâãäåæçèéêëìíîïðñòóôõö")

tr.CharSet = cdrCharSetGreek

tr.LanguageID = cdrGreek

End Sub

 Related Topics


TextRange.CharSpacing

Property CharSpacing As Single

TextRange

Description

The CharSpacing property returns or sets the spacing between characters in a text range.

Example

The following example sets the character spacing to 1.3.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, "This is an example.")

Set t = s.Text

t.Story.CharSpacing = 1.3

End Sub

 Related Topics


TextRange.Columns

Property Columns As TextColumns

TextRange

Description

The Columns property returns a collection of all text columns in the range.

Read-Only

Example

The following example links frames of paragraph text. In the first frame, three columns are created, and the second column is filled with red.

Sub Test()

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim d As Document

Dim t As Text

Dim strText As String

strText = "This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. This is a test."

strText = strText & " This is the next sentence. " & strText

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, strText)

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' set the columns

t.Frame.SetColumns 3, False, Array(0.7, 0.1, 1, 0.1, 1)

t.Story.Columns.Item(2).Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


TextRange.End

Property End As Long

TextRange

Description

The End property returns the position of the ending character of the range in the text stream.

Example

The following example displays the ending position of the first word in the paragraph.

Sub Test()

Dim s As Shape

Dim d As Document

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

MsgBox "The end position of the first word is " & t.Story.Words.First.End

End Sub

 Related Topics


TextRange.Fill

Property Fill As Fill

TextRange

Description

The Fill property returns a Fill object..

Read-Only

Example

The following example will apply a conical fountain fill to the last word of the paragraph text

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, "This is an example")

Set t = s.Text

t.Story.Words.Last.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(0, 0, 255), cdrConicalFountainFill

End Sub

 Related Topics


TextRange.FirstLineIndent

Property FirstLineIndent As Double

TextRange

Description

The FirstLineIndent property returns or sets the amount that the first line of a paragraph is indented.

Example

The following example indents the first line of the paragraph text by 0.5 inch.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example. This is an example. This is an example.")

Set t = s.Text

t.Story.FirstLineIndent = 0.5

End Sub

 Related Topics


TextRange.Font

Property Font As String

TextRange

Description

The Font property returns of sets the name of the font.

Example

The following example sets the font of the paragraph to Arial with a font size of 24 pt.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

t.Story.Font = "Arial"

t.Story.Size = 24

End Sub

 Related Topics


TextRange.Frames

Property Frames As TextFrames

TextRange

Description

The Frames property returns a collection of text frames in the range.

Read-Only

Example

The following example applies bold formatting to the text of the first frame.

Sub Test()

Dim d As Document

Dim s As Shape

Dim s1 As Shape

Dim s2 As Shape

Dim t As Text

Dim strText As String

strText = "This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. This is a test. "

strText = strText & " This is the next part " & strText & strText

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, strText)

Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)

Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)

Set t = s.Text

' Link the frames together.

t.Frame.LinkTo s1

s1.Text.Frame.LinkTo s2

' Bold the first frame.

t.Frames.First.Range.Bold = True

End Sub

 Related Topics


TextRange.HorizShift

Property HorizShift As Long

TextRange

Description

The HorizShift properety returns or sets the amount by which the text is shifted horizontally.

Example

The following example shifts the paragraph text horizontally.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

t.Story.HorizShift = 3

End Sub

 Related Topics


TextRange.HyphenateCapitals

Property HyphenateCapitals As Boolean

TextRange

Description

The HyphenateCapitals property returns or sets whether to hyphenate capitalized words.

Example

The following example enables the hypenation of capitalized words.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

t.Story.HyphenateCapitals = True

End Sub

 Related Topics


TextRange.HyphenHotZone

Property HyphenHotZone As Double

TextRange

Description

The HyphenHotZone property returns or sets the distance from the right margin at which hyphenation begins.

Example

The following example displays the value of the hot zone for hyphenation.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

MsgBox t.Story.HyphenHotZone

End Sub

 Related Topics


TextRange.HyphenMinCharsAfter

Property HyphenMinCharsAfter As Long

TextRange

Description

The HyphenMinCharsAfter property returns or sets the minimum number of characters that must appear in the hot zone after a hyphen

Example

The following example displays the minimum number of characters that must appear in the hot zone after a hyphen.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

MsgBox t.Story.HyphenMinCharsAfter

End Sub

 Related Topics


TextRange.HyphenMinCharsBefore

Property HyphenMinCharsBefore As Long

TextRange

Description

The HyphenMinCharsBefore property returns or sets the minimum number of characters that must appear in the hot zone before a hyphen.

Example

The following example displays the minimum number of characters that must appear in the hot zone before a hyphen.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

MsgBox t.Story.HyphenMinCharsBefore

End Sub

 Related Topics


TextRange.HyphenMinWordLength

Property HyphenMinWordLength As Long

TextRange

Description

The HyphenMinWordLength property returns or sets the minimum characters a word must have for it to be included in automatic hyphenation.

Example

The following example displays the minimum characters a word must have for it to be included in automatic hyphenation.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

MsgBox t.Story.HyphenMinWordLength

End Sub

 Related Topics


TextRange.Italic

Property Italic As Boolean

TextRange

Description

The Italic propertey returns or specifies whether italic is applied to a range.

Example

The following example applies italic to all of the text in the paragraph.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, "This is an example.")

Set t = s.Text

t.Story.Italic = True

End Sub

 Related Topics


TextRange.LanguageID

Property LanguageID As cdrTextLanguage

TextRange

Description

The LanguageID property returns or sets the language code for the text range.

Example

The following example changes the character set and the language code to Greek, and adds characters which will be typed in Greek.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Dim tr As TextRange

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, _

"This is an example: ", Font:="Arial")

Set t = s.Text

Set tr = t.Story.InsertAfter("áâãäåæçèéêëìíîïðñòóôõö")

tr.CharSet = cdrCharSetGreek

tr.LanguageID = cdrGreek

End Sub

 Related Topics


TextRange.LeftIndent

Property LeftIndent As Double

TextRange

Description

The LeftIndent property returns or sets the amount which the text is indented from the left side of the frame. All lines except for the first line of a paragraph are indented.

Example

The following example sets the hanging indent of the paragraph to 0.5 inch.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, _

"This is an example. This is an example. This is an " & _

"example. This is an example. This is an example.")

Set t = s.Text

t.Story.LeftIndent = 0.5

End Sub

 Related Topics


TextRange.Length

Property Length As Long

TextRange

Description

The Length property returns the number of characteres in the range.

Example

The following example displays the number of characters in the paragraph.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, _

"This is an example for length")

Set t = s.Text

MsgBox "The length of the characters in the paragraph text is " & _

t.Story.Length

End Sub

 Related Topics


TextRange.Lines

Property Lines As TextLines

TextRange

Description

The Lines property returns a collection of all lines in the range.

Read-Only

Example

The following example fills the second and third lines of the paragraph with red.

Sub Test

Dim t As Text

Dim s As Shape

Dim d As Document

Dim strText As String

strText = "This is a test. This is a test. This is a test. " & _

"This is a test. This is a test. This is a test. "

strText = strText & " This is the next sentence. " & strText

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, strText)

Set t = s.Text

t.Story.Lines.Item(2, 2).Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


TextRange.LineSpacing

Property LineSpacing As Single

TextRange

Description

The LineSpacing property returns or sets the line spacing in a text range.

Example

The following example displays the line spacing in the text range.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

MsgBox t.Story.LineSpacing

End Sub

 Related Topics


TextRange.LineSpacingType

Property LineSpacingType As cdrLineSpacingType

TextRange

Description

The LineSpacingType property returns or sets the type of line spacing.

Read-Only

Example

The following example sets the line spacing to a percentage of the character height, and then verifies that the option was applied.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is " & _

"sample text to illustrate the line spacing in the " & _

"TextRange object.")

Set t = s.Text

t.Story.SetLineSpacing cdrPercentOfCharacterHeightLineSpacing, 0.3, 0.2, 0.4

If t.Story.LineSpacingType = cdrPercentOfCharacterHeightLineSpacing Then

MsgBox "The line spacing is set to a percentage of the " & _

"character height."

End If

End Sub

 Related Topics


TextRange.MaxCharSpacing

Property MaxCharSpacing As Single

TextRange

Description

The MaxCharSpacing property returns or sets the maximum amount of space between each character.

Example

The following example displays the maximum amount of space between each character.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

MsgBox t.Story.MaxCharSpacing

End Sub

 Related Topics


TextRange.MaxWordSpacing

Property MaxWordSpacing As Single

TextRange

Description

The MaxWordSpacing property returns or sets the maximum amount of space between each word.

Example

The following example displays the maximum amount of space between each word.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

MsgBox t.Story.MaxWordSpacing

End Sub

 Related Topics


TextRange.MinWordSpacing

Property MinWordSpacing As Single

TextRange

Description

The MinWordSpacing property returns or sets the minimum amount of space between each word.

Example

The following example displays the minimum amount of space between each word.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

MsgBox t.Story.MinWordSpacing

End Sub

 Related Topics


TextRange.Outline

Property Outline As Outline

TextRange

Description

The Outline property returns an Outline object.

Read-Only

Example

The following example changes the width of the last word of the paragraph to two inches.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, "This is an example.")

Set t = s.Text

t.Story.Words.Last.Outline.Width = 2

End Sub

 Related Topics


TextRange.Overscore

Property Overscore As cdrFontLine

TextRange

Description

The Overscore property returns or specifies whether an overline is applied to a range.

Example

The following example applies an overline to all of the text in the paragraph.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, "This is an example.")

Set t = s.Text

t.Story.Overscore = cdrDoubleThinFontLine

End Sub

 Related Topics


TextRange.Paragraphs

Property Paragraphs As TextParagraphs

TextRange

Description

The Paragraphs property returns a collection of all paragraphs in a range.

Read-Only

Example

The following example applies bold formatting and underlining to the third paragraph.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Dim strText As String

strText = "This is a paragraph.  " & vbCr & _

"This is a paragraph.  " & vbCr & _

"This is a paragraph.  " & vbCr & _

"This is a paragraph.  " & vbCr & _

"This is a paragraph."

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, strText)

Set t = s.Text

t.Story.Paragraphs.Item(3).Bold = True

t.Story.Paragraphs.Item(3).Underline = cdrDoubleThinFontLine

End Sub

 Related Topics


TextRange.ParaSpacingAfter

Property ParaSpacingAfter As Single

TextRange

Description

The ParaSpacingAfter propertey returns or sets the amount of space after a paragraph.

Example

The following example displays the amount of space after the paragraph.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example")

Set t = s.Text

MsgBox t.Story.ParaSpacingAfter

End Sub

 Related Topics


TextRange.ParaSpacingBefore

Property ParaSpacingBefore As Single

TextRange

Description

The ParaSpacingBefore property returns or sets the amount of space before a paragraph.

Example

The following example displays the amount of space before the paragraph.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

MsgBox t.Story.ParaSpacingBefore

End Sub

 Related Topics


TextRange.Position

Property Position As cdrFontPosition

TextRange

Description

The Position property returns or sets the position of the font.

Example

The following example changes the position of the first word of the paragraph to subscript.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, "This is an example.")

Set t = s.Text

t.Story.Words.First.Position = cdrSubscriptFontPosition

End Sub

 Related Topics


TextRange.RightIndent

Property RightIndent As Double

TextRange

Description

The RightIndent property returns or sets the amount by which the text is indented on the right side.

Example

The following example indents the right side of the paragraph by 0.2 inches.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, _

"This is an example. This is an example. This is an " & _

"example. This is an example.")

Set t = s.Text

t.Story.RightIndent = 0.2

End Sub

 Related Topics


TextRange.Size

Property Size As Single

TextRange

Description

The Size property returns or sets the font size.

Example

The following example sets the font of the paragraph to Arial with a size of 24 pt.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

t.Story.Font = "Arial"

t.Story.Size = 24

End Sub

 Related Topics


TextRange.Start

Property Start As Long

TextRange

Description

The Start property returns the position of the starting character of the range in the text stream.

Example

The following example displays the starting position of the last word.

Sub Test()

Dim s As Shape

Dim d As Document

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

MsgBox "The last word starts at the following position: " & _

t.Story.Words.Last.Start

End Sub

 Related Topics


TextRange.Strikethru

Property Strikethru As cdrFontLine

TextRange

Description

The Strikethru property returns or specifies whether a strikethrough line is applied the range.

Example

The following example applies a strikethrough line to all the text in the paragraph.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, "This is an example.")

Set t = s.Text

t.Story.Strikethru = cdrDoubleThinFontLine

End Sub

 Related Topics


TextRange.Style

Property Style As cdrFontStyle

TextRange

Description

The Style property returns of sets the font style of the range.

Example

The following example applies bold formatting to the paragraph.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, "This is an example.")

Set t = s.Text

t.Story.Style = cdrBoldFontStyle

End Sub

 Related Topics


TextRange.Text

Property Text As String

TextRange

Description

The Text property returns or sets the text string in a range.

The Text property is the default property of the TextRange class.

Example

The following example displays the text in the paragraph.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, "This is an example.")

Set t = s.Text

MsgBox t.Story.Text

End Sub

 Related Topics


TextRange.Underline

Property Underline As cdrFontLine

TextRange

Description

The Underline property returns or specifies whether an underline is applied to the range.

Example

The following example underlines all the text in the paragraph with a double, thin line.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, "This is an example.")

Set t = s.Text

t.Story.Underline = cdrDoubleThinFontLine

End Sub

 Related Topics


TextRange.VertShift

Property VertShift As Long

TextRange

Description

The VertShift property returns or sets the amount by which the text is shifted vertically.

Example

The following example shifts the paragraph vertically.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

t.Story.VertShift = 3

End Sub

 Related Topics


TextRange.WideText

Property WideText As String

TextRange

Description

The WideText property returns or sets a Unicode text string.

Example

The following example creates two Japanese characters using their character codes, and then appends the same two characters to the text string.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphTextWide(2, 2, 8, 8, _

ChrW$(-32022) & ChrW$(-32072), cdrJapanese, cdrCharSetShiftJIS, _

Font:="MS Gothic")

Set t = s.Text

t.Story.InsertAfterWide " " & t.Story.WideText

End Sub

 Related Topics


TextRange.Words

Property Words As TextWords

TextRange

Description

The Words property returns a collection of all words in the range.

Read-Only

Example

The following example underlines the last word of the paragraph and applies bold formatting to the first word.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, "This is an example.")

Set t = s.Text

t.Story.Words.Last.Underline = cdrDoubleThinFontLine

t.Story.Words.First.Bold = True

End Sub

 Related Topics


TextRange.WordSpacing

Property WordSpacing As Single

TextRange

Description

The WordSpacing property returns or sets the amount of space between each word.

Example

The following example displays the word spacing.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

MsgBox t.Story.WordSpacing

End Sub

 Related Topics


TextRange.ChangeCase

Sub ChangeCase(ByVal Case As cdrTextChangeCase)

TextRange

Description

The ChangeCase method changes the case of the text.

Parameters	Description

Case	Specifies the case [in]

Example

The following example converts the text to uppercase.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, _

"This is an example.")

Set t = s.Text

t.Story.ChangeCase cdrTextUpperCase

End Sub

 Related Topics


TextRange.Collapse

Sub Collapse([ByVal ToEnd As Boolean = True])

TextRange

Description

The Collapse method collapses the text range.

Parameters	Description

ToEnd	[in]
Optional
Default value = True

Example

The following example displays the positions of the starting and ending characters of the text range before and after the text is collapsed. It then inserts text and applies bold formatting to the inserted text.

Sub Test()

Dim t As Text

Dim s As Shape

Dim tr As TextRange

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, "This is an example.")

Set t = s.Text

Set tr = t.Story.Words(2, 2)

MsgBox "The text range is from " & tr.Start & " to " & tr.End & " Characters"

tr.Collapse

MsgBox "The text range is from " & tr.Start & " to " & tr.End & " Characters"

tr.Text = " This will be inserted at the current position. "

tr.Bold = True

End Sub

 Related Topics


TextRange.Combine

Sub Combine(ByVal Range As TextRange)

TextRange

Description

The Combine method combines the current text range with the specified range.

Parameters	Description

Range	Specifies the range to be combined [in]

Example

The following example stores the fourth word and the second line in separate text ranges. It duplicates the fourth word and combines it with the text range for the second line. Bold formatting is applied to the fourth word, and the second line is underlined. The combined text range is then filled with red.

Sub Test()

Dim t As Text

Dim s As Shape

Dim trLine As TextRange

Dim trWord As TextRange

Dim tr As TextRange

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, _

"This is a line 1." & vbCr & "This is line 2.")

Set t = s.Text

Set trWord = t.Story.Words(4)

Set trLine = t.Story.Lines(2)

Set tr = trWord.Duplicate

tr.Combine trLine

trWord.Bold = True

trLine.Underline = cdrSingleThickFontLine

tr.Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


TextRange.Copy

Sub Copy()

TextRange

Description

The Copy method copies the text to the clipboard.

Example

The following example creates paragraph text, applies bold formatting to the fourth and fifth words, and italicizes the first word. It then copies the text range and pastes it in the second paragraph.

Sub Test()

Dim d As Document

Dim s As Shape

Dim s1 As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, _

"This is an example.")

Set s1 = d.ActiveLayer.CreateParagraphText(7, 7, 9, 9)

Set t = s.Text

t.Story.Words(4, 2).Bold = True

t.Story.Words(1).Italic = True

t.Story.Copy

s1.Text.Story.Paste

End Sub

 Related Topics


TextRange.Delete

Sub Delete()

TextRange

Description

The Delete method removes the specified characters from the text range.

Example

The following example deletes the first word in the text range.

Sub Test()

Dim d As Document

Dim t As Text

Dim s As Shape

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

t.Story.Words.First.Delete

End Sub

 Related Topics


TextRange.Duplicate

Function Duplicate() As TextRange

TextRange

Description

The Duplicate method returns a copy of the TextRange object.

Return value

Returns TextRange

Example

The following example duplicates the first five characters of the paragraph and displays them in a message box.

Sub Test()

Dim d As Document

Dim t As Text

Dim s As Shape

Dim tr As TextRange

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

Set tr = t.Story.Characters(1, 5).Duplicate

MsgBox "The text that is duplicated is: " & vbCr & tr.Text

End Sub

 Related Topics


TextRange.InRange

Function InRange(ByVal Range As TextRange) As Boolean

TextRange

Description

The InRange method returns whether the current text range is within the specified range.

Parameters	Description

Range	Specifies the range [in]

Return value

Returns Boolean

Example

The following example displays whether the second word is in the first frame.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, _

"This is an example")

Set t = s.Text

If t.Story.Words(2).InRange(t.Frames(1).Range) Then

MsgBox "The second word is in the first frame."

Else

MsgBox "The second word is not in the first frame."

End If

End Sub

 Related Topics


TextRange.InsertAfter

Function InsertAfter(ByVal Text As String, [ByVal LanguageID As cdrTextLanguage = cdrLanguageNone (0)], [ByVal CharSet As cdrTextCharSet = cdrCharSetMixed (-1)], [ByVal Font As String]) As TextRange

TextRange

Description

The InsertAfter method inserts text after the last character in the text range, and returns a text range which contains only the inserted characters.

Parameters	Description

Text	Specifies the text to insert [in]

LanguageID	Specifies the language code [in]
Optional
Default value = cdrLanguageNone (0)

CharSet	Specifies the character set [in]
Optional
Default value = cdrCharSetMixed (-1)

Font	Specifies the font [in]
Optional

Return value

Returns TextRange

Example

The following example inserts the sentence, "This will be inserted last," after the paragraph text, "This is an example."

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, _

"This is an example.")

Set t = s.Text

t.Story.InsertAfter ("This will be inserted last. ")

End Sub

 Related Topics


TextRange.InsertAfterWide

Function InsertAfterWide(ByVal Text As String, [ByVal LanguageID As cdrTextLanguage = cdrLanguageNone (0)], [ByVal CharSet As cdrTextCharSet = cdrCharSetMixed (-1)], [ByVal Font As String]) As TextRange

TextRange

Description

The InsertAfterWide method inserts Unicode text after the last character in the text range, and returns a text range which contains only the inserted characters.

Parameters	Description

Text	Specifies the text to insert [in]

LanguageID	Specifies the language code [in]
Optional
Default value = cdrLanguageNone (0)

CharSet	Specifies the character set [in]
Optional
Default value = cdrCharSetMixed (-1)

Font	Specifies the font [in]
Optional

Return value

Returns TextRange

Example

The following example creates two Japanese characters using their character codes, and then inserts the same two characters after the first ones.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphTextWide(2, 2, 8, 8, _

ChrW$(-32022) & ChrW$(-32072), cdrJapanese, cdrCharSetShiftJIS, _

Font:="MS Gothic")

Set t = s.Text

t.Story.InsertAfterWide " " & t.Story.WideText

End Sub

 Related Topics


TextRange.InsertBefore

Function InsertBefore(ByVal Text As String, [ByVal LanguageID As cdrTextLanguage = cdrLanguageNone (0)], [ByVal CharSet As cdrTextCharSet = cdrCharSetMixed (-1)], [ByVal Font As String]) As TextRange

TextRange

Description

The InsertBefore method inserts new text before the first character in the text range, and returns a text range which contains only the inserted characters.

Parameters	Description

Text	Specifies the text to insert [in]

LanguageID	Specifies the language code [in]
Optional
Default value = cdrLanguageNone (0)

CharSet	Specifies the character set [in]
Optional
Default value = cdrCharSetMixed (-1)

Font	Specifies the font [in]
Optional

Return value

Returns TextRange

Example

The following example inserts the sentence, "This will be inserted first," before the paragraph text, "This is an example."

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, _

"This is an example.")

Set t = s.Text

t.Story.InsertBefore ("This will be inserted first. ")

End Sub

 Related Topics


TextRange.InsertBeforeWide

Function InsertBeforeWide(ByVal Text As String, [ByVal LanguageID As cdrTextLanguage = cdrLanguageNone (0)], [ByVal CharSet As cdrTextCharSet = cdrCharSetMixed (-1)], [ByVal Font As String]) As TextRange

TextRange

Description

The InsertBeforeWide method inserts Unicode text before the first character in the text range, and returns a text range which contains only the inserted characters.

Parameters	Description

Text	Specifies the text to insert [in]

LanguageID	Specifies the language code [in]
Optional
Default value = cdrLanguageNone (0)

CharSet	Specifies the character set [in]
Optional
Default value = cdrCharSetMixed (-1)

Font	Specifies the font [in]
Optional

Return value

Returns TextRange

Example

The following example creates two Japanese characters using their character codes, and then inserts the same two characters before the first ones.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphTextWide(2, 2, 8, 8, _

ChrW$(-32022) & ChrW$(-32072), cdrJapanese, cdrCharSetShiftJIS, _

Font:="MS Gothic")

Set t = s.Text

t.Story.InsertBeforeWide " " & t.Story.WideText

End Sub

 Related Topics


TextRange.IsSame

Function IsSame(ByVal Range As TextRange) As Boolean

TextRange

Description

The IsSame method returns whether the current text range is the same as the specified range.

Parameters	Description

Range	Specifies the range to compare [in]

Return value

Returns Boolean

Example

The following example displays whether all the words are in the first frame.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, "This is an example.")

Set t = s.Text

If t.Story.Words.All.IsSame(t.Frames(1).Range) Then

MsgBox "All of the words are in the first range."

End If

End Sub

 Related Topics


TextRange.Paste

Function Paste() As TextRange

TextRange

Description

The Paste method replaces a text range and returns the new one.

Return value

Returns TextRange

Example

The following example creates paragraph text, applies bold formatting to the fourth and fifth words, and italicizes the first word. It then copies the text range and pastes it in the second paragraph.

Sub Test()

Dim d As Document

Dim s As Shape

Dim s1 As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, _

"This is an example.")

Set s1 = d.ActiveLayer.CreateParagraphText(7, 7, 9, 9)

Set t = s.Text

t.Story.Words(4, 2).Bold = True

t.Story.Words(1).Italic = True

t.Story.Copy

s1.Text.Story.Paste

End Sub

 Related Topics


TextRange.Range

Function Range(ByVal Start As Long, ByVal End As Long) As TextRange

TextRange

Description

The Range method returns a range of characters.

Parameters	Description

Start	Specifies the first character in the range [in]

End	Specifies the last character in the range [in]

Return value

Returns TextRange

Example

The following example applies bold formatting to the fourth to seventh characters in the range.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, _

"This is an example.")

Set t = s.Text

t.Story.Range(4, 7).Bold = True

End Sub

 Related Topics


TextRange.Replace

Function Replace(ByVal Text As String, [ByVal LanguageID As cdrTextLanguage = cdrLanguageNone (0)], [ByVal CharSet As cdrTextCharSet = cdrCharSetMixed (-1)], [ByVal Font As String]) As TextRange

TextRange

Description

The Replace method replaces the text range with the text string and returns the new range.

Parameters	Description

Text	Specifies the text to insert [in]

LanguageID	Specifies the language code [in]
Optional
Default value = cdrLanguageNone (0)

CharSet	Specifies the character set [in]
Optional
Default value = cdrCharSetMixed (-1)

Font	Specifies the font [in]
Optional

Return value

Returns TextRange

Example

The following example replaces the first word with new text.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, _

"This is an example.")

Set t = s.Text

t.Story.Words.First.Replace "This will replace the first word " & _

"with this text "

End Sub

 Related Topics


TextRange.ReplaceWide

Function ReplaceWide(ByVal Text As String, [ByVal LanguageID As cdrTextLanguage = cdrLanguageNone (0)], [ByVal CharSet As cdrTextCharSet = cdrCharSetMixed (-1)], [ByVal Font As String]) As TextRange

TextRange

Description

The ReplaceWide method replaces the text range with Unicode text and returns the new range.

Parameters	Description

Text	Specifies the text to insert [in]

LanguageID	Specifies the language code [in]
Optional
Default value = cdrLanguageNone (0)

CharSet	Specifies the character set [in]
Optional
Default value = cdrCharSetMixed (-1)

Font	Specifies the font [in]
Optional

Return value

Returns TextRange

Example

The following example creates two Japanese characters using their character codes, and then replaces the first character with the two that were first created.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphTextWide(2, 2, 8, 8, _

ChrW$(-32022) & ChrW$(-32072), cdrJapanese, cdrCharSetShiftJIS, _

Font:="MS Gothic")

Set t = s.Text

t.Story.Characters.First.ReplaceWide ChrW$(-32022) & ChrW$(-32072)

End Sub

 Related Topics


TextRange.Select

Sub Select()

TextRange

Description

The Select method selects the characters in the text range.

Example

The following example places the text in editing mode and selects the first word.

Sub Test()

Dim d As Document

Dim t As Text

Dim s As Shape

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")

Set t = s.Text

t.BeginEdit

t.Story.Words.First.Select

End Sub

 Related Topics


TextRange.SetLineSpacing

Sub SetLineSpacing(ByVal Type As cdrLineSpacingType, [ByVal LineSpacing As Single = -1], [ByVal ParaBefore As Single = -1], [ByVal ParaAfter As Single = -1])

TextRange

Description

The SetLineSpacing property sets the properties for line spacing in a text range.

Parameters	Description

Type	Specifies how to measure the line spacing [in]

LineSpacing	Specifies the value for line spacing [in]
Optional
Default value = -1

ParaBefore	[in]
Optional
Default value = -1

ParaAfter	[in]
Optional
Default value = -1

Example

The following example sets the line spacing to a percentage of the character height, and then verifies that the option was applied.

Sub Test()

Dim d As Document

Dim s As Shape

Dim t As Text

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is " & _

"sample text to illustrate the line spacing in the " & _

"TextRange object.")

Set t = s.Text

t.Story.SetLineSpacing cdrPercentOfCharacterHeightLineSpacing, 0.3, 0.2, 0.4

If t.Story.LineSpacingType = cdrPercentOfCharacterHeightLineSpacing Then

If t.Story.LineSpacingType = cdrPercentOfCharacterHeightLineSpacing Then

MsgBox "The line spacing is set to a percentage of the " & _

"character height."

End If

End Sub

 Related Topics


TextRange.SetRange

Sub SetRange(ByVal Start As Long, ByVal End As Long)

TextRange

Description

The SetRange method sets the starting and ending positions of the text range.

Parameters	Description

Start	Specifies the starting position [in]

End	Specifies the ending position [in]

Example

The following example underlines the text range that includes the third to the tenth characters.

Sub Test()

Dim s As Shape

Dim tr As TextRange

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, _

"This is an example")

Set tr = s.Text.Story

tr.SetRange 3, 10

tr.Underline = cdrDoubleThinFontLine

End Sub

 Related Topics


TextureFill properties

TextureFill     Legend

    LibraryName
      MaximumTileWidth
      MirrorFill
      OriginX
      OriginY
    Properties
      Resolution
      RotationAngle
      SkewAngle
    StyleName
    TextureName
      TileHeight
      TileOffset
      TileOffsetType
      TileWidth
      TransformWithShape


TextureFill methods

TextureFill     Legend

   Select
   SetProperties


TextureFill

Class TextureFill

Properties     Methods     Referenced By

The TextureFill class represents the properties of a texture fill pattern.

 Related Topics


TextureFill.LibraryName

Property LibraryName As String

TextureFill

Description

The LibraryName property returns the name of the texture library for a texture fill pattern.

Read-Only

Example

The following example displays the names of the texture pattern fill and the texture library for each texture fill found in the drawing.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Dim ss As String

Dim r As VbMsgBoxResult

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrTextureFill Then

Set tf = s.Fill.Texture

s.CreateSelection ' Select the shape

ss = "Texture Name: " & tf.TextureName & vbCr & "Library Name: "

If tf.LibraryName = "" Then

ss = ss & "Styles"

Else

ss = ss & tf.LibraryName

End If

ss = ss & vbCr & "Style Name: " & tf.StyleName & vbCr

ss = ss & vbCr & "Press OK to continue"

r = MsgBox(ss, vbOKCancel)

If r = vbCancel Then Exit For

End If

Next s

End Sub

 Related Topics


TextureFill.MaximumTileWidth

Property MaximumTileWidth As Long

TextureFill

Description

The MaximumTileWidth property returns or sets the maximum size of a tile in a texture fill pattern, measured in pixels.

Example

The following example applies a texture fill to a rectangle and displays the maximum size of tiles in the texture.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set tf = s.Fill.ApplyTextureFill("Leather 3C")

MsgBox "Max tile width = " & tf.MaximumTileWidth

End Sub

 Related Topics


TextureFill.MirrorFill

Property MirrorFill As Boolean

TextureFill

Description

The MirrorFill property returns or sets whether pattern tiles should be mirrored to conceal seams.

Example

The following example applies a symmetrical texture fill to a rectangle.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set tf = s.Fill.ApplyTextureFill("CMYK", "Samples 9")

tf.TileWidth = 2

tf.TileHeight = 2

tf.MirrorFill = True

End Sub

 Related Topics


TextureFill.OriginX

Property OriginX As Double

TextureFill

Description

The OriginX property returns or sets the horizontal offset of the tile from the lower left-hand corner of the parent shape.

The OriginX property is measured in document units.

Example

The following example applies a texture to a rectangle and offsets the tile by 1" to the left.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set tf = s.Fill.ApplyTextureFill("Above the Storm", "Samples 9")

tf.OriginX = 1

End Sub

 Related Topics


TextureFill.OriginY

Property OriginY As Double

TextureFill

Description

The OriginY property returns or sets the vertical offset of the tile from the lower left-hand corner of the parent shape.

The OriginY property is measured in document units.

Example

The following example applies a texture to a rectangle and offsets the tile by 1" from the bottom of the page.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set tf = s.Fill.ApplyTextureFill("Above the Storm", "Samples 9")

tf.OriginY = 1

End Sub

 Related Topics


TextureFill.Properties

Property Properties As TextureFillProperties

TextureFill

Description

The Properties property returns the TextureFillProperties which allows you to return and modify parameters of a texture fill pattern.

Each texture fill pattern has a range of properties and some textures have more properties than others. For example, the texture Heavenly Clouds has 9 properties and Midday Clouds has 6 properties.

Read-Only

Example

The following example applies a texture fill and changes two of its parameters.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set tf = s.Fill.ApplyTextureFill("Banded malachite", "Samples")

tf.Properties("Softness %:").Value = 80

tf.Properties("1st mineral:").Value = CreateRGBColor(255, 0, 0)

End Sub

 Related Topics


TextureFill.Resolution

Property Resolution As Long

TextureFill

Description

The Resolution property returns or sets the resolution of a texture fill pattern in pixels per inch.

Example

The following example applies a texture to a rectangle and displays the texture's resolution.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set tf = s.Fill.ApplyTextureFill("Circuit board", "Samples 6")

MsgBox "Texture resolution: " & tf.Resolution

End Sub

 Related Topics


TextureFill.RotationAngle

Property RotationAngle As Double

TextureFill

Description

The RotationAngle property returns or sets the angle of the rotation of a tile in a texture pattern fill.

Example

The following example creates a texture pattern that is rotated by 45 degrees and skewed by 10 degrees.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set tf = s.Fill.ApplyTextureFill("Scribbles")

tf.SetProperties 14430, 5, 90

tf.RotationAngle = 45

tf.SkewAngle = 10

End Sub

 Related Topics


TextureFill.SkewAngle

Property SkewAngle As Double

TextureFill

Description

The SkewAngle property returns or sets the angle of the slant of a tile in a texture fill pattern.

Example

The following example creates a texture pattern that is rotated by 45 degrees and skewed by 10 degrees.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set tf = s.Fill.ApplyTextureFill("Scribbles")

tf.SetProperties 14430, 5, 90

tf.RotationAngle = 45

tf.SkewAngle = 10

End Sub

 Related Topics


TextureFill.StyleName

Property StyleName As String

TextureFill

Description

The StyleName property returns the name of the style upon which the texture is based.

Read-Only

Example

The following example displays the names of the texture pattern fill and the texture library for each texture fill found in the drawing.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Dim ss As String

Dim r As VbMsgBoxResult

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrTextureFill Then

Set tf = s.Fill.Texture

s.CreateSelection ' Select the shape

ss = "Texture Name: " & tf.TextureName & vbCr & "Library Name: "

If tf.LibraryName = "" Then

ss = ss & "Styles"

Else

ss = ss & tf.LibraryName

End If

ss = ss & vbCr & "Style Name: " & tf.StyleName & vbCr

ss = ss & vbCr & "Press OK to continue"

r = MsgBox(ss, vbOKCancel)

If r = vbCancel Then Exit For

End If

Next s

End Sub

 Related Topics


TextureFill.TextureName

Property TextureName As String

TextureFill

Description

The TextureName property returns the name of a texture fill pattern.

Read-Only

Example

The following example displays the names of the texture pattern fill and the texture library for each texture fill found in the drawing.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Dim ss As String

Dim r As VbMsgBoxResult

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrTextureFill Then

Set tf = s.Fill.Texture

s.CreateSelection ' Select the shape

ss = "Texture Name: " & tf.TextureName & vbCr & "Library Name: "

If tf.LibraryName = "" Then

ss = ss & "Styles"

Else

ss = ss & tf.LibraryName

End If

ss = ss & vbCr & "Style Name: " & tf.StyleName & vbCr

ss = ss & vbCr & "Press OK to continue"

r = MsgBox(ss, vbOKCancel)

If r = vbCancel Then Exit For

End If

Next s

End Sub

 Related Topics


TextureFill.TileHeight

Property TileHeight As Double

TextureFill

Description

The TileHeight property returns or sets the vertical size of a tile in a texture fill pattern.

The TileHeight property is measured in document units.

Example

The following example applies a texture pattern to a rectangle, so that the tile is repeated twice horizontally and three times vertically.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set tf = s.Fill.ApplyTextureFill("Water Color")

tf.TileHeight = s.SizeWidth / 2

tf.TileWidth = s.SizeHeight / 3

End Sub

 Related Topics


TextureFill.TileOffset

Property TileOffset As Long

TextureFill

Description

The TileOffset property returns or sets the offset, measured as a percentage of the size of the tile of a texture fill pattern.

You can use the TileOffsetType to specify whether the pattern is offset by row or by column.

Example

The following example applies a texture pattern to a rectangle and offsets each row of tiles by 20% relative to each other.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set tf = s.Fill.ApplyTextureFill("Water Color")

tf.TileHeight = 0.5

tf.TileWidth = 0.5

tf.TileOffsetType = cdrTileOffsetRow

tf.TileOffset = 20

End Sub

 Related Topics


TextureFill.TileOffsetType

Property TileOffsetType As cdrTileOffsetType

TextureFill

Description

The TileOffsetType property returns or sets the type of offset of a tile in a texture fill pattern.

A texture fill pattern may be offset by row or by column. The TileOffsetType property returns a value of cdrTileOffsetType.

You can use the TileOffset property to specify the percentage of offset for adjacent rows or columns.

Example

The following example applies a texture pattern to a rectangle and offsets each row of tiles by 20% relative to each other.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set tf = s.Fill.ApplyTextureFill("Water Color")

tf.TileHeight = 0.5

tf.TileWidth = 0.5

tf.TileOffsetType = cdrTileOffsetRow

tf.TileOffset = 20

End Sub

 Related Topics


TextureFill.TileWidth

Property TileWidth As Double

TextureFill

Description

The TileWidth property returns or sets the horizontal size of a tile in a texture fill pattern.

The TileWidth property is measured in document units.

Example

The following example applies a texture pattern to a rectangle, so that the tile is repeated twice horizontally and three times vertically.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set tf = s.Fill.ApplyTextureFill("Water Color")

tf.TileHeight = s.SizeWidth / 2

tf.TileWidth = s.SizeHeight / 3

End Sub

 Related Topics


TextureFill.TransformWithShape

Property TransformWithShape As Boolean

TextureFill

Description

The TransformWithShape property returns or sets whether the texture fill pattern is transformed when the parent shape is altered. If set to True, the texture fill pattern will change according to transformations in its parent shape. If set to False, the texture fill pattern will remain the same, despite changes of the parent shape.

Example

The following example applies a texture fill to a rectangle and specifies that no transformations are made to the fill when the shape is transformed. It then duplicates the shape and stretches it by 200%.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 4, 4)

Set tf = s.Fill.ApplyTextureFill("Water Color")

tf.TileHeight = 2

tf.TileWidth = 2

tf.TransformWithShape = False

Set s = s.Duplicate(4, 0)

s.StretchEx 2, 3, 4, 0

End Sub

 Related Topics


TextureFill.Select

Sub Select(ByVal Texture As String, [ByVal Library As String])

TextureFill

Description

The Select method replaces a texture fill in a shape with another texture fill.

Parameters	Description

Texture	Specifies the name of the texture to be applied [in]

Library	Specifies the name of the texture library to which the texture belongs [in]
Optional

Example

The following example loops though all shapes on a page and searches for a modified texture fill that is based on a preset library. When found, it replaces the fill with the original style pattern upon which the current fill is based.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

For Each s In ActivePage.Shapes

If s.Fill.Type = cdrTextureFill Then

Set tf = s.Fill.Texture

If tf.LibraryName <> "" Then

tf.Select tf.StyleName

End If

End If

Next s

End Sub

 Related Topics


TextureFill.SetProperties

Sub SetProperties(ByRef SettingArray() As Variant)

TextureFill

Description

The SetProperties method allows you to set all the properties of a texture fill with a single command.

Parameters	Description

SettingArray	Specifies the new parameter for a TextureFillProperty [in]

Example

The following example applies the "Vapor 2C" texture to a rectangle and modifies the following properties: Texture #=20611, Density=30%, Softness=75%, Background=Black, Vapor=40% Cyan, Brightness=20%.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

Set tf = s.Fill.ApplyTextureFill("Vapor 2C")

tf.SetProperties 20611, 30, 75, CreateRGBColor(0, 0, 0), CreateRGBColor(117, 197, 240), 20

End Sub

 Related Topics


TextureFillProperties properties

TextureFillProperties     Legend

    Count
  Item


TextureFillProperties

Class TextureFillProperties

Properties     Referenced By

The TextureFillProperties class represents a collection of parameters of a texture fill.

See the TextureFill object for more information.

 Related Topics


TextureFillProperties.Count

Property Count As Long

TextureFillProperties

Description

The Count property returns the number of parameters available for a particular type of texture fill.

Read-Only

Example

The following example applies a texture fill to a rectangle and displays the number of parameters which the texture contains.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

Set tf = s.Fill.ApplyTextureFill("Vapor 2C")

MsgBox "Texture '" & tf.TextureName & "' has " & _

tf.Properties.Count & " parameters"

End Sub

 Related Topics


TextureFillProperties.Item

Property Item(ByVal IndexOrName As Variant) As TextureFillProperty

TextureFillProperties

Description

The Item property returns a TextureFillProperty object which represents a single parameter of a texture fill.

The Item property is the default property and its reference may be omitted when accessing an items in the collection. For example, TextureFillProperties.Item(2) is the same as TextureFillProperties(2) - they both reference the second TextureFillProperty in the TextureFillProperties collection.

Names of parameters are localized in international versions of CorelDRAW. If you choose to use parameter names, your macros might need to be revised for localized builds of CorelDRAW (such as German and French).

Read-Only

Parameters	Description

IndexOrName	Specifies the property by its index number or name [in]

Example

The following example displays detailed information about the texture fill of a selected shape, including a list of all parameters and their values.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Dim prop As TextureFillProperty

Dim ss As String, i As Long

Set s = ActiveShape

If s Is Nothing Then

MsgBox "Nothing selected"

Exit Sub

End If

If s.Fill.Type <> cdrTextureFill Then

MsgBox "Select a shape with texture fill"

Exit Sub

End If

Set tf = s.Fill.Texture

ss = "Texture Name: " & tf.TextureName & vbCr & "Library Name: "

If tf.LibraryName = "" Then

ss = ss & "Styles"

Else

ss = ss & tf.LibraryName

End If

ss = ss & vbCr & "Style Name: " & tf.StyleName & vbCr

ss = ss & vbCr & "Parameters: "

For i = 1 To tf.Properties.Count

Set prop = tf.Properties(i)

ss = ss & vbCr & prop.Name & " "

If prop.Type = cdrTexturePropertyNumeric Then

ss = ss & prop.Value

Else

ss = ss & "Color(" & prop.Value.Name(True) & ")"

End If

Next i

MsgBox ss

End Sub

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

Set tf = s.Fill.ApplyTextureFill("Dark Cloud", "Samples 8")

tf.Properties("Texture #:").Value = 78

End Sub

 Related Topics


TextureFillProperty properties

TextureFillProperty     Legend

    Name
    Type
    Value


TextureFillProperty

Class TextureFillProperty

Properties     Referenced By

The TextureFillProperty class represents a single texture fill property.

See the TextureFill and TextureFillProperties objects for more information.

 Related Topics


TextureFillProperty.Name

Property Name As String

TextureFillProperty

Description

The Name returns the name of a parameter.

Read-Only

Example

The following example displays the name of the third parameter of the texture "Fire Flies" from the library "Samples 9."

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

Set tf = s.Fill.ApplyTextureFill("Fire Flies", "Samples 9")

MsgBox tf.Properties(3).Name

End Sub

 Related Topics


TextureFillProperty.Type

Property Type As cdrTexturePropertyType

TextureFillProperty

Description

The Type returns the type of a property of a texture fill. The type can be a numeric or a color value. This property returns a value of cdrTexturePropertyType.

Read-Only

Example

The following example displays detailed information about the texture fill of a selected shape, including a list of all parameters and their values.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Dim prop As TextureFillProperty

Dim ss As String

Set s = ActiveShape

If s Is Nothing Then

MsgBox "Nothing selected"

Exit Sub

End If

If s.Fill.Type <> cdrTextureFill Then

MsgBox "Select a shape with texture fill"

Exit Sub

End If

Set tf = s.Fill.Texture

ss = "Texture Name: " & tf.TextureName & vbCr & "Library Name: "

If tf.LibraryName = "" Then

ss = ss & "Styles"

Else

ss = ss & tf.LibraryName

End If

ss = ss & vbCr & "Style Name: " & tf.StyleName & vbCr

ss = ss & vbCr & "Parameters: "

For Each prop In tf.Properties

ss = ss & vbCr & prop.Name & " "

If prop.Type = cdrTexturePropertyNumeric Then

ss = ss & prop.Value

Else

ss = ss & "Color(" & prop.Value.Name(True) & ")"

End If

Next prop

MsgBox ss

End Sub

 Related Topics


TextureFillProperty.Value

Property Value As Variant

TextureFillProperty

Description

The Value property returns or sets the value (numeric or color) of a property of a texture fill.

Example

The following example creates a rectangle and applies a texture fill to it. It then modifies two parameters of the fill.

Sub Test()

Dim s As Shape

Dim tf As TextureFill

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

Set tf = s.Fill.ApplyTextureFill("Dark Cloud", "Samples 8")

tf.Properties("Texture #:").Value = 150

tf.Properties("Top left:").Value = CreateRGBColor(255, 0, 0)

End Sub

 Related Topics


TextWords properties

TextWords     Legend

    All
    Count
    First
  Item
    Last


TextWords

Class TextWords

Properties     Referenced By

TextWords Class

 Related Topics


TextWords.All

Property All As TextRange

TextWords

Description

The All property returns a TextRange object which contains all words in the collection.

Read-Only

Example

The following example creates paragraph text and applies bold formatting to all the words.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, _

"This is an example for the TextWords class.")

Set t = s.Text

t.Story.Words.All.Bold = True

End Sub

 Related Topics


TextWords.Count

Property Count As Long

TextWords

Description

The Count property returns the number of words in the collection.

Read-Only

Example

The following example creates paragraph text and displays the number of words.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, _

"This is an example for the TextWords Class")

Set t = s.Text

MsgBox "The total number of words is " & t.Story.Words.Count

End Sub

 Related Topics


TextWords.First

Property First As TextRange

TextWords

Description

The First property returns a TextRange which contains the first word in the collection.

Read-Only

Example

The following example creates paragraph text and fills the first word with red.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, _

"This is an example for the TextWords class.")

Set t = s.Text

t.Story.Words.First.Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


TextWords.Item

Property Item(ByVal Index As Long, [ByVal Count As Long = 1]) As TextRange

TextWords

Description

The Item property returns a reference to the specified word.

Read-Only

Parameters	Description

Index	Specifies the word by its index number in base 1 [in]

Count	Specifies the number of words [in]
Optional
Default value = 1

Example

The following example creates paragraph text and applies bold formatting to the first word, underlines the fourth word, and fills the seventh and eighth words with red.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, _

"This is an example for the TextWords Class")

Set t = s.Text

t.Story.Words.Item(1).Bold = True

t.Story.Words.Item(4).Underline = cdrSingleThickFontLine

t.Story.Words.Item(7, 2).Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


TextWords.Last

Property Last As TextRange

TextWords

Description

The Last propertey returns a TextRange object which contain the last word in the collection.

Read-Only

Example

The following example creates paragraph text and fills the last word with red.

Sub Test()

Dim t As Text

Dim s As Shape

Dim d As Document

Set d = CreateDocument

Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, _

"This is an example for the TextWords Class")

Set t = s.Text

t.Story.Words.Last.Fill.UniformColor.RGBAssign 155, 0, 0

End Sub

 Related Topics


Transparency properties

Transparency     Legend

    Application
      AppliedTo
      End
      Fountain
    Frozen
      MergeMode
    Parent
      Pattern
      Start
      Texture
    Type
      Uniform


Transparency methods

Transparency     Legend

   ApplyFountainTransparency
   ApplyNoTransparency
   ApplyPatternTransparency
   ApplyTextureTransparency
   ApplyUniformTransparency
   Freeze
   Unfreeze


Transparency

Class Transparency

Properties     Methods     Referenced By

The Transparency class represents the transparency of a shape.

 Related Topics


Transparency.Application

Property Application As Object

Transparency

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Transparency.AppliedTo

Property AppliedTo As cdrTransparencyAppliedTo

Transparency

Description

The AppliedTo property returns or sets whether the transparency is applied to a shape's fill, outline, or both.

Example

The following example creates a rectangle with a fill and an outline, and applies a fountain transparency to its outline.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle2(0, 0, 2, 2, 0.5, 0.5, 0.5, 0.5)

s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(255, 255, 0), , 45

s.Outline.Width = 0.3

s.Outline.Color.RGBAssign 0, 128, 0

s.Transparency.ApplyFountainTransparency 0, 100, cdrLinearFountainFill

s.Transparency.AppliedTo = cdrApplyToOutline

End Sub

 Related Topics


Transparency.End

Property End As Long

Transparency

Description

The End property returns or sets a percentage value that indicates the level of transparency at the end of a fountain transparency. Higher values indicate a greater degree of transparency.

Example

The following example creates a rectangle and applies a radial fountain transparency to it. It then duplicates the rectangle and inverts its transparency.

Sub Test()

Dim s As Shape, s1 As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s.Fill.UniformColor.RGBAssign 255, 0, 0

s.Transparency.ApplyFountainTransparency , , cdrRadialFountainFill

Set s1 = s.Duplicate(2, 0)

s1.Transparency.Start = 100

s1.Transparency.End = 0

End Sub

 Related Topics


Transparency.Fountain

Property Fountain As FountainFill

Transparency

Description

The Fountain property returns a FountainFill object which represents the properties of a fountain transparency.

Example

The following example sets the direction angle of all fountain transparencies to 45 degrees.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Transparency.Type = cdrFountainTransparency Then

s.Transparency.Fountain.SetAngle 45

End If

Next s

End Sub

 Related Topics


Transparency.Frozen

Property Frozen As Boolean

Transparency

Description

The Frozen property returns a True value if a transparency is frozen.

This property is reserved for future development.

Read-Only

 Related Topics


Transparency.MergeMode

Property MergeMode As cdrMergeMode

Transparency

Description

The MergeMode property returns or sets the merge mode for a transparency.

Example

The following example creates a polygon and applies a merge mode to the transparency.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(1, 1, 3, 3)

s.Transparency.ApplyUniformTransparency (10)

Set s = ActiveLayer.CreatePolygon(1, 4, 5, 6, 6)

s.Transparency.ApplyTextureTransparency "Above the storm"

For Each s In ActivePage.Shapes

If s.Transparency.Type = cdrTextureTransparency Then

s.Transparency.MergeMode = cdrMergeBlue

End If

Next s

End Sub

 Related Topics


Transparency.Parent

Property Parent As Object

Transparency

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Transparency.Pattern

Property Pattern As PatternFill

Transparency

Description

The Pattern property returns a PatternFill object that represents the properties of a pattern transparency.

Example

The following example creates a rectangle and applies a two-color pattern transparency to it. It then skews the pattern by 20°.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s.Fill.UniformColor.RGBAssign 255, 0, 0

s.Transparency.ApplyPatternTransparency cdrTwoColorPattern, , 1

s.Transparency.Pattern.BackColor.GrayAssign 255

s.Transparency.Pattern.SkewAngle = 20

End Sub

 Related Topics


Transparency.Start

Property Start As Long

Transparency

Description

The Start property returns or sets a percentage value that indicates the level of transparency at the beginning of a fountain transparency. Higher values indicate a greater degree of transparency.

Example

The following example creates a rectangle and applies a radial fountain transparency to it. It then duplicates the rectangle and inverts its transparency.

Sub Test()

Dim s As Shape, s1 As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s.Fill.UniformColor.RGBAssign 255, 0, 0

s.Transparency.ApplyFountainTransparency , , cdrRadialFountainFill

Set s1 = s.Duplicate(2, 0)

s1.Transparency.Start = 100

s1.Transparency.End = 0

End Sub

 Related Topics


Transparency.Texture

Property Texture As TextureFill

Transparency

Description

The Texture property returns a TextureFill object which represents the properties of a texture transparency.

Example

The following example creates a rectangle and applies a texture transparency to it

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s.Fill.UniformColor.RGBAssign 0, 0, 255

s.Transparency.ApplyTextureTransparency "Water Color2 2C", ""

s.Transparency.Texture.Properties("Background:").Value = CreateRGBColor(0, 0, 0)

End Sub

 Related Topics


Transparency.Type

Property Type As cdrTransparencyType

Transparency

Description

The Type property returns or sets the type of the transparency.

The Type property returns cdrTransparencyType.

Read-Only

Example

The following example removes all fountain transparencies.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Transparency.Type <> cdrFountainTransparency Then

s.Transparency.ApplyNoTransparency

End If

Next s

End Sub

 Related Topics


Transparency.Uniform

Property Uniform As Long

Transparency

Description

The Uniform property returns or sets a percentage value that indicates the level of a uniform transparency. Higher values indicate a greater degree of transparency.

Example

The following example sets the transparency of all objects with a uniform transparency to 50%.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Transparency.Type = cdrUniformTransparency Then

s.Transparency.Uniform = 50

End If

Next s

End Sub

 Related Topics


Transparency.ApplyFountainTransparency

Function ApplyFountainTransparency([ByVal Start As Long = 0], [ByVal End As Long = 100], [ByVal Type As cdrFountainFillType = cdrLinearFountainFill (1)], [ByVal Angle As Double = 0], [ByVal Steps As Long = 0], [ByVal EdgePad As Long = 0], [ByVal MidPoint As Long = 50]) As FountainFill

Transparency

Description

The ApplyFountainTransparency method applies a fountain fill transparency to a shape.

Parameters	Description

Start	Represents a percentage value that indicates the level of transparency in the beginning of a fountain transparency. Higher values indicate a greater degree of transparency. [in]
Optional
Default value = 0

End	Represents a percentage value that indicates the level of transparency in the end of a fountain transparency. Higher values indicate a greater degree of transparency. [in]
Optional
Default value = 100

Type	Specifies the type of fountain fill in the transparency. The Type parameter has a value of cdrFountainFillType. [in]
Optional
Default value = cdrLinearFountainFill (1)

Angle	Specifies the degree of the slant in linear, conical, or square fountain fill transparencies. Positive values rotate the fill counterclockwise; negative values rotate it clockwise. [in]
Optional
Default value = 0

Steps	Specifies the number of bands (steps) used to display a fountain fill [in]
Optional
Default value = 0

EdgePad	Specifies the length of solid colors at the beginning and end of the fountain transparency before they start blending with the next color in the fountain fill. You can change the edge pad of linear, radial, and square fountain fills. [in]
Optional
Default value = 0

MidPoint	Represents the position of the mid-point, the point at which two colors in a fountain fill converge [in]
Optional
Default value = 50

Return value

Returns FountainFill

Example

The following example applies a radial fountain transparency to each shape that has fill.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Fill.Type <> cdrNoFill Then

s.Transparency.ApplyFountainTransparency 0, 90, cdrRadialFountainFill

End If

Next s

End Sub

 Related Topics


Transparency.ApplyNoTransparency

Sub ApplyNoTransparency()

Transparency

Description

The ApplyNoTransparency method removes all transparencies from a shape.

Example

The following example removes all transparencies from all shapes on the active page.

Sub Test()

Dim s As Shape

For Each s In ActivePage.Shapes

If s.Transparency.Type <> cdrNoTransparency Then

s.Transparency.ApplyNoTransparency

End If

Next s

End Sub

 Related Topics


Transparency.ApplyPatternTransparency

Function ApplyPatternTransparency(ByVal Type As cdrPatternFillType, [ByVal FileName As String], [ByVal PatternCanvasIndex As Long = 1], [ByVal Front As Long = 0], [ByVal Back As Long = 100], [ByVal TransformWithShape As Boolean = False]) As PatternFill

Transparency

Description

The ApplyPatternTransparency method applies a pattern fill transparency to a shape.

Parameters	Description

Type	Specifies the type of pattern fill transparency and has a value of cdrPatternFillType [in]

FileName	Specifies the full path name of the graphic that is imported as a pattern fill transparency [in]
Optional

PatternCanvasIndex	Specifies the pattern canvas in a pattern fill transparency [in]
Optional
Default value = 1

Front	[in]
Optional
Default value = 0

Back	[in]
Optional
Default value = 100

TransformWithShape	If set to True, the pattern fill transparency changes according to changes in its shape object. [in]
Optional
Default value = False

Return value

Returns PatternFill

Example

The following example applies a two-color pattern transparency to a rectangle.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s.Fill.UniformColor.RGBAssign 0, 0, 255

s.Transparency.ApplyPatternTransparency cdrTwoColorPattern, , 6

End Sub

 Related Topics


Transparency.ApplyTextureTransparency

Function ApplyTextureTransparency(ByVal TextureName As String, [ByVal LibraryName As String]) As TextureFill

Transparency

Description

The ApplyTextureTransparency method applies a texture fill transparency to a shape.

Parameters	Description

TextureName	Specifies the name of the texture fill to apply [in]

LibraryName	Specifies the name of a texture library for texture fill patterns [in]
Optional

Return value

Returns TextureFill

Example

The following example applies a texture transparency to a rectangle.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s.Fill.UniformColor.RGBAssign 0, 128, 0

s.Outline.Type = cdrNoOutline

s.Transparency.ApplyTextureTransparency "Cosmic Energy", ""

End Sub

 Related Topics


Transparency.ApplyUniformTransparency

Sub ApplyUniformTransparency(ByVal Value As Long)

Transparency

Description

The ApplyUniformTransparency method applies a uniform fill transparency to a shape.

Parameters	Description

Value	Specifies the level of transparency in the uniform transparency fill. The Value parameter is a percentage from 0 to 100. Higher values indicate a greater degree of transparency.

Example

The following example applies a uniform transparency of 50% to a rectangle.

Sub Test()

Dim s As Shape

Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(255, 255, 0)

s.Outline.Type = cdrNoOutline

s.Transparency.ApplyUniformTransparency 50

s.Transparency.Uniform = 50 ' a workaround

End Sub

 Related Topics


Transparency.Freeze

Sub Freeze()

Transparency

Description

The Freeze method freezes a transparency.

Example

The following example creates a circle and adds a rectangle on top of it. It applies a transparency to the rectangle, freezes the transparency, and moves the resulting frozen transparency group diagonally.

Sub Test()

Dim s1 As Shape, s2 As Shape

Set s1 = ActiveLayer.CreateEllipse2(0, 0, 1)

s1.Fill.UniformColor.RGBAssign 0, 128, 0

Set s2 = ActiveLayer.CreateRectangle(0, 0, 2, 2)

s2.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(255, 255, 0)

s2.Outline.Type = cdrNoOutline

s2.Transparency.ApplyTextureTransparency "Cosmic Energy", ""

s2.Transparency.Freeze

s2.ParentGroup.Move 1, 1

End Sub

 Related Topics


Transparency.Unfreeze

Sub Unfreeze()

Transparency

Description

The UnFreeze method removes the freeze of a transparency group.

This method is reserved for future development.

 Related Topics


TrapLayer properties

TrapLayer     Legend

    Color
      Density
      Order
      TrapType
    Type


TrapLayer

Class TrapLayer

Properties     Referenced By

The TrapLayer class represents a plate for color trapping.

 Related Topics


TrapLayer.Color

Property Color As String

TrapLayer

Description

The Color property returns the color of the plate.

Read-Only

Example

The following example displays a list of colors for trap layers.

Sub Test()

Dim intCounter As Integer

Dim s As String

With ActiveDocument.PrintSettings.Trapping

For intCounter = 1 To .Layers.Count - 1

s = s & .Layers.Item(intCounter).Color & vbCr

Next intCounter

End With

MsgBox s

End Sub

 Related Topics


TrapLayer.Density

Property Density As Double

TrapLayer

Description

The Density property returns or sets the neutral density of a color.

Example

The following example displays the density of the yellow plate.

Sub Test()

Dim intCounter As Integer

With ActiveDocument.PrintSettings.Trapping

For intCounter = 1 To .Layers.Count - 1

If .Layers.Item(intCounter).Color = "Yellow" Then

MsgBox "The density of the yellow plate is " & _

.Layers.Item(intCounter).Density

End If

Next intCounter

End With

End Sub

 Related Topics


TrapLayer.Order

Property Order As Long

TrapLayer

Description

The Order property returns or sets the order in which their separations will print.

Example

The following example lists the order of the plates.

Sub Test()

Dim intCounter As Integer

Dim s As String

s = "Color - Order" & vbCr & vbCr

With ActiveDocument.PrintSettings.Trapping.Layers

For intCounter = 1 To .Count - 1

s = s & .Item(intCounter).Color & " - " & .Item(intCounter).Order & vbCr

Next intCounter

End With

MsgBox s

End Sub

 Related Topics


TrapLayer.TrapType

Property TrapType As PrnTrapType

TrapLayer

Description

The TrapType property controls the opacity of the trap.

Example

The following example sets each trap layer as transparent.

Sub Test()

Dim intCounter As Integer

With ActiveDocument.PrintSettings.Trapping.Layers

For intCounter = 1 To .Count - 1

.Item(intCounter).TrapType = prnLayerTransparent

Next intCounter

End With

End Sub

 Related Topics


TrapLayer.Type

Property Type As PrnPlateType

TrapLayer

Description

The Type parameter returns the type of the plate.

This property is reserved for future development.

Read-Only

 Related Topics


TrapLayers properties

TrapLayers     Legend

    Count
    Item


TrapLayers

Class TrapLayers

Properties     Referenced By

The TrapLayers class represents a collection of plates for color trapping.

 Related Topics


TrapLayers.Count

Property Count As Long

TrapLayers

Description

The Count property returns the number of plates for color trapping that are in the collection.

Read-Only

Example

The following example displays the number of items in the collection.

Sub Test()

With ActiveDocument

With .PrintSettings.Trapping.Layers

MsgBox "There are " & .Count & " trap layers in the collection."

End With

End With

End Sub

 Related Topics


TrapLayers.Item

Property Item(ByVal Index As Long) As TrapLayer

TrapLayers

Description

The following example returns a reference to the specified plate in the collection.

Read-Only

Parameters	Description

Index	Specifies the plate by its index number [in]

Example

The following example displays a list of all the trap layers in the collection.

Sub Test()

Dim intCounter As Integer

Dim s As String

With ActiveDocument.PrintSettings.Trapping

For intCounter = 1 To .Layers.Count - 1

s = s & .Layers.Item(intCounter).Color & vbCr

Next intCounter

End With

MsgBox s

End Sub

 Related Topics


URL properties

URL     Legend

      Address
      AltComment
      BookMark
      Region
      TargetFrame


URL

Class URL

Properties     Referenced By

The URL class represents a URL.

 Related Topics


URL.Address

Property Address As String

URL

Description

The Address property returns or sets the address of a URL.

Example

The following example displays all the URLs contained in the active page.

Sub Test()

Dim sh As Shape, s As String

For Each sh In ActivePage.Shapes

s = s & sh.URL.Address & vbCr

Next sh

MsgBox "The current page contains the following URL addresses: " & vbCr & s

End Sub

 Related Topics


URL.AltComment

Property AltComment As String

URL

Description

The AltComment property returns or sets the alternative (ALT) comment of the URL.

Example

The following example displays all the alternative comments contained in the active page.

Sub Test()

Dim sh As Shape, s As String

For Each sh In ActivePage.Shapes

If sh.URL.AltComment <> "" Then

s = s & sh.URL.AltComment & vbCr

End If

Next sh

MsgBox "The current page contains the following URL alternative comments: " & _

vbCr & s

End Sub

 Related Topics


URL.BookMark

Property BookMark As String

URL

Description

The BookMark property returns or sets a bookmark for a URL.

Example

The following example creates an ellipse on the active layer and assigns a bookmark to the ellipse.

Sub Test()

ActivePage.ActiveLayer.CreateEllipse 2, 3, 4, 5

ActiveShape.URL.BookMark = "Page 1"

End Sub

 Related Topics


URL.Region

Property Region As cdrURLRegion

URL

Description

The Region property returns or sets the region for a URL.

Example

The following example sets the region for the URL to the bounding box of each shape on the page.

Sub Test()

Dim sh As Shape

For Each sh In ActivePage.Shapes

sh.URL.Region = cdrURLRegionRectangle

Next sh

End Sub

 Related Topics


URL.TargetFrame

Property TargetFrame As String

URL

Description

The TargetFrame property returns or sets the name of the target frame for a URL.

Example

The following example displays the names of all targeted frames for the shapes on the page.

Sub Test()

Dim sh As Shape, s As String

For Each sh In ActivePage.Shapes

If sh.URL.TargetFrame <> "" Then

s = s & sh.URL.TargetFrame & vbCr

End If

Next sh

MsgBox "The current page contains the following URL target frames: " & vbCr & s

End Sub

 Related Topics


View properties

View     Legend

    Application
      Name
      OriginX
      OriginY
      Page
    Parent
      UsePage
      UseZoom
      Zoom


View methods

View     Legend

   Activate
   Delete


View

Class View

Properties     Methods     Referenced By

The View class represents the view settings that are saved in the View Manager.

 Related Topics


View.Application

Property Application As Application

View

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


View.Name

Property Name As String

View

Description

The Name property returns or sets the name of a view.

Example

The following example sets the name of the first view in the Views collection and displays the new name.

Sub ViewName()

With ActiveDocument.Views(1)

.Name = "My New View"

MsgBox .Name

End With

End Sub

 Related Topics


View.OriginX

Property OriginX As Double

View

Description

The OriginX property returns or sets the value of the horizontal origin of a view.

Example

The following example checks to see whether there are views in the View collection. If there is a view, it prints the horizontal origin of the view. If not, it adds a view and prints the horizontal origin.

Sub Test()

Dim Vw As View

Dim VwCollection As Views

Set VwCollection = ActiveDocument.Views

If VwCollection.Count > 0 Then

Set Vw = VwCollection.Item(1)

MsgBox "The horizontal origin of the active view is: " & Vw.OriginX

Else

Set Vw = VwCollection.AddActiveView("TestView")

MsgBox "The horizontal origin of the active view is: " & Vw.OriginX

End If

Set Vw = Nothing

Set VwCollection = Nothing

End Sub

 Related Topics


View.OriginY

Property OriginY As Double

View

Description

The OriginY property returns or sets the value of the vertical origin of a view.

Example

The following example adds a view if there are no saved views. The vertical origins of all saved views are then displayed.

Sub Test()

Dim Vw As View

Dim VwCollection As Views

Dim s As String

Set VwCollection = ActiveDocument.Views

If ActiveDocument.Views.Count = 0 Then

VwCollection.AddActiveView "test"

For Each Vw In VwCollection

s = s & Vw.OriginY & vbCr

Next Vw

Else

For Each Vw In VwCollection

s = s & Vw.OriginY & vbCr

Next Vw

End If

MsgBox "The vertical origin's of the saved views are: " & vbCr & s

Set Vw = Nothing

Set VwCollection = Nothing

End Sub

 Related Topics


View.Page

Property Page As Page

View

Description

The Page property returns a reference to the page. When a custom view is created, it is associated with a specific document page.

The Page property is only applicable if the UsePage property is set to True.

Example

The following example adds a view, returns a reference to the page in the view, and displays the name of the page.

Sub Test()

Dim Vw As View

Dim VwCollection As Views

Dim Pg As Page

Dim s As String

Set VwCollection = ActiveDocument.Views

Set Vw = VwCollection.AddActiveView("TestView")

Set Pg = Vw.Page

s = s & Pg.Name & vbCr

MsgBox "The page name of the chosen view is: " & vbCr & s

Set Vw = Nothing

Set VwCollection = Nothing

End Sub

 Related Topics


View.Parent

Property Parent As Views

View

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


View.UsePage

Property UsePage As Boolean

View

Description

The UsePage property returns or sets whether to revert to the page when switching between views.

If the UsePage property is set to True, the page associated with the view appears in the drawing window when the view is activated. If the property is set to False, the view's page does not appear when the view is active.

Example

The following example creates five pages and adds a view for each page. The zoom is incremented by 10 for each page and the UsePage property is set to False.

Sub Test()

Dim Vw As View

Dim VwCollection As Views

Dim intCounter As Integer

Set VwCollection = ActiveDocument.Views

For intCounter = 1 To 5

ActiveDocument.AddPages (1)

Set Vw = VwCollection.AddActiveView("TestView" & intCounter)

Vw.Zoom = CDbl(intCounter * 10)

Vw.UsePage = False

Next intCounter

Set Vw = Nothing

Set VwCollection = Nothing

End Sub

 Related Topics


View.UseZoom

Property UseZoom As Boolean

View

Description

The UseZoom property returns or sets whether the zoom value a view will take effect when that view becomes active.

If the UseZoom property is set to True, the zoom value in a view is applied when the view becomes active. If the property is set to False, the view's zoom setting is not applied when the view is active.

Example

The following example creates five pages and adds a view for each page. The zoom level is incremented by 50 for each page and the UseZoom properth is set to False.

Sub Test()

Dim Vw As View

Dim VwCollection As Views

Dim intCounter As Integer

Set VwCollection = ActiveDocument.Views

For intCounter = 1 To 5

ActiveDocument.AddPages (1)

Set Vw = VwCollection.AddActiveView("TestView" & intCounter)

Vw.Zoom = CDbl(intCounter * 50)

Vw.UseZoom = False

Next intCounter

Set Vw = Nothing

Set VwCollection = Nothing

End Sub

 Related Topics


View.Zoom

Property Zoom As Double

View

Description

The Zoom property returns or sets the magnification level for a view.

The Zoom property of a custom view is only applicable if the UseZoom property of the view is set to True.

Example

The following example increases the zoom level by 50 for each view in the collection. The zoom level is set at 100 for the first view.

Sub Test()

Dim Vw As View

Dim VwCollection As Views

Dim intCounter As Integer

Set VwCollection = ActiveDocument.Views

intCounter = 1

For Each Vw In VwCollection

intCounter = intCounter + 1

Vw.Zoom = CDbl(intCounter * 50)

Next Vw

Set Vw = Nothing

Set VwCollection = Nothing

End Sub

 Related Topics


View.Activate

Sub Activate()

View

Description

The Activate method makes a view active in a document.

Example

The following example creates and activates a view.

Sub Test()

Dim Vw As View

Dim intCounter As Integer

Set Vw = ActiveDocument.Views.AddActiveView("Test1")

Vw.Activate

Set Vw = Nothing

End Sub

 Related Topics


View.Delete

Sub Delete()

View

Description

The Delete method deletes the saved view from the View Manager.

Example

The following example deletes all views in the document.

Sub Test()

Dim Vw As View

Dim intCounter As Integer

For intCounter = ActiveDocument.Views.Count To 1 Step -1

Set Vw = ActiveDocument.Views(intCounter)

Vw.Delete

Next intCounter

Set Vw = Nothing

End Sub

Sub Test()

Dim Vws As Views

Set Vws = ActiveDocument.Views

While Vws.Count <> 0

Vws(Vws.Count).Delete

Wend

Set Vws = Nothing

End Sub

 Related Topics


Views properties

Views     Legend

    Application
    Count
  Item
    Parent


Views methods

Views     Legend

   AddActiveView


Views

Class Views

Properties     Methods     Referenced By

The Views class represents the collection of views for a document.

 Related Topics


Views.Application

Property Application As Application

Views

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Views.Count

Property Count As Long

Views

Description

The Count property returns the number of views in the collection.

Read-Only

Example

The following example displays a message box if there are no views in the active document.

Sub Test()

If ActiveDocument.Views.Count > 1 Then

MsgBox "There are no views in the current document", vbCritical

End If

End Sub

 Related Topics


Views.Item

Property Item(ByVal IndexOrName As Variant) As View

Views

Description

The Item property returns a reference to a view in the collection.

The Item property is the default property and its reference may be omitted when accessing items in the collection. For example, Views.Item(2) is the same as Views(2) - they both reference the second window in the Views collection.

Read-Only

Parameters	Description

IndexOrName	Specifies the view by index number or name [in]

Example

The following example displays the names of all views for the active document.

Sub Test()

Dim intCounter As Integer

Dim Vw As View

Dim s As String

For intCounter = 1 To ActiveDocument.Views.Count

Set Vw = ActiveDocument.Views(intCounter)

s = s & Vw.Name & vbCr

Next intCounter

MsgBox "The current document contains the following views: " & vbCr & s

Set Vw = Nothing

End Sub

Sub Test()

Dim Vw As View

Dim s As String

For Each Vw In ActiveDocument.Views

s = s & Vw.Name & vbCr

Next Vw

MsgBox "The current document contains the following views: " & vbCr & s

Set Vw = Nothing

End Sub

 Related Topics


Views.Parent

Property Parent As Document

Views

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Views.AddActiveView

Function AddActiveView(ByVal Name As String) As View

Views

Description

The AddActiveView method adds the current view to the collection

Parameters	Description

Name	Assigns a name to the new view [in]

Return value

Returns View

Example

The following example adds five views to the collection and increments the zoom level by 25 for each view.

Sub Test()

Dim intCounter As Integer

For intCounter = 1 To 5

ActiveDocument.Views.AddActiveView "Test" & intCounter

ActiveDocument.ActiveWindow.ActiveView.Zoom = (intCounter * 25)

Next intCounter

End Sub

 Related Topics


Window properties

Window     Legend

    Active
    ActiveView
    Application
    Caption
    Document
      FullScreen
    Handle
      Height
    Index
      Left
    Next
    Page
    Parent
    Previous
      Top
      Width
      WindowState


Window methods

Window     Legend

   Activate
   Close
   DocumentToScreen
   NewWindow
   Refresh
   ScreenToDocument


Window

Class Window

Properties     Methods     Referenced By

The Window class represents a window in the Windows collection.

 Related Topics


Window.Active

Property Active As Boolean

Window

Description

The Active property returns whether a window is active. If the window is active, a value of True is returned, indicating that it is currently in use.

Read-Only

Example

The following example displays the caption of the active window.

Sub Test()

Dim Wnd As Window

For Each Wnd In ActiveDocument.Windows

If Wnd.Active = 1 Then

MsgBox Wnd.Caption & " is the active window."

End If

Next Wnd

End Sub

 Related Topics


Window.ActiveView

Property ActiveView As ActiveView

Window

Description

The ActiveView property returns reference to the active view.

Read-Only

Example

The following example zooms the view to display all shapes in the document.

Sub Test()

Dim actvw As ActiveView

Set actvw = ActiveWindow.ActiveView

actvw.ToFitAllObjects

Set actvw = Nothing

End Sub

 Related Topics


Window.Application

Property Application As Object

Window

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Window.Caption

Property Caption As String

Window

Description

The Caption property returns the window's caption.

Read-Only

Example

The following example displays the caption of the active window.

Sub Test()

MsgBox "The caption of the current window is: " & ActiveWindow.Caption

End Sub

 Related Topics


Window.Document

Property Document As Document

Window

Description

Definition

The Document property returns a reference to the document to which the window belongs.

Read-Only

Example

The following example displays the title of the document.

Sub Test()

Dim CDoc As Document

Set CDoc = ActiveWindow.Document

MsgBox "The title of this document is: " & CDoc.Title

Set CDoc = Nothing

End Sub

 Related Topics


Window.FullScreen

Property FullScreen As Boolean

Window

Description

The FullScreen property returns or sets whether the active window is visible as a full computer screen.

If the property is set to True, the active window fills up the full computer screen. If the value is False, the active window is viewed in the normal application window.

Example

The following example enables full-screen preview mode.

Sub Test()

ActiveWindow.FullScreen = True

End Sub

 Related Topics


Window.Handle

Property Handle As Long

Window

Description

The Handle property returns the window handle for the document window.

Read-Only

Example

The following example displays the window handle for the active window.

Sub Test()

MsgBox "The window handle is:  " & ActiveWindow.Handle & "."

End Sub

 Related Topics


Window.Height

Property Height As Long

Window

Description

The Height property returns or sets the height of a window. This value is measured in screen pixels.

Example

The following example displays the height of the active window.

Sub Test()

MsgBox "The height of the active window is: " & ActiveWindow.Height

End Sub

 Related Topics


Window.Index

Property Index As Long

Window

Description

The Index property returns the index of a window in the Windows collection.

Read-Only

Example

The following example displays the caption for each window in the Windows collection of the active document.

Sub Test()

Dim Wnd As Window

Dim s As String

For Each Wnd In ActiveDocument.Windows

s = s & Wnd.Index & " - " & Wnd.Caption & vbCr

Next Wnd

MsgBox "The current document contains the following windows: " & vbCr & s

Set Wnd = Nothing

End Sub

 Related Topics


Window.Left

Property Left As Long

Window

Description

The Left property returns or sets the left coordinate of a window. This value is measured in screen pixels.

Example

The following example displays the left coordinate of the active window.

Sub Test()

MsgBox "The left coordinate of this window is: " & ActiveWindow.Left

End Sub

 Related Topics


Window.Next

Property Next As Window

Window

Description

The Next method returns a reference to the next window in the Windows collection.

Read-Only

Example

The following example displays the caption of the active window and then displays the caption of the next window in the collection.

Sub Test()

Dim Wnd As Window

Set Wnd = ActiveDocument.Windows(1)

MsgBox "The current window is: " & Wnd.Caption

Set Wnd = Wnd.Next

MsgBox "The next window is: " & Wnd.Caption

Set Wnd = Nothing

End Sub

 Related Topics


Window.Page

Property Page As Object

Window

Description

The Page property returns a reference to the active page of a window.

Read-Only

Example

The following example displays the name of the active window's current page.

Sub Test()

MsgBox "The name of the current window's page is: " & ActiveWindow.Page.Name

End Sub

 Related Topics


Window.Parent

Property Parent As Windows

Window

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Window.Previous

Property Previous As Window

Window

Description

The Previous method returns a reference to the previous window in the Windows collection.

Read-Only

Example

The following example displays the caption of the current window and then displays the caption of the preceding window in the Windows collection.

Sub Test()

MsgBox "The current window is: " & ActiveDocument.ActiveWindow.Caption

MsgBox "The previous window is: " & ActiveDocument.ActiveWindow.Previous.Caption

End Sub

 Related Topics


Window.Top

Property Top As Long

Window

Description

The Top property returns or sets the top coordinate of a window. This value is measured in screen pixels.

Example

The following example displays the current top coordinate, sets it to half of its original value, and displays the new value.

Sub Test()

MsgBox "The current top coordinate is: " & ActiveWindow.Top

ActiveWindow.Top = ActiveWindow.Top / 2

MsgBox "The new top coordinate is: " & ActiveWindow.Top

End Sub

 Related Topics


Window.Width

Property Width As Long

Window

Description

The Width property returns or sets the width of a window. This value is measured in screen pixels.

Example

The following example displays the width of the active window.

Sub Test()

MsgBox "The width of the active window is: " & ActiveWindow.Width

End Sub

 Related Topics


Window.WindowState

Property WindowState As cdrWindowState

Window

Description

The WindowState property returns or sets the state of a window.

A window can be minimized, maximized, or in a normal state. It can also be restored to its previous state. The WindowState property returns a value of cdrWindowState.

Example

The following example displays the active window's state, maximizes the window, and displays the new state.

Sub Test()

MsgBox "The current window state is: " & ActiveWindow.WindowState

ActiveWindow.WindowState = cdrWindowMaximized

MsgBox "The current window state is: " & ActiveWindow.WindowState

End Sub

 Related Topics


Window.Activate

Sub Activate()

Window

Description

The Activate method opens a window, if it is not currently open, and makes it the active window.

In some cases, newer operating systems like Windows 98 and Windows 2000 don't allow the application to activate itself, to prevent intervention with the current activity. If the application is not granted active status, the application window will start flashing in the taskbar, but it will not appear in the foreground.

Example

The following example sets the last window in the collection as the foreground window.

Sub Test()

Dim Wnd As Window

Set Wnd = ActiveDocument.Windows(ActiveDocument.Windows.Count)

Wnd.Activate

End Sub

 Related Topics


Window.Close

Sub Close()

Window

Description

The Close method closes a window.

Before you close an active file, CorelDRAW prompts you to save the file.

Example

The following example closes the first window in the collection if there is more than one window in the Windows collection.

Sub Test()

Dim Wnd As Window

If ActiveDocument.Windows.Count > 1 Then

Set Wnd = ActiveDocument.Windows(1)

Wnd.Close

End If

End Sub

 Related Topics


Window.DocumentToScreen

Sub DocumentToScreen(ByVal XDoc As Double, ByVal YDoc As Double, ByRef XScreen As Long, ByRef YScreen As Long)

Window

Description

The DocumentToScreen method converts document coordinates to screen coordinates.

Parameters	Description

XDoc	Specifies the horizontal coordinate in the document [in]

YDoc	Specifies the vertical coordinate in the document [in]

XScreen	Specifies the horizontal coordinate on the screen [out]

YScreen	Specifies the vertical coordinate on the screen [out]

Example

The following example converts document coordinates to screen coordinates.

Sub Test()

Dim x As Long

Dim y As Long

ActiveWindow.DocumentToScreen 4.25, 5.5, x, y

MsgBox "The document coordinates (4.25,5.5) converted to screen " & _

"coordinates are (" & x & "," & y & ")."

End Sub

 Related Topics


Window.NewWindow

Function NewWindow() As Window

Window

Description

The NewWindow method creates a new window and returns a reference to the newly-created window.

Return value

Returns Window

Example

The following example creates a new window.

Sub Test()

ActiveWindow.NewWindow

End Sub

 Related Topics


Window.Refresh

Sub Refresh()

Window

Description

Definition

The Refresh method redraws a window, updating the window with the most recent information.

Example

The following example refreshes all of the windows in the Windows collection of the active document.

Sub Test()

Dim Wnd As Window

For Each Wnd In ActiveDocument.Windows

Wnd.Refresh

Next Wnd

End Sub

 Related Topics


Window.ScreenToDocument

Sub ScreenToDocument(ByVal XScreen As Long, ByVal YScreen As Long, ByRef XDoc As Double, ByRef YDoc As Double)

Window

Description

The ScreenToDocument property converts screen coordinates into document coordinates

Parameters	Description

XScreen	Specifies the horizontal coordinate on the screen [in]

YScreen	Specifies the vertical coordinate on the screen [in]

XDoc	Specifies the horizontal coordinate in the document [out]

YDoc	Specifies the vertical coordinate in the document [out]

Example

The following example converts the screen co-ordinates to document co-ordinates.

Sub Test()

Dim x As Double

Dim y As Double

ActiveWindow.ScreenToDocument 515, 404, x, y

MsgBox "The screen coordinates (515,404) converted to document " & _

"coordinates is (" & x & "," & y & ")."

End Sub

 Related Topics


Windows properties

Windows     Legend

    Application
    Count
  Item
    Parent


Windows methods

Windows     Legend

   Arrange
   CloseAll
   Refresh


Windows

Class Windows

Properties     Methods     Referenced By

The Windows class represents the collection of windows in CorelDRAW.

 Related Topics


Windows.Application

Property Application As Object

Windows

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Windows.Count

Property Count As Long

Windows

Description

The Count property returns the number of windows in the Windows collection.

Read-Only

Example

The following example displays the number of windows in the Windows collection of the active document.

Sub Test()

MsgBox "There are: " & ActiveDocument.Windows.Count & _

" windows in the Windows collection."

End Sub

 Related Topics


Windows.Item

Property Item(ByVal Index As Long) As Window

Windows

Description

The Item property returns a reference to a window in the collection.

The Item property is the default property and its reference may be omitted when accessing items in the collection. For example, Windows.Item(2) is the same as Windows(2) - they both reference the second window in the Windows collection.

Read-Only

Parameters	Description

Index	Specifies a window by its index number [in]

Example

The following example displays the caption of each window in the Windows collection.

Sub Test()

Dim intCounter As Integer

Dim Wnd As Window

Dim s As String

For intCounter = 1 To ActiveDocument.Windows.Count

Set Wnd = ActiveDocument.Windows(intCounter)

s = s & Wnd.Caption & vbCr

Next intCounter

MsgBox "The current document contains the following windows: " & vbCr & s

Set Wnd = Nothing

End Sub

Sub Test()

Dim Wnd As Window

Dim s As String

For Each Wnd In ActiveDocument.Windows

s = s & Wnd.Caption & vbCr

Next Wnd

MsgBox "The current document contains the following windows: " & vbCr & s

Set Wnd = Nothing

End Sub

 Related Topics


Windows.Parent

Property Parent As Object

Windows

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Windows.Arrange

Sub Arrange(ByVal Style As cdrWindowArrangeStyle)

Windows

Description

The Arrange method arranges all windows in the specified style.

A window can be tiled horizontally or vertically, as well as cascaded in the application window.

Parameters	Description

Style	Specifies the arrangement of Windows in CorelDRAW. You must reference the style in which to organize the windows by passing the style type. [in]

Example

The following example arranges the application's windows vertically.

Sub Test()

ActiveDocument.Windows.Arrange cdrTileVertically

End Sub

 Related Topics


Windows.CloseAll

Sub CloseAll()

Windows

Description

The CloseAll method closes all open windows in CorelDRAW.

You are prompted to save your changes for each document that is dirty when you execute the CloseAll method.

Example

The following example closes all windows in the application, prompting the user to save the document if the document is dirty.

Sub Test()

ActiveDocument.Windows.CloseAll

End Sub

 Related Topics


Windows.Refresh

Sub Refresh()

Windows

Description

Definition

The Refresh method refreshes all windows in the Windows collection, updating the windows with the most recent information.

Example

The following example refreshes all windows.

Sub WindowsRefresh()

ActiveDocument.Windows.Refresh

End Sub

 Related Topics


Workspace properties

Workspace     Legend

    Active
    Application
    Default
    Description
    Name
    Parent


Workspace methods

Workspace     Legend

   Activate


Workspace

Class Workspace

Properties     Methods     Referenced By

The Workspace class represents a workspace, an enclosed work environment.

 Related Topics


Workspace.Active

Property Active As Boolean

Workspace

Description

The Active property returns whether a workspace is currently active in CorelDRAW.

Read-Only

Example

The following example displays a list of all workspaces and whether each workspace is the active workspace.

Sub Test()

Dim Ws As Workspace

For Each Ws In Workspaces

s = s & Ws.Name & " - Active: " & Ws.Active & vbCr

Next Ws

MsgBox "Workspaces: " & vbCr & s

End Sub

 Related Topics


Workspace.Application

Property Application As Object

Workspace

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Workspace.Default

Property Default As Boolean

Workspace

Description

The Default property returns whether the current workspace is the default workspace. If the default property is True, the current workspace is the default workspace.

Read-Only

Example

The following example displays a list of all workspaces and whether each workspace is the default workspace.

Sub Test()

Dim Ws As Workspace

For Each Ws In Workspaces

s = s & Ws.Name & " - Default: " & Ws.Default & vbCr

Next Ws

MsgBox "Workspaces: " & vbCr & s

End Sub

 Related Topics


Workspace.Description

Property Description As String

Workspace

Description

The Description property returns the description of a workspace.

Read-Only

Example

The following example displays a message box with the description of the current workspace.

Sub WorkspaceDescription()

MsgBox "Description: " & ActiveWorkspace.Description

End Sub

 Related Topics


Workspace.Name

Property Name As String

Workspace

Description

The Name property returns the name given to a workspace.

Read-Only

Example

The following example displays a message box with the name of the current workspace.

Sub WorkspaceName()

MsgBox"Current Workspace: " & ActiveWorkspace.Name

End Sub

 Related Topics


Workspace.Parent

Property Parent As Workspaces

Workspace

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


Workspace.Activate

Sub Activate()

Workspace

Description

The Activate method makes a workspace the current workspace.

Example

The following example sets the last workspace in the collection as the current workspace.

Sub Test()

Workspaces.Item(Workspaces.Count).Activate

End Sub

 Related Topics


Workspaces properties

Workspaces     Legend

    Application
    Count
  Item
    Parent


Workspaces

Class Workspaces

Properties     Referenced By

The Workspaces class represents the collection of all workspaces in CorelDRAW.

 Related Topics


Workspaces.Application

Property Application As Object

Workspaces

Description

The Application property returns a reference to the Application object.

Read-Only

 Related Topics


Workspaces.Count

Property Count As Long

Workspaces

Description

The Count property returns the number of workspaces in the Workspaces collection.

Read-Only

Example

The following example displays a message box with the number of workspaces in CorelDRAW.

Sub WorkspacesCount()

MsgBox "There are " & Workspaces.Count & " workspaces in the collection."

End Sub

 Related Topics


Workspaces.Item

Property Item(ByVal IndexOrName As Variant) As Workspace

Workspaces

Description

The Item property returns a reference to a workspace in the collection.

The Item property is the default property and its reference may be omitted when accessing items in the collection. For example, Workspaces.Item(2) is the same as Workspaces(2) - they both reference the second workspace in the Workspaces collection.

Read-Only

Parameters	Description

IndexOrName	Specifies the workspace by its index number or name [in]

Example

The following example displays a message box which lists the names of the workspaces.

Sub Test()

Dim intCounter As Integer

Dim Ws As Workspace

Dim s As String

For intCounter = 1 To Workspaces.Count

Set Ws = Workspaces(intCounter)

s = s & Ws.Name & vbCr

Next intCounter

MsgBox "The current document contains the following workspaces: " & vbCr & s

Set Ws = Nothing

End Sub

Sub Test()

Dim Ws As Workspace

Dim s As String

For Each Ws In Workspaces

s = s & Ws.Name & vbCr

Next Ws

MsgBox "The current document contains the following workspaces: " & vbCr & s

Set Ws = Nothing

End Sub

 Related Topics


Workspaces.Parent

Property Parent As Object

Workspaces

Description

The Parent property returns an object's parent in the hierarchy of objects for CorelDRAW.

Most objects have a Parent property pointing to the object's parent object in the object model.

Read-Only

 Related Topics


cdrAddinFilter

Enum cdrAddinFilter

Referenced By

Constant	Value	Description

cdrAddinFilterNone	0

cdrAddinFilterWhileDrawing	1

cdrAddinFilterShapeCreated	2

cdrAddinFilterNew	4

cdrAddinFilterExecute	8


cdrAlignment

Enum cdrAlignment

Referenced By

Constant	Value	Description

cdrNoAlignment	0

cdrLeftAlignment	1

cdrRightAlignment	2

cdrCenterAlignment	3

cdrFullJustifyAlignment	4

cdrForceJustifyAlignment	5

cdrMixedAlignment	6


cdrAntiAliasingType

Enum cdrAntiAliasingType

Referenced By

Constant	Value	Description

cdrNoAntiAliasing	0

cdrNormalAntiAliasing	1

cdrSupersampling	2


cdrBlendMode

Enum cdrBlendMode

Referenced By

Constant	Value	Description

cdrBlendSteps	0

cdrBlendSpacing	1


cdrCloneLinkType

Enum cdrCloneLinkType

Referenced By

Constant	Value	Description

cdrCloneFill	1

cdrCloneOutline	2

cdrCloneShape	4

cdrCloneTransform	8

cdrCloneBmpColorMask	16

cdrCloneAll	31


cdrColorType

Enum cdrColorType

Referenced By

Constant	Value	Description

cdrColorPantone	1

cdrColorCMYK	2

cdrColorCMY	4

cdrColorRGB	5

cdrColorHSB	6

cdrColorHLS	7

cdrColorBlackAndWhite	8

cdrColorGray	9

cdrColorYIQ	11

cdrColorLab	12

cdrColorPantoneHex	14

cdrColorRegistration	20

cdrColorSpot	25

cdrColorMixed	99


cdrCompressionType

Enum cdrCompressionType

Referenced By

Constant	Value	Description

cdrCompressionNone	0

cdrCompressionLZW	1

cdrCompressionPackBits	2

cdrCompressionHuffman	3

cdrCompressionCCITT3_1d	4

cdrCompressionCCITT3_2d	5

cdrCompressionCCITT4	6

cdrCompressionRLE_LW	7

cdrCompressionJPEG	8


cdrContourDirection

Enum cdrContourDirection

Referenced By

Constant	Value	Description

cdrContourInside	0

cdrContourOutside	1

cdrContourToCenter	2


cdrCursorShape

Enum cdrCursorShape

Referenced By

Constant	Value	Description

cdrCursorWinAppStarting	0

cdrCursorWinArrow	1

cdrCursorWinCross	2

cdrCursorWinHelp	3

cdrCursorWinIbeam	4

cdrCursorWinNo	5

cdrCursorWinSizeAll	6

cdrCursorWinSizeNeSw	7

cdrCursorWinSizeNs	8

cdrCursorWinSizeNwSe	9

cdrCursorWinSizeWe	10

cdrCursorWinUpArrow	11

cdrCursorWinWait	12

cdrCursorSmallcrosshair	301

cdrCursorPick	305

cdrCursorNodeEdit	306

cdrCursorEyeDrop	326

cdrCursorExtPick	351

cdrCursorPickNone	305

cdrCursorPenJoin	380

cdrCursorPickOvertarget	396

cdrCursorTrimSingle	428

cdrCursorWeldSingle	430

cdrCursorIntersectSingle	432


cdrCurveElementType

Enum cdrCurveElementType

Referenced By

Constant	Value	Description

cdrElementStart	0

cdrElementLine	1

cdrElementCurve	2

cdrElementControl	3


cdrDataFormatType

Enum cdrDataFormatType

Referenced By

Constant	Value	Description

cdrFormatGeneral	0

cdrFormatDateTime	1

cdrFormatLinearAngular	2

cdrFormatNumeric	3


cdrDistortionType

Enum cdrDistortionType

Referenced By

Constant	Value	Description

cdrDistortionPushPull	0

cdrDistortionZipper	1

cdrDistortionTwister	2


cdrDitherType

Enum cdrDitherType

Referenced By

Constant	Value	Description

cdrDitherNone	0

cdrDitherOrdered	1

cdrDitherJarvis	2

cdrDitherStucki	3

cdrDitherFloyd	4


cdrDropShadowType

Enum cdrDropShadowType

Referenced By

Constant	Value	Description

cdrDropShadowFlat	0

cdrDropShadowBottom	1

cdrDropShadowTop	2

cdrDropShadowLeft	3

cdrDropShadowRight	4


cdrEdgeType

Enum cdrEdgeType

Referenced By

Constant	Value	Description

cdrEdgeLinear	0

cdrEdgeSquared	1

cdrEdgeFlat	2

cdrEdgeInverseSquared	3

cdrEdgeMesa	4

cdrEdgeGaussian	5


cdrEffectType

Enum cdrEffectType

Referenced By

Constant	Value	Description

cdrBlend	0

cdrExtrude	1

cdrEnvelope	2

cdrTextOnPath	3

cdrControlPath	4

cdrDropShadow	5

cdrContour	6

cdrDistortion	7

cdrPerspective	8

cdrLens	9


cdrEllipseType

Enum cdrEllipseType

Referenced By

Constant	Value	Description

cdrEllipse	0

cdrArc	1

cdrPie	2


cdrEnvelopeMode

Enum cdrEnvelopeMode

Referenced By

Constant	Value	Description

cdrEnvelopeHorizontal	0

cdrEnvelopeOriginal	1

cdrEnvelopePutty	2

cdrEnvelopeVertical	3


cdrExportRange

Enum cdrExportRange

Referenced By

Constant	Value	Description

cdrAllPages	0

cdrCurrentPage	1

cdrSelection	2


cdrExtrudeLightPosition

Enum cdrExtrudeLightPosition

Referenced By

Constant	Value	Description

cdrLightFrontTopLeft	0

cdrLightFrontTop	1

cdrLightFrontTopRight	2

cdrLightFrontLeft	3

cdrLightFrontCenter	4

cdrLightFrontRight	5

cdrLightFrontBottomLeft	6

cdrLightFrontBottom	7

cdrLightFrontBottomRight	8

cdrLightBackTopLeft	9

cdrLightBackTop	10

cdrLightBackTopRight	11

cdrLightBackRight	14

cdrLightBackBottomRight	17


cdrExtrudeShading

Enum cdrExtrudeShading

Referenced By

Constant	Value	Description

cdrExtrudeObjectFill	0

cdrExtrudeSolidFill	1

cdrExtrudeColorShading	2


cdrExtrudeType

Enum cdrExtrudeType

Referenced By

Constant	Value	Description

cdrExtrudeSmallBack	0

cdrExtrudeSmallFront	1

cdrExtrudeBigBack	2

cdrExtrudeBigFront	3

cdrExtrudeBackParallel	4

cdrExtrudeFrontParallel	5


cdrExtrudeVPType

Enum cdrExtrudeVPType

Referenced By

Constant	Value	Description

cdrVPLockedToShape	0

cdrVPLockedToPage	1

cdrVPShared	2


cdrFeatherType

Enum cdrFeatherType

Referenced By

Constant	Value	Description

cdrFeatherInside	0

cdrFeatherMiddle	1

cdrFeatherOutside	2

cdrFeatherAverage	3


cdrFileVersion

Enum cdrFileVersion

Referenced By

Constant	Value	Description

cdrCurrentVersion	0

cdrVersion5	5

cdrVersion6	6

cdrVersion7	7

cdrVersion8	8

cdrVersion9	9

cdrVersion10	10

cdrVersion11	11


cdrFillType

Enum cdrFillType

Referenced By

Constant	Value	Description

cdrNoFill	0

cdrUniformFill	1

cdrFountainFill	2

cdrPostscriptFill	3

cdrMonoBitmapFill	4

cdrReservedFill	5

cdrColorBitmapFill	6

cdrVectorFill	7

cdrTextureFill	8

cdrPatternFill	9


cdrFilter

Enum cdrFilter

Referenced By

Constant	Value	Description

cdrAutoSense	0	Detect the proper filter automatically (Import only)

cdr3DMF	1559	3DMF - 3D Model (Import only)

cdrAI	1305	Adobe Illustrator

cdrAI9	1333	Adobe Illustrator 9, Adobe Portable Document Format (Import only)

cdrAT1	1303	Adobe Type 1 Font (Export only)

cdrAVI	1536	Video for Windows

cdrBMP	769	Windows Bitmap

cdrCAL	800	CALS Compressed Bitmap

cdrCDR	1795	CorelDRAW

cdrCDT	1800	CorelDRAW Template

cdrCDX	1796	CorelDRAW Compressed (Import only)

cdrCGM	1280	Computer Graphics Metafile

cdrCLK	1802	Corel R.A.V.E.

cdrCMX5	1794	Corel Presentation Exchange 5.0

cdrCMX6	1793	Corel Presentation Exchange

cdrCPT	1808	Corel PHOTO-PAINT 11 Image

cdrCPT10	1808	Corel PHOTO-PAINT 9/10 Image

cdrCPT11	1809	Corel PHOTO-PAINT 11 Image

cdrCPT8	1799	Corel PHOTO-PAINT 7/8 Image (Export only)

cdrCPT9	1808	Corel PHOTO-PAINT 9/10 Image

cdrCPX	1797	Corel CMX Compressed (Import only)

cdrCUR	785	Windows 3.x/NT Cursor Resource (Import only)

cdrDCS	801	Desktop Color Separations (Export only)

cdrDOC	2068	MS Word 97/2000

cdrDRW	1339	Corel/Micrografx Designer (Import only)

cdrDSF	1339	Corel/Micrografx Designer (Import only)

cdrDWG	1328	AutoCAD (DWG)

cdrDXF	1296	AutoCAD (DXF)

cdrEMF	1300	Enhanced Windows Metafile

cdrEPS	1289	Encapsulated PostScript

cdrEPSPhotoPaint	804	Corel PHOTO-PAINT Encapsulated PostScript

cdrEXE	786	Windows 3.x/NT Bitmap Resource (Import only)

cdrFH	1344	Macromedia Freehand (Import only)

cdrFMV	1329	Frame Vector Metafile (Import only)

cdrFPX	806	Kodak FlashPix Image

cdrGEM	1284	GEM File

cdrGIF	773	CompuServe Bitmap

cdrGIFAnimation	1558	GIF Animation

cdrHPGL	1281	HPGL Plotter File

cdrHTML	1557	HyperText Markup Language (Import only)

cdrICO	784	Windows 3.x/NT Icon Resource (Import only)

cdrIMG	787	GEM Paint File

cdrJP2	820	JPG2000 Standard (Export only)

cdrJPC	821	JPG2000 Codestream (Export only)

cdrJPEG	774	JPEG Bitmaps

cdrJPG2000Import	818	JPG2000 Bitmaps (Import only)

cdrMAC	791	MACPaint Bitmap

cdrMacWord5	2052	MS Word for Macintosh 4.0, 5.0

cdrMET	1291	MET MetaFile (Import only)

cdrMIF	2165	FrameMaker 3.0, 4.0, 5.0 (Import only)

cdrNAP	1292	NAP MetaFile (Import only)

cdrOS2BMP	792	OS/2 Bitmap

cdrPAT	1801	CorelDRAW Pattern File

cdrPCD	775	Kodak Photo-CD Image (Import only)

cdrPCX	770	PaintBrush

cdrPDF	1333	Adobe Portable Document Format, Adobe Illustrator 9 (Import only)

cdrPIC	1334	Lotus Pic (Import only)

cdrPICT	1293	Macintosh PICT

cdrPLT	1281	HPGL Plotter File

cdrPNG	802	Portable Network Graphics

cdrPP4	789	Picture Publisher 4 (Import only)

cdrPP5	803	Picture Publisher 5.0

cdrPPF	819	Picture Publisher 10

cdrPPT	1805	Microsoft PowerPoint (Import only)

cdrPSD	788	Adobe Photoshop

cdrPSEncapsulated	1289	Encapsulated PostScript

cdrPSInterpreted	1290	PostScript Interpreted (Import only)

cdrQTM	1542	QuickTime Movie

cdrQTVR	1560	QuickTime VR

cdrQuattroPro	2067	Corel Quattro Pro (Import only)

cdrRIFF	807	Corel Painter 5/6 (Import only)

cdrRTF	2053	Rich Text Format

cdrSAM	2063	Ami Professional (Import only)

cdrSCT	776	Scitex CT Bitmap

cdrSHW	1806	Corel Presentations (Import only)

cdrSVG	1345	Scalable Vector Graphics

cdrSVGZ	1347	Compressed SVG

cdrSWF	1343	Macromedia Flash (Export only)

cdrTGA	771	Targa Bitmap

cdrTIFF	772	TIFF Bitmap

cdrTTF	1302	True Type Font (Export only)

cdrTXT	2048	ANSI Text

cdrVSD	1315	Visio (Import only)

cdrWI	793	Wavelet Compressed Bitmap

cdrWKS	2066	LOTUS 1-2-3 (Import only)

cdrWMF	1294	Windows Metafile

cdrWord2	2050	MS Word for Windows 2.x

cdrWord55	2051	MS Word 3.0, 4.0, 5.0, 5.5

cdrWord95	2049	MS Word for Windows 6/7

cdrWord2000	2068	MS Word 97/2000

cdrWP4	2058	Corel WordPerfect 4.2

cdrWP50	2057	Corel WordPerfect 5.0

cdrWP51	2056	Corel WordPerfect 5.1

cdrWP9	2055	Corel WordPerfect 6/7/8/9

cdrWPD	2055	Corel WordPerfect 6/7/8/9

cdrWPG	1287	Corel WordPerfect Graphic

cdrWPM	2166	Corel WordPerfect 1.0, 2.x for Macintosh (Import only)

cdrWS4	2164	WordStar 3.3, 3.31, 3.45, 4.0 (Import only)

cdrWS6	2163	WordStar 5.0, 5.5, 6.0 (Import only)

cdrWS7	2060	WordStar 7.0

cdrWS2000	2061	WordStar 2000

cdrWSD	2061	WordStar 2000

cdrWSW	2059	WordStar for Windows 1.x, 2.0

cdrWVL	793	Wavelet Compressed Bitmap

cdrXCF	816	Gimp Image (Import only)

cdrXLS	2064	Microsoft Excel (Import only)

cdrXPM	809	XPixMap Image

cdrXY	2062	XYWrite for Windows 4.0


cdrFittedOrientation

Enum cdrFittedOrientation

Referenced By

Constant	Value	Description

cdrRotateOrientation	0

cdrVerticalSkewOrientation	1

cdrHorizontalSkewOrientation	2

cdrUprightOrientation	3


cdrFittedPlacement

Enum cdrFittedPlacement

Referenced By

Constant	Value	Description

cdrLeftPlacement	0

cdrRightPlacement	1

cdrCenterPlacement	2


cdrFittedQuadrant

Enum cdrFittedQuadrant

Referenced By

Constant	Value	Description

cdrLeftQuadrant	0

cdrRightQuadrant	1

cdrTopQuadrant	2

cdrBottomQuadrant	3


cdrFittedVertPlacement

Enum cdrFittedVertPlacement

Referenced By

Constant	Value	Description

cdrCustomVertPlacement	0

cdrBaselineVertPlacement	1

cdrAscenderVertPlacement	2

cdrDescenderVertPlacement	3

cdrCenterVertPlacement	4


cdrFlipAxes

Enum cdrFlipAxes

Referenced By

Constant	Value	Description

cdrFlipHorizontal	1

cdrFlipVertical	2

cdrFlipBoth	3


cdrFontCase

Enum cdrFontCase

Referenced By

Constant	Value	Description

cdrNormalFontCase	0

cdrSmallCapsFontCase	1

cdrAllCapsFontCase	2

cdrMixedFontCase	3


cdrFontLine

Enum cdrFontLine

Referenced By

Constant	Value	Description

cdrNoFontLine	0

cdrSingleThinFontLine	1

cdrSingleThinWordFontLine	2

cdrSingleThickFontLine	3

cdrSingleThickWordFontLine	4

cdrDoubleThinFontLine	5

cdrDoubleThinWordFontLine	6

cdrMixedFontLine	7


cdrFontPosition

Enum cdrFontPosition

Referenced By

Constant	Value	Description

cdrNormalFontPosition	0

cdrSubscriptFontPosition	1

cdrSuperscriptFontPosition	2

cdrMixedFontPosition	3


cdrFontStyle

Enum cdrFontStyle

Referenced By

Constant	Value	Description

cdrNormalFontStyle	0

cdrBoldFontStyle	1

cdrItalicFontStyle	2

cdrBoldItalicFontStyle	3

cdrThinFontStyle	4

cdrThinItalicFontStyle	5

cdrExtraLightFontStyle	6

cdrExtraLightItalicFontStyle	7

cdrMediumFontStyle	8

cdrMediumItalicFontStyle	9

cdrSemiBoldFontStyle	10

cdrSemiBoldItalicFontStyle	11

cdrExtraBoldFontStyle	12

cdrExtraBoldItalicFontStyle	13

cdrHeavyFontStyle	14

cdrHeavyItalicFontStyle	15

cdrMixedFontStyle	16


cdrFountainFillBlendType

Enum cdrFountainFillBlendType

Referenced By

Constant	Value	Description

cdrDirectFountainFillBlend	0

cdrRainbowCWFountainFillBlend	1

cdrRainbowCCWFountainFillBlend	2

cdrCustomFountainFillBlend	3


cdrFountainFillType

Enum cdrFountainFillType

Referenced By

Constant	Value	Description

cdrLinearFountainFill	1

cdrRadialFountainFill	2

cdrConicalFountainFill	3

cdrSquareFountainFill	4


cdrGridType

Enum cdrGridType

Referenced By

Constant	Value	Description

cdrGridDot	0

cdrGridLine	1


cdrGuideType

Enum cdrGuideType

Referenced By

Constant	Value	Description

cdrAllGuides	-1

cdrHorizontalGuide	0

cdrVerticalGuide	1

cdrSlantedGuide	2


cdrHalftoneType

Enum cdrHalftoneType

Referenced By

Constant	Value	Description

cdrHalftoneSquare	0

cdrHalftoneRound	1

cdrHalftoneLine	2

cdrHalftoneCross	3

cdrHalftoneFixed4x4	4

cdrHalftoneFixed8x8	5


cdrImagePaletteType

Enum cdrImagePaletteType

Referenced By

Constant	Value	Description

cdrPaletteUniform	0

cdrPaletteStdVGA	1

cdrPaletteAdaptive	2

cdrPaletteOptimized	3

cdrPaletteBlackBody	4

cdrPaletteGrayscale	5

cdrPaletteSystem	6

cdrPaletteIE	7

cdrPaletteNetscape	8

cdrPaletteCustom	9


cdrImageType

Enum cdrImageType

Referenced By

Constant	Value	Description

cdrBlackAndWhiteImage	0

cdr16ColorsImage	1

cdrGrayscaleImage	2

cdrPalettedImage	3

cdrRGBColorImage	4

cdrCMYKColorImage	5

cdrDuotoneImage	6

cdrLABImage	7


cdrImportMode

Enum cdrImportMode

Referenced By

Constant	Value	Description

cdrImportFull	0

cdrImportCrop	1

cdrImportResample	2


cdrLensType

Enum cdrLensType

Referenced By

Constant	Value	Description

cdrLensMagnify	0

cdrLensFishEye	1

cdrLensWireframe	2

cdrLensColorLimit	3

cdrLensColorAdd	4

cdrLensInvert	5

cdrLensBrighten	6

cdrLensTintedGrayscale	7

cdrLensHeatMap	8

cdrLensTransparency	9

cdrLensCustomColorMap	10


cdrLineSpacingType

Enum cdrLineSpacingType

Referenced By

Constant	Value	Description

cdrPercentOfCharacterHeightLineSpacing	0

cdrPointLineSpacing	1

cdrPercentOfPointSizeLineSpacing	2

cdrMixedLineSpacing	3


cdrMergeMode

Enum cdrMergeMode

Referenced By

Constant	Value	Description

cdrMergeNormal	0

cdrMergeAdd	7

cdrMergeSubtract	8

cdrMergeDifference	24

cdrMergeMultiply	9

cdrMergeDivide	10

cdrMergeIfLighter	11

cdrMergeIfDarker	12

cdrMergeTexturize	13

cdrMergeInvert	6

cdrMergeAND	1

cdrMergeOR	2

cdrMergeXOR	3

cdrMergeHue	15

cdrMergeSaturation	16

cdrMergeLightness	17

cdrMergeRed	18

cdrMergeGreen	19

cdrMergeBlue	20


cdrNodeType

Enum cdrNodeType

Referenced By

Constant	Value	Description

cdrCuspNode	0

cdrSmoothNode	1

cdrSymmetricalNode	2

cdrMixedNodes	3


cdrOptimization

Enum cdrOptimization

Referenced By

Constant	Value	Description

cdrOptimizationOff	0

cdrOptimizationOn	1


cdrOutlineLineCaps

Enum cdrOutlineLineCaps

Referenced By

Constant	Value	Description

cdrOutlineUndefinedLineCaps	-1

cdrOutlineButtLineCaps	0

cdrOutlineRoundLineCaps	1

cdrOutlineSquareLineCaps	2


cdrOutlineLineJoin

Enum cdrOutlineLineJoin

Referenced By

Constant	Value	Description

cdrOutlineUndefinedLineJoin	-1

cdrOutlineMiterLineJoin	0

cdrOutlineRoundLineJoin	1

cdrOutlineBevelLineJoin	2


cdrOutlineType

Enum cdrOutlineType

Referenced By

Constant	Value	Description

cdrNoOutline	0

cdrOutline	1


cdrPageBackground

Enum cdrPageBackground

Referenced By

Constant	Value	Description

cdrPageBackgroundNone	0

cdrPageBackgroundSolid	1

cdrPageBackgroundBitmap	2


cdrPageOrientation

Enum cdrPageOrientation

Referenced By

Constant	Value	Description

cdrPortrait	0

cdrLandscape	1


cdrPaletteID

Enum cdrPaletteID

Referenced By

Constant	Value	Description

cdrTRUMATCH	1

cdrPANTONEProcess	2

cdrPANTONECorel8	3

cdrUniform	7

cdrFOCOLTONE	8

cdrSpectraMaster	9

cdrTOYO	10

cdrDIC	11

cdrPANTONEHexCoated	33

cdrPANTONEHexUncoated	34

cdrLab	13

cdrPANTONECoated	36

cdrPANTONEUncoated	37

cdrPANTONEMetallic	30

cdrPANTONEPastelCoated	31

cdrPANTONEPastelUncoated	32

cdrHKS	23

cdrCustom	0

cdrPANTONEMatte	35

cdrWebSafe	25


cdrPaletteType

Enum cdrPaletteType

Referenced By

Constant	Value	Description

cdrFixedPalette	0

cdrCustomPalette	1


cdrPanoseMatchingType

Enum cdrPanoseMatchingType

Referenced By

Constant	Value	Description

cdrPanosePrompt	0

cdrPanoseTemporary	1

cdrPanosePermanent	2


cdrPatternCanvasSize

Enum cdrPatternCanvasSize

Referenced By

Constant	Value	Description

cdrPatternCanvas16x16	0

cdrPatternCanvas32x32	1

cdrPatternCanvas64x64	2

cdrPatternCanvasCustom	3


cdrPatternFillType

Enum cdrPatternFillType

Referenced By

Constant	Value	Description

cdrTwoColorPattern	0

cdrFullColorPattern	1

cdrBitmapPattern	2


cdrPointType

Enum cdrPointType

Referenced By

Constant	Value	Description

cdrSnapPoint	0

cdrFreePoint	1


cdrPolygonType

Enum cdrPolygonType

Referenced By

Constant	Value	Description

cdrPolygon	0

cdrStar	1


cdrPositionOfPointOverShape

Enum cdrPositionOfPointOverShape

Referenced By

Constant	Value	Description

cdrOutsideShape	0

cdrOnMarginOfShape	1

cdrInsideShape	2


cdrPresetPoint

Enum cdrPresetPoint

Referenced By

Constant	Value	Description

cdrTopLeftPoint	-1

cdrTopPoint	-2

cdrTopRightPoint	-3

cdrRightPoint	-4

cdrBottomRightPoint	-5

cdrBottomPoint	-6

cdrBottomLeftPoint	-7

cdrLeftPoint	-8

cdrCenterPoint	-9

cdrFirstPoint	-10

cdrLastPoint	-11


cdrReferencePoint

Enum cdrReferencePoint

Referenced By

Constant	Value	Description

cdrTopRight	1

cdrTopMiddle	2

cdrTopLeft	3

cdrMiddleLeft	4

cdrBottomLeft	5

cdrBottomMiddle	6

cdrBottomRight	7

cdrMiddleRight	8

cdrCenter	9


cdrRenderType

Enum cdrRenderType

Referenced By

Constant	Value	Description

cdrRenderLineArt	0

cdrRenderOrdered	1

cdrRenderJarvis	2

cdrRenderStucki	3

cdrRenderFloyd	4

cdrRenderHalftone	5

cdrRenderCardinality	6


cdrSegmentOffsetType

Enum cdrSegmentOffsetType

Referenced By

Constant	Value	Description

cdrAbsoluteSegmentOffset	0	Measured in inches (or the current document unit) from the beginning of the segment

cdrRelativeSegmentOffset	1	Measured from 0 (beginning) to 1.0 (end). The distribution is uniform along the segment length.

cdrParamSegmentOffset	2	Ranges from 0 (beginning) to 1.0 (end). The distribution is not uniform and depends on the position of segment control points.


cdrSegmentType

Enum cdrSegmentType

Referenced By

Constant	Value	Description

cdrLineSegment	0

cdrCurveSegment	1

cdrMixedSegments	2


cdrShapeEnumDirection

Enum cdrShapeEnumDirection

Referenced By

Constant	Value	Description

cdrShapeEnumTopFirst	0

cdrShapeEnumBottomFirst	1


cdrShapeLevel

Enum cdrShapeLevel

Referenced By

Constant	Value	Description

cdrLevelGroup	0

cdrLevelContainer	1

cdrLevelLayer	2

cdrLevelPage	3

cdrLevelDocument	4


cdrShapeType

Enum cdrShapeType

Referenced By

Constant	Value	Description

cdrNoShape	0

cdrRectangleShape	1

cdrEllipseShape	2

cdrCurveShape	3

cdrPolygonShape	4

cdrBitmapShape	5

cdrTextShape	6

cdrGroupShape	7

cdrSelectionShape	8

cdrGuidelineShape	9

cdrBlendGroupShape	10

cdrExtrudeGroupShape	11

cdrOLEObjectShape	12

cdrContourGroupShape	13

cdrLinearDimensionShape	14

cdrBevelGroupShape	15

cdrDropShadowGroupShape	16

cdr3DObjectShape	17

cdrArtisticMediaGroupShape	18

cdrConnectorShape	19

cdrMeshFillShape	20


cdrSpiralType

Enum cdrSpiralType

Referenced By

Constant	Value	Description

cdrSymmetric	0

cdrLogarithmic	1


cdrTextChangeCase

Enum cdrTextChangeCase

Referenced By

Constant	Value	Description

cdrTextSentenceCase	0

cdrTextLowerCase	1

cdrTextUpperCase	2

cdrTextTitleCase	3

cdrTextToggleCase	4


cdrTextCharSet

Enum cdrTextCharSet

Referenced By

Constant	Value	Description

cdrCharSetMixed	-1

cdrCharSetANSI	0

cdrCharSetDefault	1

cdrCharSetSymbol	2

cdrCharSetShiftJIS	128

cdrCharSetHangul	129

cdrCharSetChineseBig5	136

cdrCharSetOEM	255

cdrCharSetJohab	130

cdrCharSetHebrew	177

cdrCharSetArabic	178

cdrCharSetGreek	161

cdrCharSetTurkish	162

cdrCharSetVietnamese	163

cdrCharSetThai	222

cdrCharSetEastEurope	238

cdrCharSetRussian	204

cdrCharSetMac	77

cdrCharSetBaltic	186


cdrTextFrames

Enum cdrTextFrames

Referenced By

Constant	Value	Description

cdrThisFrameOnly	0

cdrStartAtThisFrame	1

cdrAllFrames	2


cdrTextIndexingType

Enum cdrTextIndexingType

Referenced By

Constant	Value	Description

cdrCharacterIndexing	0

cdrWordIndexing	1

cdrParagraphIndexing	2


cdrTextLanguage

Enum cdrTextLanguage

Referenced By

Constant	Value	Description

cdrLanguageMixed	-1

cdrLanguageNone	0

cdrAfrikaans	1078

cdrAlbanian	1052

cdrArabicAlgeria	5121

cdrArabicBahrain	15361

cdrArabicEgypt	3073

cdrArabicIraq	2049

cdrArabicJordan	11265

cdrArabicKuwait	13313

cdrArabicLebanon	12289

cdrArabicLibya	4097

cdrArabicMorocco	6145

cdrArabicOman	8193

cdrArabicQatar	16385

cdrArabic	1025

cdrArabicSyria	10241

cdrArabicTunisia	7169

cdrArabicUAE	14337

cdrArabicYemen	9217

cdrArmenian	1067

cdrAssamese	1101

cdrAzeriCyrillic	2092

cdrAzeriLatin	1068

cdrBasque	1069

cdrByelorussian	1059

cdrBengali	1093

cdrBulgarian	1026

cdrBurmese	1109

cdrCatalan	1027

cdrChineseHongKong	3076

cdrChineseMacao	5124

cdrSimplifiedChinese	2052

cdrChineseSingapore	4100

cdrTraditionalChinese	1028

cdrCroatian	1050

cdrCzech	1029

cdrDanish	1030

cdrBelgianDutch	2067

cdrDutch	1043

cdrEnglishAUS	3081

cdrEnglishBelize	10249

cdrEnglishCanadian	4105

cdrEnglishCaribbean	9225

cdrEnglishIreland	6153

cdrEnglishJamaica	8201

cdrEnglishNewZealand	5129

cdrEnglishPhilippines	13321

cdrEnglishSouthAfrica	7177

cdrEnglishTrinidad	11273

cdrEnglishUK	2057

cdrEnglishUS	1033

cdrEnglishZimbabwe	12297

cdrEstonian	1061

cdrFaeroese	1080

cdrFarsi	1065

cdrFinnish	1035

cdrBelgianFrench	2060

cdrFrenchCameroon	11276

cdrFrenchCanadian	3084

cdrFrenchCotedIvoire	12300

cdrFrench	1036

cdrFrenchLuxembourg	5132

cdrFrenchMali	13324

cdrFrenchMonaco	6156

cdrFrenchReunion	8204

cdrFrenchSenegal	10252

cdrSwissFrench	4108

cdrFrenchWestIndies	7180

cdrFrenchZaire	9228

cdrFrisianNetherlands	1122

cdrGaelicIreland	2108

cdrGaelicScotland	1084

cdrGalician	1110

cdrGeorgian	1079

cdrGermanAustria	3079

cdrGerman	1031

cdrGermanLiechtenstein	5127

cdrGermanLuxembourg	4103

cdrSwissGerman	2055

cdrGreek	1032

cdrGujarati	1095

cdrHebrew	1037

cdrHindi	1081

cdrHungarian	1038

cdrIcelandic	1039

cdrIndonesian	1057

cdrItalian	1040

cdrSwissItalian	2064

cdrJapanese	1041

cdrKannada	1099

cdrKashmiri	1120

cdrKazakh	1087

cdrKhmer	1107

cdrKirghiz	1088

cdrKonkani	1111

cdrKorean	1042

cdrLao	1108

cdrLatvian	1062

cdrLithuanian	1063

cdrMacedonian	1071

cdrMalaysian	1086

cdrMalayBruneiDarussalam	2110

cdrMalayalam	1100

cdrMaltese	1082

cdrManipuri	1112

cdrMarathi	1102

cdrMongolian	1104

cdrNepali	1121

cdrNorwegianBokmol	1044

cdrNorwegianNynorsk	2068

cdrOriya	1096

cdrPolish	1045

cdrBrazilianPortuguese	1046

cdrPortuguese	2070

cdrPunjabi	1094

cdrRhaetoRomanic	1047

cdrRomanianMoldova	2072

cdrRomanian	1048

cdrRussianMoldova	2073

cdrRussian	1049

cdrSamiLappish	1083

cdrSanskrit	1103

cdrSerbianCyrillic	3098

cdrSerbianLatin	2074

cdrSindhi	1113

cdrSlovak	1051

cdrSlovenian	1060

cdrSorbian	1070

cdrSpanishArgentina	11274

cdrSpanishBolivia	16394

cdrSpanishChile	13322

cdrSpanishColombia	9226

cdrSpanishCostaRica	5130

cdrSpanishDominicanRepublic	7178

cdrSpanishEcuador	12298

cdrSpanishElSalvador	17418

cdrSpanishGuatemala	4106

cdrSpanishHonduras	18442

cdrMexicanSpanish	2058

cdrSpanishNicaragua	19466

cdrSpanishPanama	6154

cdrSpanishParaguay	15370

cdrSpanishPeru	10250

cdrSpanishPuertoRico	20490

cdrSpanishModernSort	3082

cdrSpanish	1034

cdrSpanishUruguay	14346

cdrSpanishVenezuela	8202

cdrSesotho	1072

cdrSutu	1072

cdrSwahili	1089

cdrSwedishFinland	2077

cdrSwedish	1053

cdrTajik	1064

cdrTamil	1097

cdrTatar	1092

cdrTelugu	1098

cdrThai	1054

cdrTibetan	1105

cdrTsonga	1073

cdrTswana	1074

cdrTurkish	1055

cdrTurkmen	1090

cdrUkrainian	1058

cdrUrdu	1056

cdrUzbekCyrillic	2115

cdrUzbekLatin	1091

cdrVenda	1075

cdrVietnamese	1066

cdrWelsh	1106

cdrXhosa	1076

cdrZulu	1077


cdrTextType

Enum cdrTextType

Referenced By

Constant	Value	Description

cdrArtisticText	0

cdrParagraphText	1

cdrArtisticFittedText	2

cdrParagraphFittedText	3


cdrTexturePropertyType

Enum cdrTexturePropertyType

Referenced By

Constant	Value	Description

cdrTexturePropertyNumeric	0

cdrTexturePropertyColorRGB	1

cdrTexturePropertyColorHSB	2

cdrTexturePropertyColorCMYK	3


cdrThumbnailSize

Enum cdrThumbnailSize

Referenced By

Constant	Value	Description

cdrNoThumbnail	0

cdr1KMonoThumbnail	1

cdr5KColorThumbnail	2

cdr10KColorThumbnail	3


cdrTileOffsetType

Enum cdrTileOffsetType

Referenced By

Constant	Value	Description

cdrTileOffsetRow	0

cdrTileOffsetColumn	1


cdrTools

Enum cdrTools

Referenced By

Constant	Value	Description

cdrToolNone	0

cdrToolPick	1

cdrToolNodeEdit	2

cdrToolKnife	64

cdrToolBezierKnife	81

cdrToolEraser	68

cdrToolDrawRectangle	3

cdrToolDrawEllipse	4

cdrToolDrawText	7

cdrToolDrawFreehand	5

cdrToolDrawNaturalPen	103

cdrToolDrawBezier	6

cdrToolHorizontalDimension	54

cdrToolVerticalDimension	55

cdrToolAutoDimension	110

cdrToolSlantedDimension	56

cdrToolLeaderText	57

cdrToolAngledDimension	58

cdrToolConnectorLines	59

cdrToolDrawPolygon	60

cdrToolDrawSpiral	62

cdrToolDrawGrid	63

cdrToolZoom	66

cdrToolPan	67

cdrToolFill	71

cdrToolTransparency	72

cdrToolInteractiveExtrude	73

cdrToolBlend	74

cdrToolRotate	75

cdrToolReflect	76

cdrToolScale	77

cdrToolSkew	78

cdrToolDistortion	79

cdrToolContour	113

cdrToolInsertHTMLFormObject	111

cdrToolDropShadow	80

cdrToolDrawConnector	115

cdrToolEyeDropper	119


cdrTransparencyAppliedTo

Enum cdrTransparencyAppliedTo

Referenced By

Constant	Value	Description

cdrApplyToFill	0

cdrApplyToOutline	1

cdrApplyToFillAndOutline	2


cdrTransparencyType

Enum cdrTransparencyType

Referenced By

Constant	Value	Description

cdrNoTransparency	0

cdrUniformTransparency	1

cdrFountainTransparency	2

cdrPatternTransparency	3

cdrTextureTransparency	4


cdrTriState

Enum cdrTriState

Referenced By

Constant	Value	Description

cdrFalse	0

cdrTrue	-1

cdrUndefined	-2


cdrUnit

Enum cdrUnit

Referenced By

Constant	Value	Description

cdrTenthMicron	0

cdrInch	1

cdrFoot	2

cdrMillimeter	3

cdrCentimeter	4

cdrPixel	5

cdrMile	6

cdrMeter	7

cdrKilometer	8

cdrDidots	9

cdrAgate	10

cdrYard	11

cdrPica	12

cdrCicero	13

cdrPoint	14

cdrUnitQ	15

cdrUnitH	16


cdrURLRegion

Enum cdrURLRegion

Referenced By

Constant	Value	Description

cdrURLRegionDefault	0

cdrURLRegionRectangle	1

cdrURLRegionShape	2


cdrVerticalAlignment

Enum cdrVerticalAlignment

Referenced By

Constant	Value	Description

cdrTopJustify	0

cdrCenterJustify	1

cdrBottomJustify	2

cdrFullJustify	3


cdrViewType

Enum cdrViewType

Referenced By

Constant	Value	Description

cdrSimpleWireframeView	0

cdrWireframeView	1

cdrDraftView	2

cdrNormalView	3

cdrEnhancedView	4


cdrWindowArrangeStyle

Enum cdrWindowArrangeStyle

Referenced By

Constant	Value	Description

cdrTileHorizontally	0

cdrTileVertically	1

cdrCascade	2


cdrWindowState

Enum cdrWindowState

Referenced By

Constant	Value	Description

cdrWindowNormal	1

cdrWindowMaximized	3

cdrWindowMinimized	2

cdrWindowRestore	9


cdrWrapStyle

Enum cdrWrapStyle

Referenced By

Constant	Value	Description

cdrWrapNone	-1

cdrWrapContourLeft	0

cdrWrapContourRight	1

cdrWrapContourStraddle	2

cdrWrapSquareLeft	3

cdrWrapSquareRight	4

cdrWrapSquareStraddle	5

cdrWrapSquareAboveBelow	6


cuiBarPosition

Enum cuiBarPosition

Referenced By

Enumerated BarPosition values

Constant	Value	Description

cuiBarLeft	0

cuiBarTop	1

cuiBarRight	2

cuiBarBottom	3

cuiBarFloating	4


cuiBarProtection

Enum cuiBarProtection

Referenced By

Enumerated BarProtection values

Constant	Value	Description

cuiBarNoProtection	0

cuiBarNoCustomize	1

cuiBarNoMove	4

cuiBarNoChangeVisible	8

cuiBarNoChangeDock	16

cuiBarNoVerticalDock	32

cuiBarNoHorizontalDock	64


cuiBarType

Enum cuiBarType

Referenced By

Enumerated BarType values

Constant	Value	Description

cuiBarTypeNormal	0

cuiBarTypeMenuBar	1

cuiBarTypePopup	2

cuiBarTypeStatusBar	3

cuiBarTypePropertyBar	4


pdfBitmapCompressionType

Enum pdfBitmapCompressionType

Referenced By

Constant	Value	Description

pdfNone	0

pdfLZW	1

pdfJPEG	2

pdfZIP	3


pdfColorMode

Enum pdfColorMode

Referenced By

Constant	Value	Description

pdfRGB	0

pdfCMYK	1

pdfGrayscale	2

pdfNative	3


pdfColorProfile

Enum pdfColorProfile

Referenced By

Constant	Value	Description

pdfCompositeProfile	0

pdfSeparationProfile	1


pdfDisplayOnStart

Enum pdfDisplayOnStart

Referenced By

Constant	Value	Description

pdfPageOnly	0

pdfFullScreen	1

PDFBookmarks	2

pdfThumbnails	3


pdfEncodingType

Enum pdfEncodingType

Referenced By

Constant	Value	Description

pdfASCII85	0

pdfBinary	1


pdfEPSAs

Enum pdfEPSAs

Referenced By

Constant	Value	Description

pdfPostscript	0

pdfPreview	1


pdfExportRange

Enum pdfExportRange

Referenced By

Constant	Value	Description

pdfWholeDocument	0

pdfCurrentPage	1

pdfSelection	2

pdfPageRange	3


pdfVersion

Enum pdfVersion

Referenced By

Constant	Value	Description

pdfVersion12	0

pdfVersion13	1

pdfVersionPDFX1	2


PrnBitmapColorMode

Enum PrnBitmapColorMode

Referenced By

Constant	Value	Description

prnBitmapCMYK	0

prnBitmapRGB	1

prnBitmapGrayscale	2


PrnColorMode

Enum PrnColorMode

Referenced By

Constant	Value	Description

prnModeFullColor	0

prnModeGrayscale	1

prnModeBlack	2


PrnFileMode

Enum PrnFileMode

Referenced By

Constant	Value	Description

prnSingleFile	0

prnSeparatePages	1

prnSeparatePlates	2


PrnImageTrap

Enum PrnImageTrap

Referenced By

Constant	Value	Description

prnTrapNormal	0

prnTrapSpread	1

prnTrapChoke	2

prnTrapCenter	3


PrnPDFStartup

Enum PrnPDFStartup

Referenced By

Constant	Value	Description

prnPDFFullScreen	0

prnPDFPageOnly	1

prnPDFThumbnails	2

prnPDFOutlines	3


PrnPlateType

Enum PrnPlateType

Referenced By

Constant	Value	Description

prnCyan	0

prnMagenta	1

prnYellow	2

prnBlack	3

prnOrange	4

prnGreen	5

prnSpot	6


PrnPostScriptLevel

Enum PrnPostScriptLevel

Referenced By

Constant	Value	Description

prnPSLevel1	1

prnPSLevel2	2

prnPSLevel3	3


PrnPrintRange

Enum PrnPrintRange

Referenced By

Constant	Value	Description

prnWholeDocument	0

prnCurrentPage	1

prnSelection	2

prnPageRange	3


PrnRegistrationStyle

Enum PrnRegistrationStyle

Referenced By

Constant	Value	Description

prnStandard	0

prnLong	1

prnSquare	2

prnHalfInverted	3

prnCorel	4


PrnTrapType

Enum PrnTrapType

Referenced By

Constant	Value	Description

prnLayerNormal	0

prnLayerTransparent	1

prnLayerOpaque	2

prnLayerOpaqueIgnore	3


CurveElement

Type CurveElement

Referenced By

Element	Type	Description

PositionX	Double

PositionY	Double

ElementType	cdrCurveElementType

NodeType	cdrNodeType

Reserved	Byte

 Related Topics


AfterPrint Event

Select one of the available subtopics below to see detailed help about the AfterPrint event.

Object	Description of event

Document	Event triggered after the Print dialog box closes

GlobalDocument	Event triggered after the Print dialog box closes


AfterSave Event

Select one of the available subtopics below to see detailed help about the AfterSave event.

Object	Description of event

Document	Event triggered after the save is completed

GlobalDocument	Event triggered after the save is completed


AfterSaveAs Event

Select one of the available subtopics below to see detailed help about the AfterSaveAs event.

Object	Description of event

Document	Event triggered after the save is completed

GlobalDocument	Event triggered after the save is completed


BeforeClose Event

Select one of the available subtopics below to see detailed help about the BeforeClose event.

Object	Description of event

Document	Event triggered before the document closes

GlobalDocument	Event triggered before the document closes


BeforePrint Event

Select one of the available subtopics below to see detailed help about the BeforePrint event.

Object	Description of event

Document	Event triggered before the Print dialog box displays

GlobalDocument	Event triggered before the Print dialog box displays


BeforeSave Event

Select one of the available subtopics below to see detailed help about the BeforeSave event.

Object	Description of event

Document	Event triggered before the Save dialog box displays

GlobalDocument	Event triggered before the Save dialog box displays


BeforeSaveAs Event

Select one of the available subtopics below to see detailed help about the BeforeSaveAs event.

Object	Description of event

Document	Event triggered before the Save dialog box displays

GlobalDocument	Event triggered before the Save dialog box displays


LayerCreated Event

Select one of the available subtopics below to see detailed help about the LayerCreated event.

Object	Description of event

Document	Event triggered after layer creation

GlobalDocument	Event triggered after layer creation


LayerDeleted Event

Select one of the available subtopics below to see detailed help about the LayerDeleted event.

Object	Description of event

Document	Event triggered after layer deletion

GlobalDocument	Event triggered after layer deletion


LayerSelected Event

Select one of the available subtopics below to see detailed help about the LayerSelected event.

Object	Description of event

Document	Event triggered after layer selection

GlobalDocument	Event triggered after layer selection


PageCreated Event

Select one of the available subtopics below to see detailed help about the PageCreated event.

Object	Description of event

Document	Event triggered after page creation

GlobalDocument	Event triggered after page creation


PageDeleted Event

Select one of the available subtopics below to see detailed help about the PageDeleted event.

Object	Description of event

Document	Event triggered after page deletion

GlobalDocument	Event triggered after page deletion


PageSelected Event

Select one of the available subtopics below to see detailed help about the PageSelected event.

Object	Description of event

Document	Event triggered after page selection

GlobalDocument	Event triggered after page selection


SelectionChanged Event

Select one of the available subtopics below to see detailed help about the SelectionChanged event.

Object	Description of event

Document	Event triggered after selection changed

GlobalDocument	Event triggered after selection changed


ShapeCreated Event

Select one of the available subtopics below to see detailed help about the ShapeCreated event.

Object	Description of event

AddinHook

Document	Event triggered after shape creation

GlobalDocument	Event triggered after shape creation


ShapeDeleted Event

Select one of the available subtopics below to see detailed help about the ShapeDeleted event.

Object	Description of event

Document	Event triggered after shape deletion

GlobalDocument	Event triggered after shape deletion


ShapeMoved Event

Select one of the available subtopics below to see detailed help about the ShapeMoved event.

Object	Description of event

Document	Event triggered after shape relocation

GlobalDocument	Event triggered after shape relocation


Activate Method

Select one of the available subtopics below to see detailed help about the Activate method.

Object	Description of method

AppWindow	Activates the application's window

Document	Activates the current document

Layer	Activates the layer

Page	Activates the page

View	Activates the view

Window	Activates the window

Workspace	Activates the workspace


Add Method

Select one of the available subtopics below to see detailed help about the Add method.

Object	Description of method

CommandBars	Adds an object to the collection

DataFields	Adds a field

DataItems	Adds a field

FountainColors	Adds a FountainColor to the FountainColors collection

NodeRange	Adds a node to the range

OutlineStyles	Adds a new outline style

PageSizes	Adds a custom page size to the collection

PatternCanvases	Adds a PatternCanvas to the PatternCanvases collection

RecentFiles	Adds a file to the Recent Files list

SegmentRange	Adds a segment to the range

ShapeRange	Adds a shape in a range


AddNode Method

Select one of the available subtopics below to see detailed help about the AddNode method.

Object	Description of method

CorelScript

SegmentRange	Adds a node at the middle of each segment within the range


AddNodeAt Method

Select one of the available subtopics below to see detailed help about the AddNodeAt method.

Object	Description of method

Segment	Inserts a node on the segment

SubPath	Inserts a node on the segment


AddRange Method

Select one of the available subtopics below to see detailed help about the AddRange method.

Object	Description of method

NodeRange	Adds all nodes from the given range to the current range

SegmentRange	Adds all segments from the given range to the current range

ShapeRange	Adds a shape range in a range


AddToPowerClip Method

Select one of the available subtopics below to see detailed help about the AddToPowerClip method.

Object	Description of method

Shape	Adds this shape to a power clip

ShapeRange	Adds this shape to a power clip


AddToSelection Method

Select one of the available subtopics below to see detailed help about the AddToSelection method.

Object	Description of method

Shape	Adds a shape to a selection; will not work if the shape is a Selection Shape

ShapeRange	Adds To Selection


All Method

Select one of the available subtopics below to see detailed help about the All method.

Object	Description of method

Nodes	Creates a range containing all the nodes of the collection

Segments	Creates a range containing all the segments of the collection

Shapes	Gets the shape range


AllExcluding Method

Select one of the available subtopics below to see detailed help about the AllExcluding method.

Object	Description of method

Nodes	Creates a range containing all the nodes except the ones specified

Segments	Creates a range containing all the segments except the ones specified

Shapes	Gets the shape range excluding the indexes


ApplyBitmapEffect Method

Select one of the available subtopics below to see detailed help about the ApplyBitmapEffect method.

Object	Description of method

Bitmap	Applies the specified bitmap effect

CorelScript


ApplyFountainFill Method

Select one of the available subtopics below to see detailed help about the ApplyFountainFill method.

Object	Description of method

CorelScript

Fill	Apply a Fountain Fill to the shape

ShapeRange	Apply a Fountain Fill to the shape


ApplyNoFill Method

Select one of the available subtopics below to see detailed help about the ApplyNoFill method.

Object	Description of method

CorelScript

Fill	Apply no Fill to the shape

ShapeRange	Apply no Fill to the shape


ApplyPatternFill Method

Select one of the available subtopics below to see detailed help about the ApplyPatternFill method.

Object	Description of method

Fill	Apply a Pattern Fill to the shape

ShapeRange	Apply a Pattern Fill to the shape


ApplyPostscriptFill Method

Select one of the available subtopics below to see detailed help about the ApplyPostscriptFill method.

Object	Description of method

CorelScript

Fill	Apply a PostScript Fill to the shape

ShapeRange	Apply a PostScript Fill to the shape


ApplyStyle Method

Select one of the available subtopics below to see detailed help about the ApplyStyle method.

Object	Description of method

CorelScript

Shape	Applies a text/graphic style


ApplyTextureFill Method

Select one of the available subtopics below to see detailed help about the ApplyTextureFill method.

Object	Description of method

CorelScript

Fill	Apply a Texture Fill to the shape

ShapeRange	Apply a Texture Fill to the shape


ApplyUniformFill Method

Select one of the available subtopics below to see detailed help about the ApplyUniformFill method.

Object	Description of method

Fill	Apply a Uniform Fill to the shape

ShapeRange	Apply a Uniform Fill to the shape


BeginCommandGroup Method

Select one of the available subtopics below to see detailed help about the BeginCommandGroup method.

Object	Description of method

CorelScript

Document	BeginCommandGroup


BreakApart Method

Select one of the available subtopics below to see detailed help about the BreakApart method.

Object	Description of method

CorelScript

Node	Breaks this node into two unconnected nodes

NodeRange	Breaks apart the curve at each node in the range

Shape	Breaks Apart


BreakApartAt Method

Select one of the available subtopics below to see detailed help about the BreakApartAt method.

Object	Description of method

Segment	Breaks this segment into two unconnected segments

SubPath	Breaks this segment into two unconnected segments


Clear Method

Select one of the available subtopics below to see detailed help about the Clear method.

Object	Description of method

Clipboard	Clears the contents of the clipboard

DataItem	Clears the dataitem

DataItems	Clears DataItem collection

Effect	Clears the blend effect for the object

PatternCanvas	Clears the Pattern Canvas

PrintJob	method Clear


ClearEffect Method

Select one of the available subtopics below to see detailed help about the ClearEffect method.

Object	Description of method

CorelScript

Shape	Clears Effect

ShapeRange	Clears effects for the shapes in the shape range.


Clone Method

Select one of the available subtopics below to see detailed help about the Clone method.

Object	Description of method

Shape	Clones the shape

ShapeRange	Clone


Close Method

Select one of the available subtopics below to see detailed help about the Close method.

Object	Description of method

Document	Closes the document

Palette	Closes the color palette

Window	Closes the window


Combine Method

Select one of the available subtopics below to see detailed help about the Combine method.

Object	Description of method

CorelScript

Shape	Combines

ShapeRange	Combines

TextRange	Combines the current text range with the given range


ConvertOutlineToObject Method

Select one of the available subtopics below to see detailed help about the ConvertOutlineToObject method.

Object	Description of method

CorelScript

ShapeRange	Converts an outline into an object


ConvertToBitmap Method

Select one of the available subtopics below to see detailed help about the ConvertToBitmap method.

Object	Description of method

CorelScript

Shape	Converts the shape from a vector to a raster image

ShapeRange	Converts to bitmap


ConvertToBitmapEx Method

Select one of the available subtopics below to see detailed help about the ConvertToBitmapEx method.

Object	Description of method

Shape	Converts to bitmap ex

ShapeRange	Converts to bitmap


ConvertToBW Method

Select one of the available subtopics below to see detailed help about the ConvertToBW method.

Object	Description of method

Bitmap	Converts the bitmap to Black and White

Color	Converts the color model to Black and White


ConvertToCurves Method

Select one of the available subtopics below to see detailed help about the ConvertToCurves method.

Object	Description of method

CorelScript

Shape	Converts a shape to curves

ShapeRange	Convert to curves


Copy Method

Select one of the available subtopics below to see detailed help about the Copy method.

Object	Description of method

Shape	Copies the shape

ShapeRange	Copy

TextRange	Copies the text to the clipboard


CopyAssign Method

Select one of the available subtopics below to see detailed help about the CopyAssign method.

Object	Description of method

Color	Copies color model assignment

Curve	Copies curve information to change the current curve


CopyFrom Method

Select one of the available subtopics below to see detailed help about the CopyFrom method.

Object	Description of method

DataItems	Copies DataItems from a Shape

EffectBlend	Copies the blend from another object

EffectEnvelope	Copies the envelope properties from another envelope effect

EffectExtrude	Copies the extrude properties from another extrude object


CreateArtisticText Method

Select one of the available subtopics below to see detailed help about the CreateArtisticText method.

Object	Description of method

CorelScript

Layer	Creates artistic text on a layer


CreateConnector Method

Select one of the available subtopics below to see detailed help about the CreateConnector method.

Object	Description of method

CorelScript

Layer	Creates a connector on a layer


CreateCurve Method

Select one of the available subtopics below to see detailed help about the CreateCurve method.

Object	Description of method

Application	Creates an instance of Curve object and optionally binds it to a document

Layer	Creates an empty curve container


CreateEllipse Method

Select one of the available subtopics below to see detailed help about the CreateEllipse method.

Object	Description of method

CorelScript

Layer	Creates an ellipse on a layer


CreateGridBoxes Method

Select one of the available subtopics below to see detailed help about the CreateGridBoxes method.

Object	Description of method

CorelScript

Layer	Creates grid boxes on a layer


CreateRectangle Method

Select one of the available subtopics below to see detailed help about the CreateRectangle method.

Object	Description of method

CorelScript

Layer	Creates a rectangle on a layer


CreateSelection Method

Select one of the available subtopics below to see detailed help about the CreateSelection method.

Object	Description of method

Shape	Makes a selection from a shape

ShapeRange	Makes a selection from a shape range


CreateSpiral Method

Select one of the available subtopics below to see detailed help about the CreateSpiral method.

Object	Description of method

CorelScript

Layer	Creates a spiral on a layer


Crop Method

Select one of the available subtopics below to see detailed help about the Crop method.

Object	Description of method

Bitmap	Crops the bitmap to its clipping path

IImportCropHandler


Cut Method

Select one of the available subtopics below to see detailed help about the Cut method.

Object	Description of method

Shape	Cuts the shape

ShapeRange	Cut


Delete Method

Select one of the available subtopics below to see detailed help about the Delete method.

Object	Description of method

CommandBar	Deletes the control

CorelScriptFile	Deletes the Corel SCRIPT file from disk

DataField	Deletes datafield

FountainColor	Removes the object from the FountainColors collection

Layer	Deletes the layer

Node	Removes this node from the curve

NodeRange	Deletes all the nodes within the range

Page	Deletes the page

PageSize	Deletes the custom paper type

Properties	Deletes a property

RecentFile	Removes the file from the Recent File list

Shape	Deletes the shape

ShapeRange	Deletes a shape in a range

SubPath	Erases the whole subpath

TextRange	Deletes the characters in the range

View	Deletes the view


Duplicate Method

Select one of the available subtopics below to see detailed help about the Duplicate method.

Object	Description of method

Shape	Duplicates the shape

ShapeRange	Duplicates

TextRange	Returns a copy of the TextRange object


EndCommandGroup Method

Select one of the available subtopics below to see detailed help about the EndCommandGroup method.

Object	Description of method

CorelScript

Document	EndCommandGroup


FindShape Method

Select one of the available subtopics below to see detailed help about the FindShape method.

Object	Description of method

Layer	Find Shape

Page	Find Shape

Shapes	Gets a shape based upon specified properties.


FindShapes Method

Select one of the available subtopics below to see detailed help about the FindShapes method.

Object	Description of method

Layer	Find Shapes

Page	Find Shapes

Shapes	Finds shapes based upon specified properties and returns them as a shape range


Finish Method

Select one of the available subtopics below to see detailed help about the Finish method.

Object	Description of method

ExportFilter

ImportFilter


Flip Method

Select one of the available subtopics below to see detailed help about the Flip method.

Object	Description of method

Shape	Flips

ShapeRange	Flips


Freeze Method

Select one of the available subtopics below to see detailed help about the Freeze method.

Object	Description of method

EffectLens	Freezes the lens effect

Transparency	Freezes the transparency


GetBoundingBox Method

Select one of the available subtopics below to see detailed help about the GetBoundingBox method.

Object	Description of method

Shape	Gets the shape bounding box relatively to its lower left corner

ShapeRange	Gets the shape range bounding box relatively to its lower left corner


GetColor Method

Select one of the available subtopics below to see detailed help about the GetColor method.

Object	Description of method

CorelScript

CorelScriptTools	Gets Color


GetCopy Method

Select one of the available subtopics below to see detailed help about the GetCopy method.

Object	Description of method

Curve	Returns a copy of curve information as a free curve

Segment	Returns a copy of the current segment as a separate curve

SubPath	Returns a copy of the current subpath as a separate curve


GetCurvatureAt Method

Select one of the available subtopics below to see detailed help about the GetCurvatureAt method.

Object	Description of method

Segment	Gets the Curve's Curvature at the current segment

SubPath	Gets the Curve's Curvature at the current subpath


GetCurveSpeedAt Method

Select one of the available subtopics below to see detailed help about the GetCurveSpeedAt method.

Object	Description of method

Segment	Gets the Curve's Speed at the current segment

SubPath	Gets the Curve's Speed at the current subpath


GetIntersections Method

Select one of the available subtopics below to see detailed help about the GetIntersections method.

Object	Description of method

Segment	Finds the intersection point(s) with another segment

SubPath	Finds the intersection point(s) with another subpath


GetPerpendicularAt Method

Select one of the available subtopics below to see detailed help about the GetPerpendicularAt method.

Object	Description of method

Segment	Finds the perpendicular line to a point on the segment

SubPath	Finds the perpendicular line to a point on the segment


GetPointPositionAt Method

Select one of the available subtopics below to see detailed help about the GetPointPositionAt method.

Object	Description of method

Segment	Gets the coordinates of a point located on the curve

SubPath	Gets the coordinates of a point located on the subpath


GetPosition Method

Select one of the available subtopics below to see detailed help about the GetPosition method.

Object	Description of method

CorelScript

Node	Gets the horizontal and vertical position of the node on the page

Shape	Gets Position

ShapeRange	Gets Position

SubPath	Gets the horizontal and vertical position of the subpath's head on the page


GetSize Method

Select one of the available subtopics below to see detailed help about the GetSize method.

Object	Description of method

CorelScript

Page	Gets the size of the page

Shape	Gets Size

ShapeRange	Gets Size


GetTangentAt Method

Select one of the available subtopics below to see detailed help about the GetTangentAt method.

Object	Description of method

Segment	Finds the tangent line to a point on the segment

SubPath	Finds the tangent line to a point on the segment


GetUserClick Method

Select one of the available subtopics below to see detailed help about the GetUserClick method.

Object	Description of method

CorelScript

Document	Gets a user click position and information about the state of the CTRL, ALT and SHIFT keys at the moment of click


Group Method

Select one of the available subtopics below to see detailed help about the Group method.

Object	Description of method

CorelScript

Shape	Creates a group; only works if the shape type is a Selection

ShapeRange	Creates a group


ImportWorkspace Method

Select one of the available subtopics below to see detailed help about the ImportWorkspace method.

Object	Description of method

Application	Imports workspace elements into the current workspace

FrameWork	Imports a workspace into the framework


InsertPages Method

Select one of the available subtopics below to see detailed help about the InsertPages method.

Object	Description of method

CorelScript

Document	Adds a page or pages between two others; returns the first page added


IsSame Method

Select one of the available subtopics below to see detailed help about the IsSame method.

Object	Description of method

Color	Returns True if the two colors are of the same color model, with equal color values

TextRange	Gets whether the current text range is the same as the given range


Load Method

Select one of the available subtopics below to see detailed help about the Load method.

Object	Description of method

PatternFill	Loads Pattern file

PDFVBASettings

PrintSettings	method Load


Move Method

Select one of the available subtopics below to see detailed help about the Move method.

Object	Description of method

FountainColor	Sets the Position

Node	Moves the node by a given delta

NodeRange	Moves all the nodes within the range by a given delta

Shape	Moves the shape using a delta

ShapeRange	Moves

SubPath	Moves the whole subpath by a given delta


Next Method

Select one of the available subtopics below to see detailed help about the Next method.

Object	Description of method

Node	Gets the node following this one

Segment	Gets the segment following this one

SubPath	Gets the subpath following this one


Open Method

Select one of the available subtopics below to see detailed help about the Open method.

Object	Description of method

Palettes	Open

RecentFile	Opens the file for editing


OrderBackOf Method

Select one of the available subtopics below to see detailed help about the OrderBackOf method.

Object	Description of method

Shape	Arranges the shape's stacking order by moving it in back of another shape

ShapeRange	Arranges the shape's stacking order by moving it in back of another shape


OrderBackOne Method

Select one of the available subtopics below to see detailed help about the OrderBackOne method.

Object	Description of method

CorelScript

Shape	Arranges the shape's stacking order by moving it back one

ShapeRange	Arranges the shape's stacking order by moving it back one


OrderForwardOne Method

Select one of the available subtopics below to see detailed help about the OrderForwardOne method.

Object	Description of method

CorelScript

Shape	Arranges the shape's stacking order by moving it forward one

ShapeRange	Arranges the shape's stacking order by moving it forward one


OrderFrontOf Method

Select one of the available subtopics below to see detailed help about the OrderFrontOf method.

Object	Description of method

Shape	Arranges the shape's stacking order by moving it in front of another shape

ShapeRange	Arranges the shape's stacking order by moving it in front of another shape


OrderReverse Method

Select one of the available subtopics below to see detailed help about the OrderReverse method.

Object	Description of method

Shape	Reverses

ShapeRange	Reverses


OrderToBack Method

Select one of the available subtopics below to see detailed help about the OrderToBack method.

Object	Description of method

CorelScript

Shape	Arranges the shape's stacking order by moving it to the back

ShapeRange	Arranges the shape's stacking order by moving it to the back


OrderToFront Method

Select one of the available subtopics below to see detailed help about the OrderToFront method.

Object	Description of method

CorelScript

Shape	Arranges the shape's stacking order by moving it to the front

ShapeRange	Arranges the shape's stacking order by moving it to the front


Paste Method

Select one of the available subtopics below to see detailed help about the Paste method.

Object	Description of method

Layer	Paste

TextRange	Replaces the current text range and returns the new one


Previous Method

Select one of the available subtopics below to see detailed help about the Previous method.

Object	Description of method

Node	Gets the node preceding this one

Segment	Gets the segment preceding this one

SubPath	Gets the subpath preceding this one


PrintOut Method

Select one of the available subtopics below to see detailed help about the PrintOut method.

Object	Description of method

Document	Opens the Print dialog

PrintJob	method PrintOut


Range Method

Select one of the available subtopics below to see detailed help about the Range method.

Object	Description of method

Nodes	Creates a range containing the specified nodes

Segments	Creates a range containing the specified segments

Shapes	Gets the shape range from index

Text	Gets a range of characters

TextRange	Returns a range of characters relative to the beginning of the current range


Redo Method

Select one of the available subtopics below to see detailed help about the Redo method.

Object	Description of method

CorelScript

Document	Reverses the last undo operation


Refresh Method

Select one of the available subtopics below to see detailed help about the Refresh method.

Object	Description of method

Application	Updates open dockers

Window	Refresh the window

Windows	Refresh all the windows


Remove Method

Select one of the available subtopics below to see detailed help about the Remove method.

Object	Description of method

ArrowHeads	Removes an arrow head from the collection

NodeRange	Removes a node from the range

OutlineStyles	Removes an outline style

PatternCanvases	Removes a PatternCanvas from the PatternCanvases collection

SegmentRange	Removes a segment from the range

ShapeRange	Removes


RemoveAll Method

Select one of the available subtopics below to see detailed help about the RemoveAll method.

Object	Description of method

NodeRange	Removes all nodes from the range

SegmentRange	Removes all segments from the range

ShapeRange	Removes All


RemoveFromContainer Method

Select one of the available subtopics below to see detailed help about the RemoveFromContainer method.

Object	Description of method

Shape	Removes this shape from a power clip

ShapeRange	Removes this shape from a power clip


RemoveFromSelection Method

Select one of the available subtopics below to see detailed help about the RemoveFromSelection method.

Object	Description of method

Shape	Removes a shape from a selection; will not work if the shape is a Selection Shape

ShapeRange	Removes the shape in the range from the current selection


RemoveRange Method

Select one of the available subtopics below to see detailed help about the RemoveRange method.

Object	Description of method

NodeRange	Removes the nodes in the given range from the current range

SegmentRange	Removes the segments in the given range from the current range

ShapeRange	Removes a range of shapes from the shape range.


Repeat Method

Select one of the available subtopics below to see detailed help about the Repeat method.

Object	Description of method

CorelScript

Document	Repeats the last operation


Replace Method

Select one of the available subtopics below to see detailed help about the Replace method.

Object	Description of method

Text	Replaces text

TextRange	Replaces the range with the text string and returns the new range


Resample Method

Select one of the available subtopics below to see detailed help about the Resample method.

Object	Description of method

Bitmap	Resamples the bitmap

IImportResampleHandler


Reset Method

Select one of the available subtopics below to see detailed help about the Reset method.

Object	Description of method

CommandBar	Resets the control to it's default property values

ExportFilter

ImportFilter

PDFVBASettings

PrintSettings	method Reset


ReverseDirection Method

Select one of the available subtopics below to see detailed help about the ReverseDirection method.

Object	Description of method

Curve	Reverses the node order within the curve

SubPath	Reverses the node order within the subpath


Rotate Method

Select one of the available subtopics below to see detailed help about the Rotate method.

Object	Description of method

EffectExtrude	Rotates the extrude

NodeRange	Rotates the nodes within the range as a shape

Shape	Rotates the shape by adding the amount to the current rotation value

ShapeRange	Rotates the shape by adding the amount to the current rotation value


RotateEx Method

Select one of the available subtopics below to see detailed help about the RotateEx method.

Object	Description of method

Shape	Rotate Ex

ShapeRange	EX-Rotates the shape by adding the amount to the current rotation value


Save Method

Select one of the available subtopics below to see detailed help about the Save method.

Object	Description of method

Document	Saves the document

OutlineStyles	Saves changes made to outline styles

Palette	Saves the palette

PDFVBASettings

PrintSettings	method Save


SaveAs Method

Select one of the available subtopics below to see detailed help about the SaveAs method.

Object	Description of method

Bitmap	Saves the bitmap to the specified file and returns the filter object

Document	Saves the document with options available


Select Method

Select one of the available subtopics below to see detailed help about the Select method.

Object	Description of method

EffectEnvelope	Selects an index for the envelope

PatternCanvas	Sets the image from preset image list

PostScriptFill	Selects the PostScript Fill by name or index

TextRange	Selects the characters in the range

TextureFill	Selects the Library and the Texture


Selection Method

Select one of the available subtopics below to see detailed help about the Selection method.

Object	Description of method

Curve	Creates a range containing all the selected nodes on this curve

Document	Gets a shape with a cdrSelectionShape type

SubPath	Creates a range containing all the select nodes on this subpath


Separate Method

Select one of the available subtopics below to see detailed help about the Separate method.

Object	Description of method

CorelScript

Effect	Separates the blend effect for the object

Shape	Separates combined shapes or a link group


SetBoundingBox Method

Select one of the available subtopics below to see detailed help about the SetBoundingBox method.

Object	Description of method

Shape	Sets Bounding Box

ShapeRange	Sets Bounding Box


SetPosition Method

Select one of the available subtopics below to see detailed help about the SetPosition method.

Object	Description of method

CorelScript

Node	Sets the horizontal and vertical position of the node on the page

Shape	Sets Position

ShapeRange	Sets Position

SubPath	Sets the horizontal and vertical position of the subpath's head on the page


SetProperties Method

Select one of the available subtopics below to see detailed help about the SetProperties method.

Object	Description of method

Outline	Sets all outline properties

PostScriptFill	Sets PostScript Fill Properties

TextureFill	Sets Texture Properties


SetRadius Method

Select one of the available subtopics below to see detailed help about the SetRadius method.

Object	Description of method

Ellipse	Sets the ellipse radius

Rectangle	Sets the corners radius


SetRotationCenter Method

Select one of the available subtopics below to see detailed help about the SetRotationCenter method.

Object	Description of method

Shape	Sets Rotation Center

ShapeRange	Sets the rotation center of the shape range


SetSize Method

Select one of the available subtopics below to see detailed help about the SetSize method.

Object	Description of method

CorelScript

Page	Sets the size of the page

Shape	Sets Size

ShapeRange	Sets Size


SetSizeEx Method

Select one of the available subtopics below to see detailed help about the SetSizeEx method.

Object	Description of method

Shape	Sets the shape size using the anchor point

ShapeRange	Sets the shape range size using the anchor point


SetType Method

Select one of the available subtopics below to see detailed help about the SetType method.

Object	Description of method

NodeRange	Sets the type of all nodes

SegmentRange	Sets the type of all segments


ShowDialog Method

Select one of the available subtopics below to see detailed help about the ShowDialog method.

Object	Description of method

ExportFilter

ImportFilter

PDFVBASettings

Printer	method ShowDialog

PrintSettings	method ShowDialog


Skew Method

Select one of the available subtopics below to see detailed help about the Skew method.

Object	Description of method

NodeRange	Skew the nodes within the range as a shape

Shape	Skews the shape

ShapeRange	Skews the shape


SkewEx Method

Select one of the available subtopics below to see detailed help about the SkewEx method.

Object	Description of method

Shape	Skew Ex

ShapeRange	EX-Skews the shape


Stretch Method

Select one of the available subtopics below to see detailed help about the Stretch method.

Object	Description of method

NodeRange	Resizes the nodes within the range as a shape

Shape	Stretches the shape

ShapeRange	Stretches the shapes in the shape range


StretchEx Method

Select one of the available subtopics below to see detailed help about the StretchEx method.

Object	Description of method

Shape	Stretches the shape using the anchor point

ShapeRange	Stretches the shapes in the shape range using the anchor point


Translate Method

Select one of the available subtopics below to see detailed help about the Translate method.

Object	Description of method

CorelScriptFile	Translates a Corel SCRIPT

FountainFill	Moves Start and End points


Trim Method

Select one of the available subtopics below to see detailed help about the Trim method.

Object	Description of method

CorelScript

Shape	Trims to another object


Undo Method

Select one of the available subtopics below to see detailed help about the Undo method.

Object	Description of method

CorelScript

Document	Reverses the last operation


Unfreeze Method

Select one of the available subtopics below to see detailed help about the Unfreeze method.

Object	Description of method

EffectLens	Unfreezes the lens effect

Transparency	Unfreezes the transparency


Ungroup Method

Select one of the available subtopics below to see detailed help about the Ungroup method.

Object	Description of method

CorelScript

EffectLens	Ungroups the lens object

Shape	Ungroups a group


UngroupAll Method

Select one of the available subtopics below to see detailed help about the UngroupAll method.

Object	Description of method

CorelScript

Shape	Ungroups all nested groups

ShapeRange	Ungroups all nested groups


Weld Method

Select one of the available subtopics below to see detailed help about the Weld method.

Object	Description of method

CorelScript

Shape	Welds to another object


AbsoluteIndex Property

Select one of the available subtopics below to see detailed help about the AbsoluteIndex property.

Object	Description of property

Node	Gets the index of the node within the curve

Segment	Gets the index of the segment within the curve


Active Property

Select one of the available subtopics below to see detailed help about the Active property.

Object	Description of property

AppWindow	Gets the application's window active status

Document	Gets if the page is active

Window	Gets if the window is active

Workspace	Gets the current workspace


ActiveLayer Property

Select one of the available subtopics below to see detailed help about the ActiveLayer property.

Object	Description of property

Application	Gets the active layer

Document	Gets the reference to the active layer in the currently active document

Page	Gets the active layer on the page object


ActivePage Property

Select one of the available subtopics below to see detailed help about the ActivePage property.

Object	Description of property

Application	Gets the reference to the currently active page

Document	Gets the reference to the active page in the currently active document


ActiveShape Property

Select one of the available subtopics below to see detailed help about the ActiveShape property.

Object	Description of property

Application	Gets the active shape

Document	Gets the active shape


ActiveWindow Property

Select one of the available subtopics below to see detailed help about the ActiveWindow property.

Object	Description of property

Application	Gets the reference to the currently active window

Document	Gets the reference to the active window in the currently active document


Alignment Property

Select one of the available subtopics below to see detailed help about the Alignment property.

Object	Description of property

StructAlignProperties

TextRange	Gets/sets the alignment of the text in the range


All Property

Select one of the available subtopics below to see detailed help about the All property.

Object	Description of property

TextCharacters	Returns a TextRange containing all characters in the collection

TextColumns	Returns a TextRange containing containing all columns in the collection

TextFrames	Returns a TextRange containing all frames in the collection

TextLines	Returns a TextRange containing all lines in the collection

TextParagraphs	Returns a TextRange containing all paragraphs in the collection

TextWords	Returns a TextRange containing all words in the collection


Amplitude Property

Select one of the available subtopics below to see detailed help about the Amplitude property.

Object	Description of property

EffectPushPullDistortion	Gets or sets the amplitude of the PushPull distortion

EffectZipperDistortion	Gets or sets the amplitude of the Zipper distortion


Angle Property

Select one of the available subtopics below to see detailed help about the Angle property.

Object	Description of property

EffectBlend	Gets or sets the blend angle

EffectTwisterDistortion	Gets or sets the distortion angle of the Twister distortion

FountainFill	Gets a fountain fill's angle

SeparationPlate	property Angle

StructFountainFillProperties


Application Property

Select one of the available subtopics below to see detailed help about the Application property.

Object	Description of property

ActiveView	Gets the application to which the object belongs

AddinHook

AddIns

Application	Gets the application to which the object belongs

AppWindow	Gets the application to which the object belongs

ArrowHeads	Gets the application to which the arrow head collection belongs

Clipboard	Gets the application to which the object belongs

CloneLink	Gets the application to which the object belongs

Color	Gets the application to which the object belongs

Colors	Gets the application to which the color collection belongs

CorelScriptFile	Gets the application to which the object belongs

DataField	Gets the application to which the object belongs

DataFields	Gets the application to which the object belongs

DataItem	Gets the application to which the object belongs

DataItems	Gets the application to which the object belongs

Document	Gets the application to which the object belongs

Documents	Gets the application to which the document collection belongs

Effect	Gets the application to which the object belongs

EffectArtistic	Gets the application to which the object belongs

EffectBlend	Gets the application to which the object belongs

EffectContour	Gets the application to which the object belongs

EffectControlPath	Gets the application to which the object belongs

EffectDistortion	Gets the application to which the object belongs

EffectDropShadow	Gets the application to which the object belongs

EffectEnvelope	Gets the application to which the object belongs

EffectExtrude	Gets the application to which the object belongs

EffectLens	Gets the application to which the object belongs

EffectPerspective	Gets the application to which the object belongs

EffectPushPullDistortion	Gets the application to which the object belongs

Effects	Gets the application to which the object belongs

EffectTextOnPath	Gets the application to which the object belongs

EffectTwisterDistortion	Gets the application to which the object belongs

EffectZipperDistortion	Gets the application to which the object belongs

ExtrudeVanishingPoint	Gets the application to which the object belongs

FontList	Gets the application to which the font list belongs

Grid	Gets the application to which the object belongs

Layer	Gets the application to which the object belongs

Layers	Gets the application to which the layer collection belongs

Node	Gets the application to which the node belongs

NodeRange	Gets the application to which the node range belongs

Nodes	Gets the application to which the node collection belongs

OutlineStyles	Gets the application to which the outlinestyle collection belongs

Page	Gets the application to which the object belongs

Pages	Gets the application to which the page collection belongs

Palette	Gets the application to which the object belongs

Palettes	Gets the application to which the palette collection belongs

PowerClip	Gets the application to which the object belongs

RecentFile	Gets the application to which the object belongs

RecentFiles	Gets the application to which the object belongs

Rulers	Gets the application to which the object belongs

Segment	Gets the application to which the segment belongs

SegmentRange	Gets the application to which the range belongs

Segments	Gets the application to which the segment collection belongs

SelectionInfo	Gets the application to which the object belongs

Shape	Gets the application to which the object belongs

ShapeRange	Gets the application to which the shape range belongs

Shapes	Gets the application to which the shape collection belongs

SnapPoint	Gets the application to which the point belongs

SnapPoints	Gets the application to which the point collection belongs

SubPath	Gets the application to which the segment collection belongs

Subpaths	Gets the application to which the subpath collection belongs

Transparency	Gets the application to which the object belongs

View	Gets the application to which the object belongs

Views	Gets the application to which the object belongs

Window	Gets the application to which the object belongs

Windows	Gets the application to which the window collection belongs

Workspace	Gets the application to which the object belongs

Workspaces	Gets the application to which the workspace collection belongs


Bleed Property

Select one of the available subtopics below to see detailed help about the Bleed property.

Object	Description of property

Page	Gets or sets the page's bleed

PDFVBASettings


BlendType Property

Select one of the available subtopics below to see detailed help about the BlendType property.

Object	Description of property

FountainFill	Gets or sets a fountain fill's blend type

StructFountainFillProperties


BuiltIn Property

Select one of the available subtopics below to see detailed help about the BuiltIn property.

Object	Description of property

CommandBar	Gets whether the control is a built in system control

PageSize	Gets the height of the page


Caption Property

Select one of the available subtopics below to see detailed help about the Caption property.

Object	Description of property

AppWindow	Gets or sets the application's window caption

CommandBarControl	Gets/sets the caption of the control

Window	Gets the window caption


CenterX Property

Select one of the available subtopics below to see detailed help about the CenterX property.

Object	Description of property

Ellipse	Gets or sets the horizontal ellipse center position

Page	Gets the horizontal page center coordinate

StructFountainFillProperties


CenterY Property

Select one of the available subtopics below to see detailed help about the CenterY property.

Object	Description of property

Ellipse	Gets or sets the vertical ellipse center position

Page	Gets the vertical page center coordinate

StructFountainFillProperties


CloneParent Property

Select one of the available subtopics below to see detailed help about the CloneParent property.

Object	Description of property

CloneLink	Gets the clone parent

Effect	Gets the parent effect for the cloned effects collection


Clones Property

Select one of the available subtopics below to see detailed help about the Clones property.

Object	Description of property

Effect	Gets the collection of effects cloned from the current object

Shape	Gets the collection of cloned shapes


Closed Property

Select one of the available subtopics below to see detailed help about the Closed property.

Object	Description of property

Curve	Gets or sets whether the curve is closed

SubPath	Gets or sets whether the subpath is open or closed


Color Property

Select one of the available subtopics below to see detailed help about the Color property.

Object	Description of property

EffectDropShadow	Gets or sets the feather color

EffectLens	Gets or sets the lens color

FountainColor	Gets or sets the Color

Layer	Gets or sets the layer override color

Outline	Gets or sets an outline's color

Page	Gets or sets the page color

Palette	Gets or sets a color object based on index

SeparationPlate	property Color

TrapLayer	property Color


ColorAcceleration Property

Select one of the available subtopics below to see detailed help about the ColorAcceleration property.

Object	Description of property

EffectBlend	Gets or sets whether or not the color accelerates along the path

EffectContour	Gets or sets the Color Acceleration


ColorBlendType Property

Select one of the available subtopics below to see detailed help about the ColorBlendType property.

Object	Description of property

EffectBlend	Gets or sets the blend type of cdrFountainFillBlendType type

EffectContour	Gets or sets the color blend type


ColorCount Property

Select one of the available subtopics below to see detailed help about the ColorCount property.

Object	Description of property

Palette	Gets the number of colors in a color palette

StructFountainFillProperties


ColorMode Property

Select one of the available subtopics below to see detailed help about the ColorMode property.

Object	Description of property

PDFVBASettings

PrintOptions	property ColorMode


ColorResolution Property

Select one of the available subtopics below to see detailed help about the ColorResolution property.

Object	Description of property

PDFVBASettings

PrintOptions	property ColorResolution


CommandBars Property

Select one of the available subtopics below to see detailed help about the CommandBars property.

Object	Description of property

Application	Gets a collection of all command bars

FrameWork	Gets a collection of all CommandBars in the FrameWork


Container Property

Select one of the available subtopics below to see detailed help about the Container property.

Object	Description of property

EffectEnvelope	Gets or sets the curve for the envelope

TextFrame	Returns a reference to the frame's container


ContourGroup Property

Select one of the available subtopics below to see detailed help about the ContourGroup property.

Object	Description of property

EffectContour	Gets the contour group shape

SelectionInfo	Gets the selected contour group


Controls Property

Select one of the available subtopics below to see detailed help about the Controls property.

Object	Description of property

CommandBar	Gets the collection of controls contained by the bar

CommandBarMode	property Controls


Count Property

Select one of the available subtopics below to see detailed help about the Count property.

Object	Description of property

ArrowHeads	Gets the number of arrows heads in the collection

Colors	Gets the number of colors in the color collection

CommandBarControls	Gets the number of items in the collection

CommandBarModes	Gets the number of items in the collection

CommandBars	Gets the number of items in the collection

CrossPoints	Gets the number of CrossPoints in the CrossPoint collection

DataFields	Gets the number of items in the collection of DataFields

DataItems	Gets the number of items in the collection of dataitems

Documents	Gets the number of items in the collection of documents

Effects	Gets the number of items in the collection of effects

FontList	Gets the number of items in the list of fonts

FountainColors	Gets the number of FountainColor in the FountainColors collection

Layers	Gets the number of layers in the collection

NodeRange	Gets the number of nodes in the range

Nodes	Gets the number of nodes in the node collection

OutlineStyles	Gets the number of outlinestyles in the collection

Pages	Gets the number of items in the collection of pages

PageSizes	Gets the number of objects

Palettes	Gets the number of items in the collection of palettes

PatternCanvases	Gets the number of PatternCanvas in the PatternCanvases collection

PrintDocuments	property Count

PrintPages	property Count

Properties	Gets the properties Count

RecentFiles	Gets the number of items in the collection of recent files

SegmentRange	Gets the number of segments in the range

Segments	Gets the number of segments in the segment collection

SelectionInfo	Gets the number of objects

SeparationPlates	property Count

ShapeRange	Gets the number of shapes in the range

Shapes	Gets the number of shapes in the collection

SnapPoints	Gets the number of points in the point collection

Subpaths	Gets the number of subpaths in the subpath collection

SystemPrinters	property Count

TextCharacters	Gets the number of characters in the collection, including paragraph breaks

TextColumns	Gets the number of items in the collection

TextFrames	Gets the number of items in the collection

TextLines	Gets the number of items in the collection

TextParagraphs	Gets the number of items in the collection

TextureFillProperties	Gets the Number of Properties in the collection

TextWords	Gets the number of items in the collection

TrapLayers	property Count

Views	Gets the number of items in the collection of views

Windows	Gets the number of items in the collection of windows

Workspaces	Gets the number of items in the collection of workspaces


CropMarks Property

Select one of the available subtopics below to see detailed help about the CropMarks property.

Object	Description of property

PDFVBASettings

PrintPrepress	property CropMarks


CustomData Property

Select one of the available subtopics below to see detailed help about the CustomData property.

Object	Description of property

StructImportCropOptions

StructImportOptions

StructImportResampleOptions


Default Property

Select one of the available subtopics below to see detailed help about the Default property.

Object	Description of property

Printer	property Default

SystemPrinters	property Default

Workspace	Gets the workspace's default state


Description Property

Select one of the available subtopics below to see detailed help about the Description property.

Object	Description of property

Printer	Description of property

Workspace	Gets the workspace's description


Document Property

Select one of the available subtopics below to see detailed help about the Document property.

Object	Description of property

PageSize	Gets the document to which the object belongs

Window	Gets the window document


Documents Property

Select one of the available subtopics below to see detailed help about the Documents property.

Object	Description of property

Application	Gets the collection of documents open in the application

PrintJob	property Documents


DownsampleColor Property

Select one of the available subtopics below to see detailed help about the DownsampleColor property.

Object	Description of property

PDFVBASettings

PrintOptions	property DownsampleColor


DownsampleGray Property

Select one of the available subtopics below to see detailed help about the DownsampleGray property.

Object	Description of property

PDFVBASettings

PrintOptions	property DownsampleGray


DownsampleMono Property

Select one of the available subtopics below to see detailed help about the DownsampleMono property.

Object	Description of property

PDFVBASettings

PrintOptions	property DownsampleMono


DpiX Property

Select one of the available subtopics below to see detailed help about the DpiX property.

Object	Description of property

StructImportCropOptions

StructImportResampleOptions


DpiY Property

Select one of the available subtopics below to see detailed help about the DpiY property.

Object	Description of property

StructImportCropOptions

StructImportResampleOptions


EdgePad Property

Select one of the available subtopics below to see detailed help about the EdgePad property.

Object	Description of property

FountainFill	Gets or sets a fountain fill's edge pad

StructFountainFillProperties


Effects Property

Select one of the available subtopics below to see detailed help about the Effects property.

Object	Description of property

EffectControlPath	Gets a collection of effects of type Blend and TextOnPath

ExtrudeVanishingPoint	Gets the collection of extrude objects sharing the same vanishing point

Shape	Gets collection of effects applied to object


Empty Property

Select one of the available subtopics below to see detailed help about the Empty property.

Object	Description of property

Clipboard	Checks if the clipboard has content

TextFrame	Returns True if the text frame is empty


Enabled Property

Select one of the available subtopics below to see detailed help about the Enabled property.

Object	Description of property

CommandBar	Gets/sets the enabled status of the control

PrintSeparations	property Enabled

PrintTrapping	property Enabled

SeparationPlate	property Enabled


End Property

Select one of the available subtopics below to see detailed help about the End property.

Object	Description of property

TextRange	Ending character position of the range in the text stream

Transparency	Gets or sets the end value of the transparency


EndNode Property

Select one of the available subtopics below to see detailed help about the EndNode property.

Object	Description of property

Segment	Gets the end node

SubPath	Gets the end node


EndPoint Property

Select one of the available subtopics below to see detailed help about the EndPoint property.

Object	Description of property

Connector	Gets or sets the End Point

EffectBlend	Gets or sets the ending mapped node


ExtrudeGroup Property

Select one of the available subtopics below to see detailed help about the ExtrudeGroup property.

Object	Description of property

EffectExtrude	Gets the extrude group

SelectionInfo	Gets the selected extrude group


FileName Property

Select one of the available subtopics below to see detailed help about the FileName property.

Object	Description of property

CorelScriptFile	Gets the Corel SCRIPT file name

Document	File Name

Palette	Gets the filename of the palette

PrintSettings	property FileName

StructImportCropOptions

StructImportResampleOptions


FilePath Property

Select one of the available subtopics below to see detailed help about the FilePath property.

Object	Description of property

Document	File Path

PatternFill	Gets the FilePath


Fill Property

Select one of the available subtopics below to see detailed help about the Fill property.

Object	Description of property

Shape	Gets or sets the fill properties

StructFontProperties

TextRange	Gets the fill


FillColor Property

Select one of the available subtopics below to see detailed help about the FillColor property.

Object	Description of property

EffectContour	Gets or sets the contour fill color

EffectLens	Gets or sets the lens fill color


Filter Property

Select one of the available subtopics below to see detailed help about the Filter property.

Object	Description of property

AddinHook

StructSaveAsOptions


FilterID Property

Select one of the available subtopics below to see detailed help about the FilterID property.

Object	Description of property

StructImportCropOptions

StructImportResampleOptions


First Property

Select one of the available subtopics below to see detailed help about the First property.

Object	Description of property

TextCharacters	Returns a TextRange containing the first character in the collection

TextColumns	Returns a TextRange containing the first column in the collection

TextFrames	Returns a TextRange containing the last frame in the collection

TextLines	Returns a TextRange containing the first line in the collection

TextParagraphs	Returns a TextRange containing the first paragraph in the collection

TextWords	Returns a TextRange containing the first word in the collection


FirstLineIndent Property

Select one of the available subtopics below to see detailed help about the FirstLineIndent property.

Object	Description of property

StructAlignProperties

TextRange	Gets/sets the amount that the first line is indented


Fountain Property

Select one of the available subtopics below to see detailed help about the Fountain property.

Object	Description of property

Fill	Gets or sets Fountain properties

Transparency	Gets or sets the fountain fill properties of the transparency


FountainSteps Property

Select one of the available subtopics below to see detailed help about the FountainSteps property.

Object	Description of property

PDFVBASettings

PrintOptions	property FountainSteps


Frames Property

Select one of the available subtopics below to see detailed help about the Frames property.

Object	Description of property

Text	Collection of all frames in the text range

TextRange	Collection of text frames in the range


Frequency Property

Select one of the available subtopics below to see detailed help about the Frequency property.

Object	Description of property

EffectZipperDistortion	Gets or sets the frequency of the Zipper distortion

SeparationPlate	property Frequency


FromColor Property

Select one of the available subtopics below to see detailed help about the FromColor property.

Object	Description of property

EffectLens	Gets or sets the starting color for custom color map lens

StructFountainFillProperties


Frozen Property

Select one of the available subtopics below to see detailed help about the Frozen property.

Object	Description of property

EffectLens	Gets whether or not the lens is frozen

Transparency	Gets whether or not the transparency is frozen


GrayResolution Property

Select one of the available subtopics below to see detailed help about the GrayResolution property.

Object	Description of property

PDFVBASettings

PrintOptions	property GrayResolution


Handle Property

Select one of the available subtopics below to see detailed help about the Handle property.

Object	Description of property

AppWindow	Gets the window handle

Window	Gets the window handle for the document window


HasDialog Property

Select one of the available subtopics below to see detailed help about the HasDialog property.

Object	Description of property

ExportFilter

ImportFilter


Height Property

Select one of the available subtopics below to see detailed help about the Height property.

Object	Description of property

AppWindow	Gets or sets the application's window height

CommandBar	Gets the height of the control

CommandBarControl	Gets/sets the height of the control

PageSize	Gets the height of the page

PatternCanvas	Gets or sets the Height

StructImportCropOptions

StructImportResampleOptions

Window	Gets or sets the window's height


Index Property

Select one of the available subtopics below to see detailed help about the Index property.

Object	Description of property

AddinHook

ArrowHead	ArrowHead Index

CommandBar	Gets/sets the index of the control in it's collection

DataField	Gets Index

Document	Gets the page index

Layer	Gets the index within the Layers collection

Node	Gets the index of the node within its subpath

OutlineStyle	Gets the index

Page	Gets the page number

PageSize	Gets the index of the paper type

PatternCanvas	Gets the Index

PostScriptFill	Gets the PostScript Fill's Index

Properties	Index of the property

RecentFile	Gets the recent file's position in the Recent File list

Segment	Gets the index of the segment within its subpath

SubPath	Gets the index of the subpath within its curve

TextFrame	Gets the index of the text frame

Window	Gets the index into the windows collection


Item Property

Select one of the available subtopics below to see detailed help about the Item property.

Object	Description of property

ArrowHeads	Gets a reference to the specified arrow head, in base 1

Colors	Gets a reference to the specified color, in base 1

CommandBarControls	Gets the item in the collection at the specified index

CommandBarModes	Gets the item in the collection at the specified index

CommandBars	Gets the item in the collection at the specified index

CrossPoints	Gets a reference to the specified CrossPoint, in base 1

DataFields	Gets a reference to a specified DataField, in base 1

DataItems	Gets a reference to a specified dataitem, in base 1

Documents	Gets a reference to a specified document, in base 1

Effects	Gets a reference to the effect specified, in base 1

FontList	Gets a reference to a specified font, in base 1

FountainColors	Gets or sets a reference to the specified FountainColor, in base 1

Layers	Gets a reference to the layer specified, in base 1

NodeRange	Gets a reference to the specified node, in base 1

Nodes	Gets a reference to the specified node, in base 1

OutlineStyles	Gets a reference to the specified outlinestyle, in base 1

Pages	Gets a reference to the specified page, in base 1; however, using 0 brings you the Master Page

PageSizes	Gets the PageSize object

Palettes	Gets a reference to a specified palette, in base 1

PatternCanvases	Gets or sets a reference to the specified PatternCanvas, in base 1

Properties	Gets or sets an Item

RecentFiles	Gets a reference to a specified window, in base 1

SegmentRange	Gets a reference to the specified segment, in base 1

Segments	Gets a reference to the specified segment, in base 1

SeparationPlates	property Item

ShapeRange	Gets a reference to the shape specified, in base 1

Shapes	Gets a reference to the shape specified, in base 1

SnapPoints	Gets a reference to the specified point, in base 1

Subpaths	Gets a reference to the specified node, in base 1

SystemPrinters	property Item

TextCharacters	Returns a TextRange containing the specified characters

TextColumns	Gets a reference to the specified word, in base 1

TextFrames	Gets a reference to the specified word, in base 1

TextLines	Returns a TextRange containing the specified line(s)

TextParagraphs	Returns a TextRange containing the specified paragraph(s)

TextureFillProperties	Gets a reference to a Texture Property, in base 1

TextWords	Gets a reference to the specified word, in base 1

TrapLayers	property Item

Views	Gets a reference to a specified view, in base 1

Windows	Gets a reference to a specified window, in base 1

Workspaces	Gets a reference to a specified workspace, in base 1


Keywords Property

Select one of the available subtopics below to see detailed help about the Keywords property.

Object	Description of property

Document	Gets or sets document keywords

PDFVBASettings


Last Property

Select one of the available subtopics below to see detailed help about the Last property.

Object	Description of property

TextCharacters	Returns a TextRange containing the last character in the collection

TextColumns	Returns a TextRange containing the last column in the collection

TextFrames	Returns a TextRange containing the first frame in the collection

TextLines	Returns a TextRange containing the last line in the collection

TextParagraphs	Returns a TextRange containing the last paragraph in the collection

TextWords	Returns a TextRange containing the last word in the collection


Layers Property

Select one of the available subtopics below to see detailed help about the Layers property.

Object	Description of property

Page	Gets the collection of layers on the page

PrintTrapping	property Layers


Left Property

Select one of the available subtopics below to see detailed help about the Left property.

Object	Description of property

AppWindow	Gets or sets the application's window left position

CommandBar	Gets/sets the screen position of the control's left-most edge

StructImportCropOptions

Window	Gets or sets the window's left value


LeftIndent Property

Select one of the available subtopics below to see detailed help about the LeftIndent property.

Object	Description of property

StructAlignProperties

TextRange	Gets/sets the amount by which the text has been left-indented


Length Property

Select one of the available subtopics below to see detailed help about the Length property.

Object	Description of property

Curve	Gets the length of the curve

Segment	Gets the length of the segment (in the document's units)

SegmentRange	Gets the total length of the segments within the range

SubPath	Gets the length of the subpath (in document's units)

TextRange	The length of the range in characters


LineSpacing Property

Select one of the available subtopics below to see detailed help about the LineSpacing property.

Object	Description of property

StructSpaceProperties

TextRange	Gets/sets the line spacing property


LineSpacingType Property

Select one of the available subtopics below to see detailed help about the LineSpacingType property.

Object	Description of property

StructSpaceProperties

TextRange	Gets/sets the type of line spacing to use


LinkAcceleration Property

Select one of the available subtopics below to see detailed help about the LinkAcceleration property.

Object	Description of property

EffectBlend	Gets or sets whether or not the link accelerates along the path

EffectContour	Gets or sets the Link Acceleration


MainMenu Property

Select one of the available subtopics below to see detailed help about the MainMenu property.

Object	Description of property

Application	Gets the main menu

FrameWork	Gets the main menu of the application


MaintainLayers Property

Select one of the available subtopics below to see detailed help about the MaintainLayers property.

Object	Description of property

StructExportOptions

StructImportOptions


MaintainOPILinks Property

Select one of the available subtopics below to see detailed help about the MaintainOPILinks property.

Object	Description of property

PDFVBASettings

PrintPostScript	property MaintainOPILinks


MaxWordSpacing Property

Select one of the available subtopics below to see detailed help about the MaxWordSpacing property.

Object	Description of property

StructAlignProperties

TextRange	Gets/sets the maximum amount of space between each word


MidPoint Property

Select one of the available subtopics below to see detailed help about the MidPoint property.

Object	Description of property

FountainFill	Gets or sets a fountain fill's midpoint position

StructFountainFillProperties


MinWordSpacing Property

Select one of the available subtopics below to see detailed help about the MinWordSpacing property.

Object	Description of property

StructAlignProperties

TextRange	Gets/sets the minimum amount of space between each word


MirrorFill Property

Select one of the available subtopics below to see detailed help about the MirrorFill property.

Object	Description of property

PatternFill	Gets or sets Mirror Fill

TextureFill	Gets or sets Mirror Fill


Mode Property

Select one of the available subtopics below to see detailed help about the Mode property.

Object	Description of property

Bitmap	Gets the color mode of the bitmap

EffectBlend	Gets or sets the blend mode of cdrBlendMode type

EffectEnvelope	Gets or sets the mode of type cdrEnvelopeMode for the envelope

StructImportOptions


MonoResolution Property

Select one of the available subtopics below to see detailed help about the MonoResolution property.

Object	Description of property

PDFVBASettings

PrintOptions	property MonoResolution


Name Property

Select one of the available subtopics below to see detailed help about the Name property.

Object	Description of property

Color	Gets color name

CommandBar	Gets/sets the name of the control

CommandBarMode	Gets/sets the name of the control

CorelScriptFile	Gets or sets a friendly name for the script; will be used as a macro name if the script is translated to VBA

DataField	Gets or sets the datafield Name

Document	Gets or sets the document's name

FrameWork	Gets/sets the name of the control

Layer	Gets or sets the layer name

Page	Gets or sets the page's name

PageSize	Gets the name of the paper type

Palette	Gets or sets the color palette name; palette name can only be set if it is a custom palette

PostScriptFill	Gets the PostScript Fill's Name

Printer	property Name

RecentFile	Gets or sets the recent file's name

Shape	Gets or sets a shape's name

StructFontProperties

TextureFillProperty	Gets the Name of the Property

View	Gets or sets the name of the view

Workspace	Gets the workspace's name


NameLocal Property

Select one of the available subtopics below to see detailed help about the NameLocal property.

Object	Description of property

CommandBar	Gets/sets the localized name of the control

CommandBarMode	Gets/sets the localized name of the control


Next Property

Select one of the available subtopics below to see detailed help about the Next property.

Object	Description of property

Shape	Gets the next shape

TextFrame	Returns the next text frame, if any

Window	Gets the next window


Nodes Property

Select one of the available subtopics below to see detailed help about the Nodes property.

Object	Description of property

Curve	Gets the collection of nodes within the curve

SubPath	Gets the collection of nodes within the subpath


Offset Property

Select one of the available subtopics below to see detailed help about the Offset property.

Object	Description of property

CrossPoint	CrossPoint Offset from the object's first node

EffectContour	Gets or sets the contour offset

EffectTextOnPath	Gets or sets the text offset from path


Orientation Property

Select one of the available subtopics below to see detailed help about the Orientation property.

Object	Description of property

EffectTextOnPath	Gets or sets the text orientation of type cdrFittedOrientation

Page	Gets or sets the page's orientation


OriginX Property

Select one of the available subtopics below to see detailed help about the OriginX property.

Object	Description of property

ActiveView	Gets or sets the origin x of the active view

EffectDistortion	Gets or sets the X-value of the origin

PatternFill	Gets or sets the horizontal Origin

TextureFill	Gets or sets the horizontal Origin

View	Gets or sets the origin x of the view


OriginY Property

Select one of the available subtopics below to see detailed help about the OriginY property.

Object	Description of property

ActiveView	Gets or sets the origin y of the active view

EffectDistortion	Gets or sets the Y-value of the origin

PatternFill	Gets or sets the vertical Origin

TextureFill	Gets or sets the vertical Origin

View	Gets or sets the origin y of the view


Outline Property

Select one of the available subtopics below to see detailed help about the Outline property.

Object	Description of property

Shape	Allows users to access the outline properties

StructFontProperties

TextRange	Gets the outline


OutlineColor Property

Select one of the available subtopics below to see detailed help about the OutlineColor property.

Object	Description of property

EffectContour	Gets or sets the contour outline color

EffectLens	Gets or sets the lens outline color


Overscore Property

Select one of the available subtopics below to see detailed help about the Overscore property.

Object	Description of property

StructFontProperties

TextRange	Gets/sets the Overscore property of the range


Overwrite Property

Select one of the available subtopics below to see detailed help about the Overwrite property.

Object	Description of property

StructExportOptions

StructSaveAsOptions


Page Property

Select one of the available subtopics below to see detailed help about the Page property.

Object	Description of property

View	Gets or sets the page of the view

Window	Gets the active page for that window


PageRange Property

Select one of the available subtopics below to see detailed help about the PageRange property.

Object	Description of property

PDFVBASettings

PrintSettings	property PageRange


Pages Property

Select one of the available subtopics below to see detailed help about the Pages property.

Object	Description of property

Document	Returns a collection of pages for the document

PrintJob	property Pages


PaletteID Property

Select one of the available subtopics below to see detailed help about the PaletteID property.

Object	Description of property

Color	Gets the Fixed Palette Color's ID

Palette	Gets the palette ID


Parent Property

Select one of the available subtopics below to see detailed help about the Parent property.

Object	Description of property

ActiveView	Gets the parent of which this object is a child

AddinHook

AddIns

Application	Gets the application to which the object belongs

AppWindow	Gets the parent of which the object is a child

ArrowHeads	Gets the parent of which the arrowhead collection is a child

Clipboard	Gets the parent of which this object is a child

CloneLink	Gets the parent of which this object is a child

Color	Gets the parent of which this object is a child

Colors	Gets the parent of which the color collection is a child; if the color object is not from a palette the color parent is null

CorelScriptFile	Gets the parent of which the object is a child

DataField	Gets the parent of which this object is a child

DataFields	Gets the parent of which this object is a child

DataItem	Gets the parent of which this object is a child

DataItems	Gets the parent of which this object is a child

Document	Gets the parent object of which the document object is a child

Documents	Gets the parent of which the document collection is a child

Effect	Gets the parent of which this object is a child

EffectArtistic	Gets the parent of which this object is a child

EffectBlend	Gets the application to which the object belongs

EffectContour	Gets the parent of which this object is a child

EffectControlPath	Gets the parent of which this object is a child

EffectDistortion	Gets the parent of which this object is a child

EffectDropShadow	Gets the parent of which this object is a child

EffectEnvelope	Gets the parent of which this object is a child

EffectExtrude	Gets the parent of which this object is a child

EffectLens	Gets the parent of which this object is a child

EffectPerspective	Gets the parent of which this object is a child

EffectPushPullDistortion	Gets the parent of which this object is a child

Effects	Gets the parent of which this object is a child

EffectTextOnPath	Gets the parent of which this object is a child

EffectTwisterDistortion	Gets the parent of which this object is a child

EffectZipperDistortion	Gets the parent of which this object is a child

ExtrudeVanishingPoint	Gets the parent of which this object is a child

FontList	Gets the parent of which the font list is a child

Grid	Gets the parent of which this object is a child

Layer	Gets the parent object of the layer

Layers	Gets the parent of which the layer collection is a child

Node	Gets the node collection parent

NodeRange	Gets the parent shape

Nodes	Gets the parent (shape or subpath)

OutlineStyles	Gets the parent of which the outlinestyle collection is a child

Page	Gets the parent of which this object is a child

Pages	Gets the parent of which the page collection is a child

PageSize	Gets the parent of which this object is a child

PageSizes	Gets the parent of which this object is a child

Palette	Gets the parent of which this object is a child

Palettes	Gets the parent of which the palette collection is a child

PowerClip	Gets the parent of which this object is a child

RecentFile	Gets the parent of which this object is a child

RecentFiles	Gets the parent of which this object is a child

Rulers	Gets the parent of which this object is a child

Segment	Gets the segment collection parent

SegmentRange	Gets the parent shape

Segments	Gets the parent subpath

SelectionInfo	Gets the parent of which this object is a child

Shape	Gets the parent of which the object is a child: if the shape is a Selection Shape it will be a document, otherwise it will be a layer

ShapeRange	Gets the parent of which the shape range is a child

Shapes	Gets the parent of which the shape collection is a child

SnapPoint	Gets the shape parent

SnapPoints	Gets the shape parent

SubPath	Gets the subpath collection parent

Subpaths	Gets the parent shape

Transparency	Gets the parent of which this object is a child

View	Gets the parent of which this object is a child

Views	Gets the parent of which this object is a child

Window	Gets the parent of which this object is a child

Windows	Gets the parent of which the window collection is a child

Workspace	Gets the parent of which this object is a child

Workspaces	Gets the parent of which the workspace collection is a child


Path Property

Select one of the available subtopics below to see detailed help about the Path property.

Object	Description of property

Application	Gets the full path of the 'Draw' directory

EffectBlend	Gets or sets the blend path

EffectTextOnPath	Gets or sets the path object

RecentFile	Gets or sets the recent file's path

TextFrame	Returns a reference to the text's path, if the text is fitted to a path


Pattern Property

Select one of the available subtopics below to see detailed help about the Pattern property.

Object	Description of property

Fill	Gets or sets Pattern properties

Transparency	Gets or sets the pattern fill properties of the transparency


Position Property

Select one of the available subtopics below to see detailed help about the Position property.

Object	Description of property

CommandBar	Gets/sets the cuiBarPosition of the bar

FountainColor	Gets the Position

StructFontProperties

TextRange	Gets/sets the font position


PositionX Property

Select one of the available subtopics below to see detailed help about the PositionX property.

Object	Description of property

CrossPoint	CrossPoint X coordinate

ExtrudeVanishingPoint	Gets or sets the vanishing point X position

Node	Gets or sets the horizontal position (X) of the node on the page, according to the document's reference point

NodeRange	Gets the X position of the leftmost node within the range

Shape	Gets or sets the horizontal position (X) of the shape on the page, according to the document's reference point

ShapeRange	Gets or sets the horizontal position (X) of the shape on the page, according to the document's reference point

SnapPoint	Gets or sets the Point's X coordinate

SubPath	Gets or sets the X position of the subpath's head

Type	Description of property

CurveElement


PositionY Property

Select one of the available subtopics below to see detailed help about the PositionY property.

Object	Description of property

CrossPoint	CrossPoint Y coordinate

ExtrudeVanishingPoint	Gets or sets the vanishing point Y position

Node	Gets or sets the vertical position (Y) of the node on the page, according to the document's reference point

NodeRange	Gets the Y position of the topmost node within the range

Shape	Gets or sets the vertical position (Y) of the shape on the page, according to the document's reference point

ShapeRange	Gets or sets the vertical position (Y) of the shape on the page, according to the document's reference point

SnapPoint	Gets or sets the Point's Y coordinate

SubPath	Gets or sets the Y position of the subpath's head

Type	Description of property

CurveElement


PostScript Property

Select one of the available subtopics below to see detailed help about the PostScript property.

Object	Description of property

Fill	Gets or sets PostScript properties

PrintSettings	property PostScript


Previous Property

Select one of the available subtopics below to see detailed help about the Previous property.

Object	Description of property

Shape	Gets the previous shape

TextFrame	Returns the previous text frame, if any

Window	Gets the previous window


Properties Property

Select one of the available subtopics below to see detailed help about the Properties property.

Object	Description of property

Document	Gets Properties

Layer	Gets Properties

Page	Gets Properties

PostScriptFill	Gets or sets PostScript Fill Properties

Shape	Gets Properties

TextureFill	Gets Texture Fill properties


Range Property

Select one of the available subtopics below to see detailed help about the Range property.

Object	Description of property

StructSaveAsOptions

TextFrame	Returns a TextRange containing the text in the frame

TextFrames	Returns a TextRange containing the specified frame(s)


RegistrationMarks Property

Select one of the available subtopics below to see detailed help about the RegistrationMarks property.

Object	Description of property

PDFVBASettings

PrintPrepress	property RegistrationMarks


Resolution Property

Select one of the available subtopics below to see detailed help about the Resolution property.

Object	Description of property

Document	Gets or sets the Document's Resolution in dots per inch

Page	Gets or sets the page's resolution in dots per inch (dpi)

PrintSeparations	property Resolution

TextureFill	Gets or sets Resolution


ResolutionX Property

Select one of the available subtopics below to see detailed help about the ResolutionX property.

Object	Description of property

Bitmap	Gets the bitmap's resolution (X)

StructExportOptions


ResolutionY Property

Select one of the available subtopics below to see detailed help about the ResolutionY property.

Object	Description of property

Bitmap	Gets the bitmap's resolution (Y)

StructExportOptions


RightIndent Property

Select one of the available subtopics below to see detailed help about the RightIndent property.

Object	Description of property

StructAlignProperties

TextRange	Gets/sets the amount by which the text has been right-indented


RotationAngle Property

Select one of the available subtopics below to see detailed help about the RotationAngle property.

Object	Description of property

PatternFill	Gets or sets the Rotation angle

Shape	Gets or sets the rotation angle of the shape on the page

TextureFill	Gets or sets the Rotation angle


RotationCenterX Property

Select one of the available subtopics below to see detailed help about the RotationCenterX property.

Object	Description of property

Shape	Gets or sets the horizontal center of rotation (X) for the shape on the page

ShapeRange	Gets or sets the horizontal center of rotation (X) for the shape on the page


RotationCenterY Property

Select one of the available subtopics below to see detailed help about the RotationCenterY property.

Object	Description of property

Shape	Gets or sets the vertical center of rotation (Y) for the shape on the page

ShapeRange	Gets or sets the vertical center of rotation (Y) for the shape on the page


Segments Property

Select one of the available subtopics below to see detailed help about the Segments property.

Object	Description of property

Curve	Gets the collection of segments within the curve

SubPath	Gets the collection of segments within the subpath


Shapes Property

Select one of the available subtopics below to see detailed help about the Shapes property.

Object	Description of property

EffectLens	Gets the subshapes of frozen lens group

Layer	Gets a collection of shapes on the layer

Page	Gets the collection of shapes on the page, across all layers

PowerClip	Gets the shapes in the powerclip

Shape	Gets a collection of shapes


Size Property

Select one of the available subtopics below to see detailed help about the Size property.

Object	Description of property

PatternCanvas	Gets or sets the Size

StructFontProperties

TextRange	Gets/sets the font size


SizeHeight Property

Select one of the available subtopics below to see detailed help about the SizeHeight property.

Object	Description of property

Bitmap	Gets the bitmap's vertical size (height)

NodeRange	Gets the height between the upmost & downmost node

Page	Gets or sets the page height size

Shape	Gets or sets the height of the shape on the page

ShapeRange	Gets or sets the height of the shape on the page

SubPath	Gets the height of the whole subpath (in document's units)


SizeWidth Property

Select one of the available subtopics below to see detailed help about the SizeWidth property.

Object	Description of property

Bitmap	Gets the bitmap's horizontal size (width)

NodeRange	Gets the width between the leftmost & rightmost node within the range

Page	Gets or sets the page width size

Shape	Gets or sets the width of the shape on the page

ShapeRange	Gets or sets the width of the shape on the page

SubPath	Gets the width of the whole subpath (in document's units)


SkewAngle Property

Select one of the available subtopics below to see detailed help about the SkewAngle property.

Object	Description of property

PatternFill	Gets or sets the Skew angle

TextureFill	Gets or sets the Skew angle


SpacingAcceleration Property

Select one of the available subtopics below to see detailed help about the SpacingAcceleration property.

Object	Description of property

EffectBlend	Gets or sets whether or not the spacing accelerates along the path

EffectContour	Gets or sets the Spacing Acceleration


Start Property

Select one of the available subtopics below to see detailed help about the Start property.

Object	Description of property

TextRange	Starting character position of the range in the text stream

Transparency	Gets or sets the start value of the transparency


StartNode Property

Select one of the available subtopics below to see detailed help about the StartNode property.

Object	Description of property

Segment	Gets the start node

SubPath	Gets the start node


StartPoint Property

Select one of the available subtopics below to see detailed help about the StartPoint property.

Object	Description of property

Connector	Gets or sets the Start Point

EffectBlend	Gets or sets the starting mapped node


StatusBar Property

Select one of the available subtopics below to see detailed help about the StatusBar property.

Object	Description of property

Application	Gets the status bar

FrameWork	Gets the main statusbar of the application


Steps Property

Select one of the available subtopics below to see detailed help about the Steps property.

Object	Description of property

EffectBlend	Gets or sets the number of steps in the blend

EffectContour	Gets or sets the number of steps in the contour

FountainFill	Gets or sets a fountain fill's steps

StructFountainFillProperties


Strikethru Property

Select one of the available subtopics below to see detailed help about the Strikethru property.

Object	Description of property

StructFontProperties

TextRange	Gets/sets the StrikeThru property of the range


Style Property

Select one of the available subtopics below to see detailed help about the Style property.

Object	Description of property

Outline	Gets or sets an outline's style

StructFontProperties

TextRange	Gets/sets the font style of the range


SubPath Property

Select one of the available subtopics below to see detailed help about the SubPath property.

Object	Description of property

Node	Gets the subpath which holds this node

Segment	Gets the subpath to which the segment belongs


SubPathIndex Property

Select one of the available subtopics below to see detailed help about the SubPathIndex property.

Object	Description of property

Node	Gets the index of the node's subpath within the curve

Segment	Gets the index of the segment's subpath within the curve


Text Property

Select one of the available subtopics below to see detailed help about the Text property.

Object	Description of property

EffectTextOnPath	Gets or sets the text object

Shape	Allows users to access the text properties

TextRange	Text string in the range


Texture Property

Select one of the available subtopics below to see detailed help about the Texture property.

Object	Description of property

Fill	Gets or sets Texture properties

Transparency	Gets or sets the texture fill properties of the transparency


TileHeight Property

Select one of the available subtopics below to see detailed help about the TileHeight property.

Object	Description of property

PatternFill	Gets or sets the Tile Height

TextureFill	Gets or sets the Tile Height


TileOffset Property

Select one of the available subtopics below to see detailed help about the TileOffset property.

Object	Description of property

PatternFill	Gets or sets the Tile offset

TextureFill	Gets or sets the Tile offset


TileOffsetType Property

Select one of the available subtopics below to see detailed help about the TileOffsetType property.

Object	Description of property

PatternFill	Gets or sets the Tile offset Type

TextureFill	Gets or sets the Tile offset Type


TileWidth Property

Select one of the available subtopics below to see detailed help about the TileWidth property.

Object	Description of property

PatternFill	Gets or sets the Tile Width

TextureFill	Gets or sets the Tile Width


ToColor Property

Select one of the available subtopics below to see detailed help about the ToColor property.

Object	Description of property

EffectLens	Gets or sets the ending color for custom color map lens

StructFountainFillProperties


Top Property

Select one of the available subtopics below to see detailed help about the Top property.

Object	Description of property

AppWindow	Gets or sets the application's window top position

CommandBar	Gets/sets the screen position of the control's top-most edge

StructImportCropOptions

Window	Gets or sets the window's top value


TransformWithShape Property

Select one of the available subtopics below to see detailed help about the TransformWithShape property.

Object	Description of property

PatternFill	Gets or sets the Transform With Shape value

TextureFill	Gets or sets the Transform With Shape value


Transparent Property

Select one of the available subtopics below to see detailed help about the Transparent property.

Object	Description of property

Bitmap	Returns True if the bitmap is transparent

StructExportOptions


TrueTypeToType1 Property

Select one of the available subtopics below to see detailed help about the TrueTypeToType1 property.

Object	Description of property

PDFVBASettings

PrintPostScript	property TrueTypeToType1


Type Property

Select one of the available subtopics below to see detailed help about the Type property.

Object	Description of property

ActiveView	Gets or sets the type of the active view

Color	Gets color type

CommandBar	Gets the cuiBarType of the bar

Effect	Gets the effect with a cdrEffectType type

EffectDistortion	Gets or sets the type of distortion of cdrDistortionType type

EffectDropShadow	Gets or sets the feather type with a cdrDSType type

EffectExtrude	Gets or sets the extrude type of cdrExtrudeType type

EffectLens	Gets or sets the lens type of cdrLensType type

Ellipse	Gets or sets the type of ellipse

ExtrudeVanishingPoint	Gets or sets the vanishing point type of cdrVPType type

Fill	Gets fill type

FountainFill	Gets or sets a fountain fill's type

Grid	Gets or sets the grid type

Guide	Gets the type of guideline

Node	Gets or sets the node type

NodeRange	Gets the node type, if common within the range

Outline	Gets or sets an outline's type

Palette	Gets whether or not a color palette is custom or fixed

PatternFill	Gets or sets the Type

Polygon	Gets or sets the type of polygon

Printer	property Type

Segment	Gets or sets the segment type

SegmentRange	Gets the segment type, if common within the range

SeparationPlate	property Type

Shape	Gets the shape's type

SnapPoint	Gets the Point Type

StructFountainFillProperties

Text	Gets text type: Artistic or Paragraph

TextureFillProperty	Gets the Type of the Property

Transparency	Gets the transparency type

TrapLayer	property Type


Underline Property

Select one of the available subtopics below to see detailed help about the Underline property.

Object	Description of property

StructFontProperties

TextRange	Gets/sets the Underline property of the range


UseColorProfile Property

Select one of the available subtopics below to see detailed help about the UseColorProfile property.

Object	Description of property

PDFVBASettings

PrintOptions	property UseColorProfile

StructExportOptions


Value Property

Select one of the available subtopics below to see detailed help about the Value property.

Object	Description of property

DataItem	Gets or sets the dataitem Value

TextureFillProperty	Gets or sets the Value of the Property


Version Property

Select one of the available subtopics below to see detailed help about the Version property.

Object	Description of property

Application	Gets a verbose description of the current DRAW version

StructSaveAsOptions


Visible Property

Select one of the available subtopics below to see detailed help about the Visible property.

Object	Description of property

Application	Gets or sets the visibility of the application window; allows you to hide or show the application

CommandBar	Gets/sets the visible status of the control

CommandBarControl	Gets/sets the visible status of the control

Grid	Gets or sets the grid's visibility state

Layer	Gets or sets the layer's visibility state


Width Property

Select one of the available subtopics below to see detailed help about the Width property.

Object	Description of property

AppWindow	Gets or sets the application's window width

CommandBar	Gets the width of the control

CommandBarControl	Gets/sets the width of the control

Outline	Gets or sets an outline's width

PageSize	Gets the width of the page

PatternCanvas	Gets or sets the Width

PrintTrapping	property Width

StructImportCropOptions

StructImportResampleOptions

Window	Gets or sets the window's width


Windows Property

Select one of the available subtopics below to see detailed help about the Windows property.

Object	Description of property

Application	Gets a collection of windows open in the application

Document	Returns a collection of windows for the document


WindowState Property

Select one of the available subtopics below to see detailed help about the WindowState property.

Object	Description of property

AppWindow	Gets or sets the application's window state

Window	Gets or sets the window's state


WordSpacing Property

Select one of the available subtopics below to see detailed help about the WordSpacing property.

Object	Description of property

StructSpaceProperties

TextRange	Gets/sets the amount of space between each word


Zoom Property

Select one of the available subtopics below to see detailed help about the Zoom property.

Object	Description of property

ActiveView	Gets or sets the zoom level of the active view

View	Gets or sets the zoom level of the active view


Contains a CorelDRAW drawing. You can draw anywhere in the Drawing Window, but only objects that appear on the Drawing Page (indicated by a rectangle with a drop shadow) print.


The portion of the Drawing Window that appears on the printed page. This area is enclosed by a rectangle with a shadow effect. Although you can draw anywhere in the Drawing Window, only objects on the Drawing Page appear in your print jobs.


Normal view

These settings control how your drawing appears on your monitor. Normal view shows all fills, all objects, and high-resolution bitmaps.

The view-quality settings have no effect on the size of a drawing, only on how the drawing is displayed on the monitor.

Enhanced view

These settings control the way a drawing is displayed on your monitor. Enhanced view uses 2X over-sampling to ensure the best possible display quality.

The view quality settings have no effect on the size of a drawing, only on how the drawing is displayed on the monitor.

Wireframe view

A view setting that controls the way drawings are displayed on your computer screen. In Wireframe view, objects display in skeleton form without fills or outlines. Because the screen redraws faster in this view, you may want to use it when you edit complex drawings.

The view-quality settings have no effect on the size of a drawing, only on how the drawing is displayed on the monitor.

Simple Wireframe view

These settings control the way drawings are displayed on your monitor. Simple Wireframe view shows objects as outlines, and hides fills, extrusions, contours, and intermediate blend shapes. Simple Wireframe view also shows monochrome bitmaps. Editing a drawing in Simple Wireframe view is faster because only the object outlines need to be refreshed.

The view-quality settings have no effect on the size of a drawing, only on how the drawing is displayed on the monitor.

Draft view

Shows uniform fills and low-resolution bitmaps. This view displays lenses and fountain fills as colors.

Draft view also displays a unique pattern to represent each fill. The checker board pattern represents two color fills. The two-way arrow pattern represents full-color fills. The hatched line pattern represents the bitmap fill. The PS pattern represents the PostScript fill.

The view quality settings have no effect on the size of a drawing, only on how a drawing is displayed on the monitor.


parameter

A parameter is synonymous with argument, a value that is passed to a routine. A parameter defines a characteristic of an object in the visual basic programming environment.


Collection

A collection is a group of objects that have similar characteristics and actions but are uniquely identified by index names or numbers. Collections are always plural (i.e. Arrowheads is a collection of arrowhead objects.)


Any script you create by saving a recording of your CorelDRAW operations is comprised of Corel SCRIPT application commands. Corel SCRIPT application commands instruct CorelDRAW to perform specific actions. For example, a command might instruct CorelDRAW to open or to close a document. The application commands are easy to understand, since most are one-word equivalents of the corresponding Corel application user interface. For example, the .FileNew command creates a new document.

Corel SCRIPT programming statements and functions send instructions or perform actions that are not part of another Corel application. For example, Corel SCRIPT programming statements can be used to display a custom dialog box, include flow control statements and constructs such as loops, create and manipulate variables, and retrieve information about your computer setup. On their own, Corel SCRIPT programming statements form a powerful programming language. A script containing only Corel SCRIPT programming statements can be executed even if another Corel application is not running.


A macro is a collection of automatic tasks performing an action. It is a symbol, name or key that represents a list of commands.


A color model is a system used to organize and define colors according to a set of basic properties that may be reproduced. Black-and-White, Grayscale, RGB, CMYK, and Paletted are examples of popular color modes.


Lab color model

A great deal of color research has been accomplished in order to acquire a color model that is device independent and repeatable. In 1931 La Commision Internationale de L'Eclairage (CIE) defined a device-independent color model, based on how the human eye perceives color. The CIE Lab model incorporates the theory that a color cannot be both green and red at the same time nor can it be yellow and blue at the same time. As such, single values are used to describe the green/red and blue/yellow components of any color. Lab stands for the three values this model uses to define colora lightness value (L) which can range from 0 to 100 and two chromaticity ranges: green to red (a) and blue to yellow (b). The two chromaticity values can range from +120 to -120. Lab (sometimes called L*a*b*) provides a system for defining color that bases color values on widely accepted standards rather than on individual color-producing devices.


RGB color model

The millions of colors your monitor produces can all be described as amounts of red, green, and blue. These three color components form the basis for the RGB (Red, Green, and Blue) color model. Each of the three colors is assigned a numeric value between 0 and 255. An RGB color with the component values (0, 25, 118), for example, contains no red, some green, and more blue, resulting in a slightly greenish blue color.

The RGB model is based on colors of light, and higher RGB values correspond to the presence of greater quantities of white light. Consequently, higher RGB values result in lighter colors. When all three color components are at the maximum value, the resulting color is white light. Because the RGB model creates colors by adding light, it is called an additive color model. Monitors and scanners can employ the additive color model because they emit light. They emit particles of red, green, and blue light and create the illusion of millions of different colors.

One of the limitations of the RGB model is that it is device dependent. This means that not only are there color variations between monitors and scanners by different manufacturers but there are color variations between identical devices from the same manufacturer. All monitors drift over time and display colors differently making it imperative to regularly calibrate your monitor and the other electronic devices you use to create your projects. The RGB model cannot be a color standard because its color results are not 100 percent repeatable.


HSB color model

Without any light or a viewer, objects all around us are colorless. Color only occurs in our minds after our visual sensory system has seen the wavelengths that give objects their color. Based on how people perceive color, the HSB color model defines color in three attributes: hue (H), saturation (S), and brightness (B).

Hue (H) is the name we give a color in everyday language. Hues form the Color Wheel. The hue of a lemon is yellow, that of a strawberry is red. Values range from 0 to 360.

Saturation (S) refers to vividness or color depth (from dull to intense). Saturation is the purity of a color, expressed as the absence of white. A color that has 100% saturation contains no white. A color with 0% saturation is a shade of gray. Values range from 0 to 255. The figurine does not contain very much yellow when compared to the yellow saturation of lemon.

Colors can be separated into light or dark colors when their Brightness (B) is compared. Brightness refers to perceived intensity (lighter or darker color), or the amount of light that is transmitted or reflected from a given pixel. In the HSB color model, brightness is a measure of how much white a color contains. Values range from 0 to 255. A brightness value of 0 produces black and a brightness value of 255 produces white.


CMYK color model

CMYK is a color mode made up of cyan (C), magenta (M), yellow (Y), and black (K). In the CMYK color mode, color values are expressed as percentages, so a value of 100 for an ink means that it is applied at full saturation. Used in most full-color commercial printing, CMYK is like CMY, but the addition of black (K) allows for true blacks and a wider tonal range. The CMYK color mode is based on the CMYK color model.


CMY color model

CMY is a color mode made up of cyan (C), magenta (M), and yellow (Y). This mode is used in the three-color printing process. In Corel applications, the CMY mode is the inverse of the RGB mode, with values ranging from 0 to 255. The CMY color mode is based on the CMY color model.


grayscale color model

The Grayscale color model is a color mode that displays images using 256 shades of gray. Each color is defined as a value between 0 and 255, where 0 is darkest (black) and 255 is lightest (white). In the RGB color mode, a grayscale value corresponds to equal amounts of all RGB colors. In CMYK color mode, a grayscale value corresponds to zero C, M, and Y values, with a positive K value. In HSB color mode, a grayscale value corresponds to zero H and S values, with a positive B value. The Grayscale color mode is based on the Grayscale color model.


HLS color model

The HLS model is a variation of the HSB model and contains three components: hue, lightness, and saturation. Hue determines color (yellow, orange, red, etc.); values range from 0 to 360. Lightness determines perceived intensity (lighter or darker color); values range from 0 to 255. Saturation determines color depth (from dull to intense); it is the purity or vividness of a color, expressed as the absence of white; a color that has 100% saturation contains no white; values range from 0 (0%) to 255 (100%).


YIQ color model

The YIQ color model is a color model used in television broadcast systems (North American video standard - NTSC). Colors are split into a luminance value (Y) and two chromaticity values (I and Q). In monitor calibration, chromaticity refers to the chroma (hue adjustment) of your monitor. On a color monitor, all three components are visible. On a monochrome monitor, only the Y component is visible. All values are scaled from 0 to 255.


black and white color model

The Black and White color model is a 1-bit color mode that stores images as two solid colors - black and white - with no gradations. This color mode is useful for line art and simple graphics.


channel

A channel is an 8-bit grayscale version of your image that functions like a plate used in the commercial printing process: each channel represents one level of color in your image. When all the channels are printed together, they produce the entire range of colors in the image.

For example, an RGB image comprises three channels (red, green, and blue). When all three channels are printed or displayed together, they create the entire range of colors in the image.


layer

A layer is one of a series of transparent planes on which you can place objects in a drawing. You can control how objects in your drawing overlay one another by moving the layer and the objects they contain. You can also lock layers and make them invisible and nonprintable. Use layers to help you organize different components of a complex drawing.

Once active, a layer is ready to receive any new objects you draw, import, or paste onto it.


The Pick tool lets you select and transform objects.


The Eyedropper tool lets you select a fill from an object on the Drawing Window using the mouse.


cdrPanosePrompt=0

cdrPanoseTemporary=1

cdrPanosePermanent=2


A view is a customized way of looking at a drawing in CorelDRAW. You can customize your views to suit your viewing needs. These views can be saved, deleted, edited, and renamed according to your viewing preferences.


window

A window is a container for a drawing in CorelDRAW and is often referred to as a Drawing Window. You can draw anywhere in the window, but only objects that appear on the Drawing Page will print. This area is enclosed by a rectangle with a shadow effect. Although you can draw anywhere in the Drawing Window, only objects on the Drawing Page appear in your print jobs.


workspace

A workspace is an enclosed work environment that is ideally suited to meet specific needs when creating a drawing in CorelDRAW. You can create multiple workspaces for specific users or specific tasks and then apply them when required. You can also delete workspaces when they are no longer needed.


index number

An index number is a reference to any collection that contains more than one object. It is used to identify each object in the collection. The index number can range from 1 to the number of available objects within the collection.


fill

Fills are colors, bitmaps, color gradients, or patterns that are applied to areas of your image. You can change the appearance of an object by using a fill. To fill an object, you apply colors or patterns inside its borders. If you leave an object without a fill or remove its fill, the object is transparent. CorelDRAW includes Uniform fills, Fountain fills, Pattern fills, Texture fills, and PostScript fills. You can apply fills to specific objects or set defaults so that every object you draw has the same fill. You can also customize Fountain fills, Pattern fills, and Texture fills. You can also apply a mesh fill to an object.


fountain fills

cdrLinearFountainFill=1

cdrRadialFountainFill=2

cdrConicalFountainFill=3

cdrSquareFountainFill=4

A fountain fill is a complex fill that displays a progression between two colors that follow a linear, radial, conical, or square path. Fountain fills are also known as gradient or graduated fills. You can create a direct blend from one color to another or a cascade of different colors. You can also use preset fountain fills to create neon tubes, metal cylinders, and other effects.


control point

Control points are points that extend from nodes along curves that are being edited with the Shape tool. Control points determine the angle at which the curve passes through the node. Control points appear when you select a node or segment using the Shape tool.


node

The square points at the end of lines and curve segments. You can change the shape of a line or curve by dragging one or more of its nodes.


nodes

cdrCuspNode=0

A cusp node is a node with control points that move independently from each other. A curve that passes through a cusp node can bend at a sharp angle.

cdrSmoothNode=1

A smooth node is a node with control points that are always opposite each other - when one moves, the other point moves as well. These control points may be different lengths and they produce a smooth transition between segments.

cdrSymmetricalNode=2

A symmetrical node is a node with control points that are always opposite each other, but unlike the smooth node, the control points of symmetrical nodes are always the same length. They produce the same curvature on both sides of the node.

cdrMixedNodes=3

A mixed node is a node with control points that are a combination of cusp nodes, smooth nodes, and symmetrical nodes.


Coordinates

CorelDRAW's VBA programming commands that specify locations on a page use coordinates as parameters. Coordinate values use the set document unit as the base unit of measurement and are expressed as being relative to the center of the current page, which has the coordinates (0,0).

Most CorelDRAW commands that use coordinates, such as the .CreateSubPath command (sets the position of the new subpath's first node), are affected by the application's current reference point, the point on the selected object's bounding box that the coordinates operate on. You can set the current reference point with the .ReferencePoint property.


point position

cdrOutsideShape=0

cdrOnMarginOfShape=1

cdrInsideShape=2


cuiBarType

cuiBarTypeNormal=0

cuiBarTypeMenuBar=1

cuiBarTypePopup=2

cuiBarTypeStatusBar=3

cuiBarTypePropertyBar=4


cuiBarPosition

cuiBarLeft=0

cuiBarTop=1

cuiBarRight=2

cuiBarBottom=3

cuiBarFloating=4


cuiBarProtection

cuiBarNoProtection=0

cuiBarNoCustomize=1

cuiBarNoResize=2

cuiBarNoMove=4

cuiBarNoChangeVisible=8

cuiBarNoChangeDock=16

cuiBarNoVerticalDock=32

cuiBarNoHorizontalDock=64


cuiControlType

cuiControlTypeControl=0

cuiControlTypeButton=1

cuiControlTypeComboBox=2

cuiControlTypePopup=3

cuiControlTypeLabel=4


cuiLabelText=0

cuiLabelImage=1


A file that contains lists of shortcut keys. Shortcut keys are used to speed up, or "accelerate," editing tasks. Different tables are active depending on what you're doing. For example, when you highlight text the Text Editing accelerator table becomes active. If no text is selected, the Main accelerator table is active.


When you using use connector lines, special point on each object, called snap points, are activated. Objects can only be linked by connector lines at snap points, which are generally located at each node and at the center of the object.


offset

Offset refers to a movement out of line with another object. An offset object is distanced from another specified object and this distance is the offset value.


cdrPantone=1

cdrCMYK=2

cdrCMY=4

cdrRGB=5

cdrHSB=6

cdrHLS=7

cdrBlackAndWhite=8

cdrGray=9

cdrColorPantone=1

cdrColorCMYK=2

cdrColorCMY=4

cdrColorRGB=5

cdrColorHSB=6

cdrColorHLS=7

cdrColorBlackAndWhite=8

cdrColorGray=9

cdrColorYIQ=11

cdrColorLab=12

cdrColorPantoneHex=14

cdrColorRegistration=20

cdrColorSpot=25

cdrColorMixed=99


vbCrLf is a VB string constant representing a carriage return-linefeed combination - it has no affect on the functionality of the code.


The clipboard is a temporary storage area that is used to hold cut or copied information. The clipboard is always present in Windows and it stores information until it is replaced by another object or selection that has been cut or copied, or until you quit the current session of Windows.


A data type consisting of a sequence of contiguous characters that represent the characters themselves rather than their numeric values. A String can include letters, numbers, spaces, and punctuation. The String data type can store fixed-length strings ranging in length from 0 to approximately 63K characters and dynamic strings ranging in length from 0 to approximately 2 billion characters. The dollar sign ($) type-declaration character represents a String in Visual Basic.


clone

A clone is a copy of an object or an area of an image that is linked to the original object. Most changes made to the original object (the parent) are automatically applied to its clones.

You can also clone a special effect that is applied to an object and apply it to other objects. Objects with a cloned effect take on all changes that are made to that effect in the parent.


An object that has been copied using the Clone command. Most changes you make to the parent object are automatically applied to the clone.


Corel SCRIPT

Corel SCRIPT is an application included with some Corel applications to record, play, and run recordings and scripts. Corel SCRIPT starts automatically when you record or play a recording from a Corel application that supports scripts. A typical user can take advantage of Corel SCRIPT to automate repetitive tasks with scripts written in the Corel SCRIPT programming language. However, Corel SCRIPT is more than just a language that you can use to create and run application script files; it's also a powerful programming language that can be used as a standalone application.

Corel SCRIPT files are individual packages of Corel SCRIPT programming procedures that perform a specific task when used within the CorelDRAW application.


Shape_Definition
shape

An object that can be displayed as several variations of a rectangle or a circle.


The Drawing Window contains a CorelDRAW drawing. You can draw anywhere in the Drawing Window, but only objects that appear on the Drawing Page (indicated by a rectangle with a drop shadow) print.


document

A document in CorelDRAW is single page drawing or a collection of single-page drawings that make up a multi-page document.

A document page is often referred to as a page. You can access any page in a multi-page document by clicking on a page tab in the Navigator of the Drawing Window. Each page in a multi-page document is accessible through the Navigator, located in the bottom-left corner of the Drawing Window. The Navigator allows you to move through your document quickly and shows the total number of pages in your drawing and the number of the page currently displayed. You can move to a page in your document by clicking that page number in the Navigator.


page

A document page is often referred to as a "page". A page contains all of the objects on a specific drawing page, which is the portion of the Drawing Window that appears on the printed page. This area is enclosed by a rectangle with a shadow effect. Although you can draw anywhere in the Drawing Window, only objects on the Drawing Page appear in your print jobs.

You can access any page in a multi-page document by clicking on a page tab in the Navigator (in the bottom-left corner) of the Drawing Window. Each page in a multi-page document is accessible through the Navigator, located in the bottom-left corner of the Drawing Window. The Navigator allows you to move through your document quickly and shows the total number of pages in your drawing and the number of the page currently displayed. You can move to a page in your document by clicking that page number in the Navigator.


 resolution

Resolution refers to the amount of detail and information that an image file contains, as well as the level of detail that an input, output or display device is capable of producing. When you work with bitmaps, resolution affects the quality of your final output and the file size. The texture fill pattern is treated as a bitmap and its resolution determines the DPI value in the texture fill pattern.


dpi

DPI is a measure of a printer's resolution in dots per inch. Typical desktop laser printers print at 300 dpi. Image setters print at 1270 or 2540 dpi. Printers with higher dpi capabilities produce smoother and cleaner output. The term dpi is also used to measure scanning resolution and to indicate bitmap resolution.


grid

A grid is a series of evenly spaced horizontal and vertical dots that are used to help draw and arrange objects. You can use the controls on the Grid and Ruler Setup dialog box to set the grid's parameters. For greater accuracy, you can also have objects in your illustration snap to the grid when you move, or draw them.


view

A view in CorelDRAW allows you to see your drawing according to your needs. You can use the view controls to change the way CorelDRAW displays objects, to magnify or reduce your view, or to save specific views for future use. You can use the default view name or create a unique name for each view that you create in CorelDRAW.


PowerClip

PowerClip is a feature that lets you place objects (called contents objects) inside other objects (called container objects). If the contents object is larger than the container object, the contents object is automatically cropped. Only the contents that fit inside the container object are visible.

You can create a container from any object you create using CorelDRAW, including shapes, lines, curves, Artistic text, and groups. A contents object can be any object you create using CorelDRAW or import from another program.


more about PowerClip

When you're creating PowerClip object, you may want to compare the container object to a window. Just as a window's frame represents the limits of what you can see, a container object lets you see only the portion of a contents object (or group of objects) that fits inside the container's boundaries. If the size of the contents object exceeds that of its container, CorelDRAW automatically crops the contents object. You see only the portion of the contents object that fits inside the container.

By default, CorelDRAW automatically centers PowerClip contents objects inside their containers. However, you can change the default so that contents objects are offset from the center of the container.

After you create a PowerClip object, you can edit it to change the way the contents and container objects interact.

When you edit the contents object, CorelDRAW temporarily separates the contents and container objects. You can then edit the contents of the PowerClip object, for example, by changing its fill and outline properties, without altering the container object. When you lock or unlock the contents of a PowerClip object, you control the interaction between the contents and container objects. When a contents object is locked to its container object, both objects undergo the same changes. For example, when a PowerClip object is moved, rotated, or resized, both the contents and container objects are affected in the same way. When the contents object is unlocked, it's locked to the page and remains stationary even if you move or rotate its container.

By extracting the contents from a PowerClip object, the container and contents objects return to being separate objects.


anti-aliasing

Anti-aliasing is a method of smoothing the curved and diagonal edges contained in bitmap images. Anti-aliasing partially fills intermediate pixels along those edges to smooth the transition between the edge and the surrounding image. Anti-aliasing reduces or eliminates jagged edges.


event

An event is an action recognized by an object, such as clicking the mouse or pressing a key, and for which you can write code to respond. Events can occur as a result of a user action or program code, or they can be triggered by the system.


curve

A curve object is an object that can be any shape. Curve objects have nodes (the points on a path that determine its shape) and control points (points that extend from nodes to further define a path's shape) that you manipulate to change the object's shape. Curve objects can be drawn with the Freehand tool, Bezier tool, Spiral tool, and Natural Pen tool. You can also convert text and objects drawn with the Rectangle tool, Ellipse tool, and Polygon tool into curve objects by using the Convert To Curves command in the Arrange menu.


ellipse

An ellipse is created with the Ellipse Tool. In its simplest form, an ellipse is a variation of a circular shape object. An ellipse is a closed plane curve generated by a point moving in such a way that the sums of its distances from two fixed points are constant. An ellipse is type of curve object.


effect

An effect is a process of altering or adjusting the appearance of an object in CorelDRAW. The special effects in CorelDRAW let you alter the appearance of objects. You can distort objects, add new elements to objects, and change the relationship between objects.

By blending two objects, you create a series of intermediate objects that show a transition in color, shape, and size. Three distortion effects let you change the shape of objects: Push and pull, Zipper, and Twister. You can also change the shape of an object by applying an envelope to it then shaping the envelope. The object conforms to the shape of the envelope. By extruding an object, CorelDRAW adds surfaces to make it appear three-dimensional. Adding one and two-point perspective lets you create the illusion of depth and distance. You can create the illusion of depth between objects by adding drop shadows. You can apply transparencies, which are grayscale masks, to objects. Transparencies are applied on top of the object's current fill, therefore the object's color show through the transparency. The lenses in CorelDRAW let you change the appearance of objects you view through them. You can contour an object, creating the effect created by contour lines on a topographical map. When you create PowerClip objects, you place an object inside another object. One object becomes the contents; the other object becomes the container.

You can apply effects to both Paragraph text and Artistic text. However, some effects are exclusive to Artistic text and others to Paragraph text because CorelDRAW treats the two text types differently. Effects you can apply to Paragraph text frames include applying envelopes, drop shadows, and PowerClip objects. Effects you can apply to Artistic text include extrusions, blends, contours, distortions, envelopes, lenses, PowerClip objects, perspectives, and drop shadows.


blend

A blend is a special effect that is created by blending one object with another through a progression of shapes and colors.

You can create a number of different blends, including straight-line blends and compound blends, among others. After you've created a blend, you change its intermediate objects. For example, you can set the number of steps and distance between intermediate objects. You can also change the entire blend. For example, you can change the start or end object, split the blend, or change the blend path.

CorelDRAW offers a variety of features for creating interesting blend effects, such as straight-line blends, blending along a path, compound blends, and copying and cloning blends.

Editing blends lets you customize their appearance. You can manipulate a blend's intermediate objects and change its path. You can also work with the individual components of a blend by separating it.

You can edit blends by selecting changing the start and end objects of a blend. By reversing a blend's direction, the blend progresses from the end object to the start object. You can also split blends to create a compound blend or fuse the components of a compound blend to create a single blend. When you split a blend, the object you choose to split the blend becomes the end object for one component in the blend and the start object for the other.

When you blend an object along a path, you can select the path and apply the blend to new path. You can also remove a blend from its path. When you remove a blend from its path, the start and end objects remain stationary and the intermediate objects revert to their original, straight-line path.

You can separate a blend into four possible components: the start object, the end object, the intermediate objects, and the path (if the objects were blended along a path). You can also clear a blend by removing the intermediate objects and leaving the start and end objects.


extrude

Gives two-dimensional objects a three-dimensional (3D) look by creating the illusion of depth. There are two types of extrusions - vector and bitmap.


envelope

An envelope effect is a feature that allows you to distort the shape of an object. Distortion is created by dragging nodes on an imaginary box (the envelope), which in turn distorts the object.


fitting text to a path

Fitting text to a path aligns text objects along the path of a specified shape in CorelDRAW. The text follows the path of the shape object.


drop shadow

A drop shadow effect creates a dark area, in the shape of the object, around the object in CorelDRAW. It is a darker duplication of the object that is slightly offset from the object's original position.


contour

A contour is a special effect created by adding concentric lines inside or outside the borders of an object. These lines use the same shape as the outline of the original object, but they are smaller or larger depending on where they are created.

The spaces between contour lines are filled with colors that follow a progression from the original object to the last shape created. If there is a difference in color between the contour lines and the outline of the original object, a second progression occurs. You can modify both color progressions to get the look you want.


cistortion

A distortion effect is a lack of proportionality in an image that results from defects in the optical system.


lens

Changes the way you perceive objects behind the lens, not the actual properties and attributes of those objects. You can apply lens to almost any closed shape that has been created using the drawing tools.

You can choose amongst several types of lenses, each producing distinctive results. These results range from color alteration (as produced by heat map, inverting, and brightening lenses, for example) to distortion (as produced by magnifying and fish eye lenses).


perspective

Adding perspective to objects creates the illusion of distance and depth, achieved by lengthening or shortening sides of an object. Although objects are two-dimensional, applying one and two-point perspective adds another dimension to your drawing. By creating one-point perspective, you can make an object look like it's receding from view in one direction. By creating two-point perspective, on the other hand, you can make the object look like it's receding from view in two directions.


extrusion

Extrusion is a feature that lets you give objects a three-dimensional (3D) look by creating the illusion of depth. You can change the direction and depth of the extrude, the position of the vanishing point, its placement in 3D space, and its color.

Applying extrusions gives a two-dimensional object the illusion of depth. There are two types of extrusions - vector and bitmap.

For vector extrusions, CorelDRAW projects points from the object and joins them to create extruded surfaces. These surfaces are projected toward a vanishing point, adding depth to the original object so that it appears three-dimensional. However, the vanishing points for Back Parallel and Front Parallel extrusions are infinite, therefore the extruded surfaces can never converge.

After you've created a vector extrusion, you can edit it, apply fills to all or various extruded surfaces, and add light sources to enhance the effect of the extrusion.

You can also apply bitmap extrusions to objects you create in CorelDRAW. Applying bitmap extrusions lets you work with objects in three dimensions. Once you've created a bitmap extrusion, you can apply bevels, Ambient and Point lights, and texture fills.


vanishing point

A vanishing point is a marker that appears when you select an extrusion or an object to which perspective has been added. With an extrusion, the vanishing point marker indicates the depth (parallel extrusion) or the point at which the extruded surfaces would meet if extended (perspective extrusion). With the Perspective effect, the marker indicates the point (or points) at which the nonparallel lines would meet.


bevel

A bevel creates the illusion that an object's edges are cut at an angle other than 90 degrees. You specify the appropriate angle and depth values for the size of the object being cut. The illusion itself is created through the addition of objects on top of the control object (the object you extruded). These objects work together to give the object a three-dimensional look.


envelope

An envelope effect is a feature that allows you to distort the shape of an object. The distortion is created by dragging nodes of an imaginary box, the envelope. You can apply a basic or a preset envelope. You can also copy an envelope from an object in your drawing and apply it to another object.

After you've applied an envelope to an object, you can edit the envelope in a variety of ways you can change its editing mode, apply a new mapping mode, convert envelope segments from lines to curves and vice versa, and edit an envelope's node. You can add, remove, move, or change the shape of envelope nodes.

The editing modes control the shape of the envelope itself. Three of these modes - Straight Line, Single Arc, and Double Arc - let you drag a node or control point horizontally or vertically to change the shape of one side of the envelope. The fourth mode, Unconstrained, lets you drag a node in any direction to make more dramatic changes. In addition, this mode has control points for each node, which let you make precise adjustments to get the exact envelope shape you want.

By applying a new mapping mode, you change how CorelDRAW fits the object to the envelope, not the shape of the envelope itself. There are four mapping modes: Horizontal, Original, Putty, and Vertical. A fifth mode, Text, appears if you're using the envelope to reshape Paragraph text.

As with object segments, envelope segments can be converted from curves to straight lines or from straight lines to curves. By changing the segment's type, you change the way the envelope reacts when it's edited.

When you add nodes to an envelope, you can make minute adjustments to give the envelope a more complex shape. You can simplify the envelope's shape by removing nodes. The most basic method of editing an envelope is to move its nodes. For example, you can move adjacent nodes an equal distance in the same direction.

You can change a node's type, which changes the way the envelope segments on either side pass through the node. Changing the node type changes the shape of the envelope, which in turn changes the effect the envelope has on the object.

By removing an envelope from an object, you return the object to its shape prior to applying the envelope.


EffectTextOnPath

You can position Artistic text along the path of an open object (e.g., a line) or closed object (e.g., a square). Once you've fit text to a path, you can specify the orientation of characters relative to the path. This allows you to create the impression that letters are standing upright. You can also rotate individual characters to follow the contours of the path.

You can also adjust the spacing between the text and path, specify the vertical position and vertical orientation of the text using the characters' baseline, ascender, descender, or center point, specify the horizontal position of text along the path and position text to the opposite side of the path

CorelDRAW treats text fitted to a path as one object. You can also separate the text from its path. When you separate a text from a curved or closed path, the text retains the shape of the object to which it was fitted. Straightening reverts text to its original appearance.


feathering

The level of sharpness along a drop shadow's edges


opaque

The inability to see through an object. If an object is 100% opaque, you cannot see through it. Opacity levels under 100% increase the ability to see through objects.


drop shadow

When you apply a drop shadow to an object, you create a linked group that has an illusion of depth between the objects. The object to which you applied the drop shadow is the control object. Changes you make to the control object are reflected in the drop shadow. For example, if you change the size of the of the control object, the size drop shadow changes to reflect the control object's size. However, you can separate the drop shadow, which is a bitmap, and the control object to make them separate objects.


lens

Changes the appearance of objects and, more significantly, the way you perceive objects behind it. You can apply lenses to any closed-path object you create using CorelDRAW. You can also apply lenses to open-ended lines and curves, such as Paragraph text and Artistic text. Additionally, you can create lenses using objects imported from other applications, such as bitmaps. Once you create a lens you like, you can copy it to other objects in your drawing.

You can choose from the following lens types: Transparency, Magnify, Brighten, Invert, Color Limit, Color Add, Tinted Grayscale, Heat Map, Custom Color Map, Wireframe, and Fish Eye.


custom color map lens

The Custom Color Map lens changes all the colors of objects behind it to a color range between any two colors you select. Areas of the lens that do not cover other objects are filled with the color at the end of the color map.


viewpoint

The viewpoint represents the center point of what is being viewed through the lens. This point is marked by an "X" in the Drawing Window.


perspective

Adding perspective to objects creates the illusion of distance and depth. Although objects are two-dimensional, applying one and two-point perspective adds another dimension to your drawing.

Perspective is created by shortening one or two sides of an object. For one-point perspective, you shorten one side of an object so that it appears to recede in one direction. By shortening two sides, you get two-point perspective in which the object appears to recede in two directions.


contour

Contour refers to a special effect created by adding evenly spaced concentric lines inside or outside the borders of an object. These lines use the same shape as the outline of the original object, but they are smaller or larger depending on where they are created.


distortion

Distortion is a lack of proportionality in an image that results from defects in the optical system.


zipper distortion

Lets you apply a saw tooth effect to the edges of the object. You create a series of points above and below the object's original outline The outline follows these points to create a zipper effect.


twister distortion

Lets you rotate an object to create a swirl effect. The Twister distortion turns an object around a point relative to itself.


push and pull distortion

Forces the object's nodes towards or away from its center.


artistic media

The Artistic Media tool lets you apply various effects to a curve. For example, you can create curves that look like strokes from a calligraphic pen or a pressure-sensitive pen. As well, you can apply text, shapes, or images to a curve using the Artistic Media tool. If you need to change the position or shape of the curve, you can edit the Artistic Media stroke's control path.

The Artistic Media tool has five modes:

Preset mode - draws curves that change thickness based on preset line shapes you can choose from a list box on the Property Bar.

Brush mode - applies text or shapes to the curve when you draw it.

Object sprayer mode - applies a series of images to a curve when you draw it.

Calligraphic mode - draws curves that change thickness based on the direction of the curve. This creates an effect similar to that of a calligraphic pen.

Pressure-sensitive mode - draws curves that change thickness based on feedback from a pressure-sensitive pen or a keyboard.


connector line

A connector line is a straight line that connects two objects in a drawing. Connector lines can be set to remain attached to the nodes you choose or to shift to the closest nodes on the two connected objects. You can reposition a connector line only by moving the objects it is attached to.

When you using use connector lines, special points on each object, called snap points, are activated. When a mouse passes over a snap point, it becomes visible. Objects can only be linked by connector lines at snap points, which are generally located at each node and at the center of the object.

Unlike normal connector lines that are attached to the nodes of objects, a free connector is an unbound connector line that can be unattached on a layer. A free connector line is not attached to any object.


master layer

A master layer is a layer that contains information that you want to appear on every page of a multipage document. For example, you can use a master layer to place a header or footer on every page.


override

You can display the contents of a selected layer as colored outlines. Changing to outlines, using color override, doesn't affect the objects' true appearance; it only affects the way they appear on-screen. This function is useful for identifying objects on different layers - for example, in a complex technical diagram - or even for changing the colors of the grid and guidelines.


stacking order

Stacking order is the sequence in which objects are created in the Image Window. This order determines the vertical order of layers of objects and, therefore, the appearance of your image. The first object you create appears on the bottom; the last object appears on the top. Each of these layers has its own internal stacking order. You can use the Order commands to place the objects where you want them; however, the background object always appears on the bottom and cannot be reordered.

The stacking order is most evident in drawings that contain overlapping objects with contrasting properties. If the objects do not overlap, the stacking order may not be evident. In all cases, however, the stacking order is determined by the order in which you add objects to the drawing. Until you rearrange them, the first object you draw occupies the lowest position, whereas the last object you draw occupies the top position.

You can change the stacking order of objects within any layer, sending them to the front or back, or behind or in front of another object.


filter

The name for an application that translates digital information from one form to another. Import/Export filters convert files from one format to another.


rectangle

A rectangle is a geometric figure with four sides and four right angles, especially with adjacent sides unequal in length.


subpath

A subpath is a curve or shape within a single curve object. A single curve object can consist of more than one curve or shape. Each of these curves or shapes is referred to as a subpath. For example, once converted to a curve, the letter "O" appears as two ellipses. Each of these ellipses is a subpath.


segment

A segment is a line or curve between nodes in a curve object. There are two types of segments: straight and curved. If you click on a node with the Shape tool, the Status Bar displays the type of segment entering the node and the node type itself.


curve

A curve object is a line, curve, or shape created with CorelDRAW's Freehand, Bezier, Artistic Media or Spiral tools. Rectangles. Ellipses, polygons, and text objects may be converted to curve objects by using the ConvertToCurves method of the Shape class.


guideline

A guideline is a line placed anywhere in the CorelDRAW drawing window that is used to help align and position drawing objects. Guidelines are used with the rulers and the grid to draw objects with precision.

Guidelines may be Horizontal, Vertical, or Slanted and any number of them may be created and saved with your drawing.


anchor point

The anchor point is the point that remains stationary when you stretch, scale, mirror, or skew an object. The nine anchor points correspond to the eight handles on the object's Selection box and the center of the Selection box, which is represented by an X.


Object Manager docker window

The Object Manager displays the vertical structure - the stacking order - of objects, layers, and pages in your document. For each object, the Object Manager displays a small icon and a brief description indicating its basic fill and outline properties. You can set the display options for the pages, layers, and objects using the Object Manager.


fill

Fills are colors, bitmaps, color gradients, or patterns that are applied to areas of your image.


bitmap

A bitmap is an image composed of grids of pixels or dots. Scanners and paint applications such as Corel PHOTO-PAINT generate bitmap images. CorelDRAW creates images using vector objects.

Bitmaps have a fixed resolution so a bitmap looks best when you display or print it at its original size. Enlarging the bitmap appears to enlarge each pixel because extra pixels are added, making the graphic look jagged and distorted. Reducing the size of the bitmap eliminates pixels and shrinks the bitmap.


snap point

A coordinate point in CorelDRAW. A snap point is defined by its x and y positions, which are established by the CorelDRAW rulers and the document unit of measurement.

A snap point can be part of a shape object in a document, or it can be a free point within the document. A point is free if it stands alone as a single point and is not part of another object.


combine

When you combine rectangles, ellipses, polygons, stars, spirals, graphs, or text, CorelDRAW converts them to curves before converting them to a single curve object. When text is combined with other text, however, the text objects are not converted to curves; they are converted into larger blocks of text.


weld

Creates a single curve object out of two or more objects. If the objects overlap, the result is a single object with one outline. If the objects don't overlap, they form a weld group in which the objects appear separate but are actually treated as one object.


trim

Creates new, irregularly shaped objects by removing the areas that overlap other selected objects. Before you trim objects, you must decide which object you want to trim (the target object) and which object(s) you want to use to trim it. The objects you use to trim must overlap - or be overlapped by - the target object. You can trim single objects with one or more objects, and you can trim multiple objects with multiple objects.


looping

Lets you rotate a blend halfway between the centers of rotation for the start and end objects.


lock

If locked, no edits can be made to the object.


clonelink

Represents the properties of the actual link between clone and parent objects


parent group

A parent group is a grouping of shape objects that contain other groupings, called child groups, within the parent group.


bounding box

The bounding box is the area that surrounds a shape object in CorelDRAW. The bounding box represents the maximum space a shape object can occupy in CorelDRAW. You can resize the bounding box.


range

A range is series of similar objects in CorelDRAW.


expression

In programming, an expression is any legal combination of symbols that represents a value.


array

A series of objects all of which are the same type. Each object in an array is called an array element. For example, you could have an array of integers or an array of characters or an array of anything that has a defined data type. The important characteristics of an array are as follows:

•	Each element has the same data type (although they may have different values).

•	The entire array is stored contiguously in memory (that is, there are no gaps between elements).

•	Arrays can have more than one dimension. A one-dimensional array is called a vector; a two-dimensional array is called a matrix.


dither

Uses color that is simulated by putting dots of another color very close together. Windows uses dithering to display colors that the graphics adapter cannot display.


postscript fill

Postscript fills are types of pattern fill designed using the PostScript language. Some textures are extremely complicated and require several minutes or more to print or update on the screen. Therefore, PostScript fills are displayed as the letters, PS, rather than as the texture.


outline

An outline is the line that defines the shape of an object. You can change outline attributes, including color, width, size, and shape, using the options in the Outline Tool flyout. When you create an object, CorelDRAW gives it a default outline that is a black solid fill:


font

A font is a complete set of characters that share a common typeface -uppercase and lowercase letters, numbers, punctuation marks, and symbols.


typeface

The unique design of a character set is called its typeface.


style

A style is a set of attributes that controls the appearance of a specific type of object.


A paragraph text frame is the rectangle that contains a block of paragraph text created using the text tool. Paragraph text is used to add large blocks of text for ads, brochures, and other text-intensive projects. CorelDRAW automatically applies the default Paragraph text style.. A text frame may exist alone, or may be linked to other text frames. Linking paragraph text frames directs the flow of text from one frame to the other, if the amount of text exceeds the original frame. When you shrink a frame, enlarge a frame, or change text size, the amount of text in the next frame adjusts automatically. You can remove links or change the direction of flow.


In CorelDRAW, you create Paragraph text with the Text tool. Paragraph text is used to add large blocks of text for ads, brochures, and other text-intensive projects. Paragraph formatting features let you flow text between frames and columns, create bulleted lists, set tabs and indents, and add drop caps. CorelDRAW automatically applies the default Paragraph text style, which you can change using the Styles Manager.


A text character is a single text component. For example, in the text string "CorelDRAW Help", the character count is 14. Even though there are only 13 text characters, the space between "CorelDRAW" and "Help" is counted as a character.


point

A point is a unit of measurement used primarily in typesetting to design type sizes. There are approximately 72 points (pts) to an inch and 12 points to a pica.


Duotone is an 8-bit color mode that displays images using 256 shades of up to four tones. An image in the Duotone color mode is simply a grayscale image that has been enhanced with one to four additional colors. Use the Duotone color mode to add a touch of color to grayscale images or to create interesting effects using tone curve settings. A duotone image can be monotone, duotone, tritone, or quadtone.


Paletted is an 8-bit color mode that displays images using up to 256 colors. You can convert a complex image to the paletted color mode to reduce file size and to more precisely control the colors used throughout the conversion process.


ICC

ICC is International Color Consortium, an organization that sets standards for device characterization. In color management, a device is a file that describes the color-producing characteristics of a device. Most color management software uses profiles that are in the ICC format.


bleed

A bleed is the extra bit of color, image or text that goes over the edge of the page so that after the printer cuts, binds, and trims it, there is no white space between the edges of your image and the edge of the paper. If you want a bleed, ensure that you draw your image so that it extends a few millimeters over the page borders. The bit extending over the borders is called the bleed, and CorelDRAW displays it with dotted lines along the page borders.


master page

A page containing information that you want to appear on every page of a multi-page document.


vector graphic

Vector graphics are images are stored as algebraic equations that define the lines and curves of the drawing. They can also include bitmap information. They are created in illustration applications, such as CorelDRAW, or bitmap tracing applications, such as Corel TRACE. Vector formats are not restricted to certain color depths.

Compare to bitmap images, which are created pixel-by-pixel in paint applications and by scanners.


pixel

A pixel is an abbreviation for picture element. Pixels are dots on a computer or television screen that combine to form an image. Computer images are created as an array of pixels, each having a specific color.


PostScript

PostScript is a page description language that sends printing instructions to a PostScript device. All the elements in a print job (for example, curves and text) are represented by lines of PostScript code that the printing device uses to produce the document.

PostScript is not the only method for sending printing instructions, and some printing devices are not compatible with PostScript. However, there are several functions that are unavailable when you do not use PostScript. For example, you cannot adjust halftone screens.

There are three levels of PostScript. PostScript 1, the first PostScript language, has certain limitations. PostScript 2 greatly reduces potential printing errors. PostScript 3, the latest version of PostScript, is faster than previous versions, which have been largely eliminated in PostScript 2 or PostScript 3.


text style

Text styles are variations in a typeface or font. Some common styles include Roman (regular or normal), bold, italic, and bold italic.


path

A path is the basic component from which objects are constructed. Paths can be open (e.g., a line or curve) or closed (e.g., a circle or polygon). They can also constitute a single line or curve segment or many joined segments.


artistic text

Artistic text is text type created using the Text tool. Use Artistic text to add single lines of text, such as titles, or to apply graphic effects, such as fitting text to a path, creating extrusions and blends, and creating all other special effects. An Artistic text object can contain up to 32,000 characters. CorelDRAW automatically applies the default Artistic text style, which you can change using the Styles Manager.


texture fill

A texture fill is a random, fractally-generated fill that you can use to give your objects a natural appearance. Texture fills are fills that look like clouds, water, gravel, minerals, and other natural and artificial substances. CorelDRAW provides preset textures, and each texture has a set of options that you can change.

Texture fills, unlike tiled bitmap fills, fill a designated area with one image instead of with a series of repeating images. Texture fills increase the size of a file and the time it takes to print. Therefore, you may want to use these fills sparingly, especially with larger objects.

You can use colors from any color model or palette for texture fills. Since texture fills can only hold RGB colors, however, this can cause a color shift when you display or print the files.

Corel TEXTURE lets you design bitmap texture fills and modify preset textures. You can recreate the natural textures of wood, clouds, stone, ripples, waves, and wrinkles, or create artificial patterns such as checkers, dots, lines, and swirls. Corel TEXTURE lets you control lighting, design, color combinations, and gradations. The Texture wizard guides you through the process, or you can start with a blank texture.


command bar

A command bar is a customized menu or toolbar that enables you quickly access to commands in the application. A command bar can be a toolbar, menu bar, status bar, pop-up menu bar, or a properties bar.


dash

A dash is a broken line segment in an outline style.


gap

A gap is a space between dashes in an outline style.


custom color palette

Custom color palettes are collections of colors you have chosen to save as a color palette file (.CPL extension).You have the ability to copy a color swatch by dragging a color swatch from any palette into your custom palettes. There is no limit to the number of custom palettes you can create.

When you create a custom palette, the palette is empty and ready for you to choose the colors you want to include in it. You can create a custom palette that includes all the colors from the object that you selected or from the current document.


fixed color palette

Fixed color palettes are provided by third-party manufacturers and are most useful when accompanied by a color swatch book. A swatch book is a collection of color samples that shows exactly what each color looks like when printed.


palette

A Color Palette is a collection of solid colors. In CorelDRAW, you can use the on-screen Color Palette, the Select Color dialog box, or the Color Docker to choose colors for fills, outlines, and paper.

The on-screen color palette is a toolbar that displays a series of color swatches. It is used to select colors for use in CorelDRAW and Corel PHOTO-PAINT. You can display multiple on-screen Color Palettes. They can be docked or left floating in the Application Window.


cdrUnit

cdrTenthMicron	0

cdrInch	1

cdrFoot	2

cdrMillimeter	3

cdrCentimeter	4

cdrPixel	5

cdrMile	6

cdrMeter	7

cdrKilometer	8

cdrDidots	9

cdrAgate	10

cdrYard	11

cdrPica	12

cdrCicero	13

cdrPoint	14

cdrUnitQ	15

cdrUnitH	16


The CorelDRAW 11 object model

The VBA programming language automates tasks within an application, by manipulating the components of the application's object model. An object model represents the hierarchy of objects within an application and their relationship to each other within the structure.

In CorelDRAW, the Application object represents the top of the object hierarchy, the program itself. Starting with the Application object, you can "drill down" and navigate through the object model until you find the desired, and usually more specific, object. To reference an object with Visual Basic code, you separate each level of the object hierarchy with the dot operator (.).

For example, Application.ActiveDocument references the Document object, but separates the Document class from the Application class with the use of the dot operator. It is important to note that you do not need to reference the Application object when accessing objects in the object model of CorelDRAW.

A diagram of the object model of CorelDRAW 11 is provided for your reference. If you have difficulty opening this PDF file, you can find it in the folder C:\Program Files\Corel\Corel Graphics 11\Programs where C corresponds to the drive where you installed CorelDRAW, and where Program Files\Corel\Corel Graphics 11\Program corresponds to the path where you installed CorelDRAW.


Bogus heading 1

Some text goes here.


Updating macros from CorelDRAW 10 to CorelDRAW 11

Some names and parameters were revised when the object model was updated from CorelDRAW 10 to CorelDRAW 11. In order to ensure that a macro written for CorelDRAW 10 will work as designed in CorelDRAW 11, you might need to change the name of the class, method, or property, or change parameters for macros. The following list of classes identifies changes which might require that you update a macro.

The following classes have been renamed:

•	Class Points [image] renamed to the SnapPoints class

•	Class Printers [image] renamed to the SystemPrinters class

•	Class ShapePoint [image] renamed to the SnapPoint class

The following properties and methods have been renamed:

Class Application

•	Function CreateShapePoint [image] renamed to the CreateSnapPoint method

Class EffectBlend

•	Property EndShapePoint [image] renamed to the EndPoint property

•	Property StartShapePoint [image] renamed to StartPoint property

Class Shape

•	Property Points [image] renamed to the SnapPoints property

The following parameters have changed:

Class Layer

•	Sub Import [image] the optional parameter, MaintainLayersAndPages, has been changed to Options and returns StructImportOptions.

•	Old: Sub Import(ByVal FileName As String, [ByVal Filter As cdrFilter = cdrAutoSense (0)], [ByVal MaintainLayersAndPages As Boolean = False])

•	New: Sub Import(ByVal FileName As String, [ByVal Filter As cdrFilter = cdrAutoSense (0)], [ByVal Options As StructImportOptions = Nothing])

Class NodeRange

•	Sub Rotate [image] the optional parameter, UseReferencePoint, has been changed to UseCenterPoint and has a default value of False.

•	Old: Sub Rotate(ByVal Angle As Double, [ByVal UseReferencePoint As Boolean = True], [ByVal RotationCenterX As Double = 0], [ByVal RotationCenterY As Double = 0])

•	New: Sub Rotate(ByVal Angle As Double, [ByVal UseCenterPoint As Boolean = False], [ByVal RotationCenterX As Double = 0], [ByVal RotationCenterY As Double = 0])

•	Sub Skew [image] the optional parameter, UseReferencePoint, has been changed to UseAnchorPoint and has a default value of False.

•	Old: Sub Skew([ByVal AngleX As Double = 0], [ByVal AngleY As Double = 0], [ByVal UseReferencePoint As Boolean = True], [ByVal SkewAnchorX As Double = 0], [ByVal SkewAnchorY As Double = 0])

•	New: Sub Skew([ByVal AngleX As Double = 0], [ByVal AngleY As Double = 0], [ByVal UseAnchorPoint As Boolean = False], [ByVal SkewAnchorX As Double = 0], [ByVal SkewAnchorY As Double = 0])

•	Sub Stretch [image] the optional parameter, UseReferencePoint, has been changed to UseAnchorPoint and has a default value of False; the values for the parameters, RatioX and RatioY, are now expressed as multiples of the current width and height respectively.

•	Old: Sub Stretch([ByVal RatioX As Single = 100], [ByVal RatioY As Single = 100], [ByVal UseReferencePoint As Boolean = False], [ByVal StretchAnchorX As Double = 0], [ByVal StretchAnchorY As Double = 0])

•	New: Sub Stretch([ByVal RatioX As Single = 1], [ByVal RatioY As Single = 1], [ByVal UseAnchorPoint As Boolean = True], [ByVal StretchAnchorX As Double = 0], [ByVal StretchAnchorY As Double = 0])

Class Segment

•	Sub GetPointPositionAt [image] the two required parameters, X and Y, have been moved to the front of the parameter list.

•	Old: Sub GetPointPositionAt( [ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset (2)], ByRef X As Double, ByRef Y As Double)

•	New: Sub GetPointPositionAt(ByRef X As Double, ByRef Y As Double, [ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset (2)])

Class Shape

•	Sub SetSizeEx [image] the two required parameters, CenterX and CenterY, have been moved to the front of the parameter list.

•	Old: Sub SetSizeEx([ByVal Width As Double = 0], [ByVal Height As Double = 0], ByVal CenterX As Double, ByVal CenterY As Double)

•	New: Sub SetSizeEx(ByVal CenterX As Double, ByVal CenterY As Double, [ByVal Width As Double = 0], [ByVal Height As Double = 0])

•	Sub StretchEx [image] the two parameters, CenterX and CenterY, have been moved to the front of the parameter list.

•	Old: Sub StretchEx(ByVal StretchX As Double, [ByVal StretchY As Double = 0], ByVal CenterX As Double, ByVal CenterY As Double = 0, [ByVal StretchCharactersSize As Boolean = False])

•	New: Sub StretchEx(ByVal CenterX As Double, ByVal CenterY As Double, ByVal StretchX As Double, [ByVal StretchY As Double = 0], [ByVal StretchCharactersSize As Boolean = False])

Class ShapeRange

•	Sub SetSizeEx [image] the two required parameters, CenterX and CenterY, have been moved to the front of the parameter list.

•	Old: Sub SetSizeEx([ByVal Width As Double = 0], [ByVal Height As Double = 0], ByVal CenterX As Double, ByVal CenterY As Double)

•	New: Sub SetSizeEx(ByVal CenterX As Double, ByVal CenterY As Double, [ByVal Width As Double = 0], [ByVal Height As Double = 0])

•	Sub StretchEx [image] the two parameters, CenterX and CenterY, have been moved to the front of the parameter list.

•	Old: Sub StretchEx(ByVal StretchX As Double, [ByVal StretchY As Double = 0], ByVal CenterX As Double, ByVal CenterY As Double, [ByVal StretchCharactersSize As Boolean = False])

•	New: Sub StretchEx(ByVal CenterX As Double, ByVal CenterY As Double, ByVal StretchX As Double, [ByVal StretchY As Double = 0], [ByVal StretchCharactersSize As Boolean = False])

Class SubPath

•	Function AppendCurveSegment [image] the optional parameter, AppendAtBeginning, has been moved to the end of the parameter list.

•	Old: Function AppendCurveSegment([ByVal AppendAtBeginning As Boolean = False], ByVal X As Double, ByVal Y As Double, [ByVal StartingControlPointLength As Double = -1], [ByVal StartingControlPointAngle As Double = 0], [ByVal EndingControlPointLength As Double = -1], [ByVal EndingControlPointAngle As Double = 0]) As Segment

•	New: Function AppendCurveSegment(ByVal X As Double, ByVal Y As Double, [ByVal StartingControlPointLength As Double = -1], [ByVal StartingControlPointAngle As Double = 0], [ByVal EndingControlPointLength As Double = -1], [ByVal EndingControlPointAngle As Double = 0], [ByVal AppendAtBeginning As Boolean = False]) As Segment

•	Function AppendLineSegment [image] the optional parameter, AppendAtBeginning, has been moved to the end of the parameter list.

•	Old: AppendLineSegment([ByVal AppendAtBeginning As Boolean = False], ByVal X As Double, ByVal Y As Double, ) As Segment

•	New: Function AppendLineSegment(ByVal X As Double, ByVal Y As Double, [ByVal AppendAtBeginning As Boolean = False]) As Segment

•	Sub GetPointPositionAt [image] the two required parameters, X and Y, have been moved to the front of the parameter list.

•	Old: Sub GetPointPositionAt([ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrRelativeSegmentOffset (1)], ByRef X As Double, ByRef Y As Double)

•	New: Sub GetPointPositionAt(ByRef X As Double, ByRef Y As Double, [ByVal Offset As Double = 0.5], [ByVal OffsetType As cdrSegmentOffsetType = cdrRelativeSegmentOffset (1)])