OberonPlace.com Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 27-02-2004, 09:13
mrniceguy
Guest
 
Posts: n/a
Default Newbee needs help

Hi,

I need some help for a script that does the following:

1. create a new page
2. create a shape
3. write some text in it
4. create another shape
5. paste some text in it

I hope you can help me

stefan
Reply With Quote
  #2  
Old 01-03-2004, 08:36
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Newbee needs help

Stefan,

I don't know exactly what you need to do, so I'm not sure if what I have is suitable for your needs. But here is a piece of code which follows exactly what you asked:

Code:
Sub Test()
    Dim s1 As Shape, s2 As Shape
    
    ActiveDocument.AddPages 1
    Set s1 = ActiveLayer.CreateEllipse2(4, 7, 3, 2)
    Set s2 = ActiveLayer.CreateParagraphText(0, 0, 2, 2, "Some Text")
    s2.Text.Frame.VerticalAlignment = cdrCenterJustify
    s2.Text.Story.Alignment = cdrCenterAlignment
    s1.PlaceTextInside s2

    If Clipboard.Valid Then
        Set s1 = ActiveLayer.CreateRectangle(1, 1, 6, 3, 20, 20, 20, 20)
        Set s2 = ActiveLayer.CreateParagraphText(0, 0, 2, 2)
        s2.Text.Story.Paste
        s2.Text.Frame.VerticalAlignment = cdrCenterJustify
        s2.Text.Story.Alignment = cdrCenterAlignment
        s1.PlaceTextInside s2
    End If
End Sub
It creates an ellipse and places a text inside it. Then it creates a rectangle with rounded corners and places another text block in it and pastes the text currently on clipboard into it. Make sure you have something on clipboard before running this macro.

I hope this helps.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 20:17.


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