OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > Corel Script > CorelDRAW CS

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-03-2011, 14:14
futurox
Guest
 
Posts: n/a
Default Zero position in new document

How to set reference point (0,0) to the top left of a corel document ?
When I create new artistic text and set its left top corner to the left top corner of the document I will not have its (the text) position set to (0,0).
What do I need to do , which settings ?
I write this post here in this section because I have such a vba code and this does not work as I said I would like

Quote:
ActiveDocument.ReferencePoint = cdrTopLeft
ActiveDocument.Unit = cdrPixel

Dim s1 As Shape
Set s1 = ActiveLayer.CreateArtisticText(0, 0, "any text")
s1.Fill.UniformColor.CMYKAssign 0, 100, 100, 0
s1.Text.Story.Paragraphs(1).Font = "Verdana"
s1.Text.Story.Paragraphs(1).Size = 12
s1.Text.Story.Paragraphs(1).Bold = True
Reply With Quote
  #2  
Old 01-03-2011, 15:22
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
Hopefully this will help. I added a little to the bottom of your code.
I used X5 for this:

Code:
Sub moveText2()


ActiveDocument.ReferencePoint = cdrTopLeft
ActiveDocument.Unit = cdrPixel
Dim x#, y#, w#, h#

Dim s1 As Shape
Set s1 = ActiveLayer.CreateArtisticText(0, 0, "any text")
s1.Fill.UniformColor.CMYKAssign 0, 100, 100, 0
s1.text.Story.Paragraphs(1).Font = "Verdana"
s1.text.Story.Paragraphs(1).Size = 12
s1.text.Story.Paragraphs(1).Bold = True

s1.GetBoundingBox x, y, w, h
ActiveDocument.DrawingOriginY = ActivePage.SizeHeight / 2
ActiveDocument.DrawingOriginX = -(ActivePage.SizeWidth / 2)
s1.SetPosition 0, 0
End Sub
-John
Reply With Quote
  #3  
Old 01-03-2011, 17:19
futurox
Guest
 
Posts: n/a
Default

It works great. Thanks a lot.

Now could you tell me how to change default font size unit from point into pixel in vba ?
Reply With Quote
  #4  
Old 01-03-2011, 17:37
futurox
Guest
 
Posts: n/a
Default

Ok, I've found:

Application.ConvertUnits - converts a value between any two units
Document.ToUnits - converts any unit into the current document units (as specified by Document.Unit property)
Document.FromUnits - converts a value from the current document units into the given unit

taken from page: http://forum.oberonplace.com/archive...hp?t-1123.html
Reply With Quote
  #5  
Old 01-03-2011, 17:42
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
Yep. You beat me to it. Glad to hear it helped you.
-John
Reply With Quote
Reply


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

Advanced Search
Display Modes

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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form position PAnderson CorelDRAW/Corel DESIGNER VBA 3 01-02-2011 23:05
Position Question bprice CorelDRAW/Corel DESIGNER VBA 1 11-10-2008 21:39
Text position CWCN CorelDRAW/Corel DESIGNER VBA 2 22-09-2008 23:40
Pasting in position longline Corel Photo-Paint VBA 2 27-05-2008 19:17
Getting the mouse position Rick Randall CorelDRAW/Corel DESIGNER VBA 1 04-12-2002 10:29


All times are GMT -5. The time now is 18:30.


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