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 21-05-2008, 11:39
Manuel
Guest
 
Posts: n/a
Default Change font

Is there a way to change the font of every text box in all the pages of a document?

thanks
Reply With Quote
  #2  
Old 23-05-2008, 19:13
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default

Quote:
Originally Posted by Manuel View Post
Is there a way to change the font of every text box in all the pages of a document?

thanks
Here is how you would do that:

Code:
Sub ChangeAllFonts()
    Dim p As Page
    Dim s As Shape
    
    For Each p In ActiveDocument.Pages
        For Each s In p.SelectableShapes.FindShapes(, cdrTextShape)
            s.Text.Story.Font = "Times New Roman"
        Next s
    Next p
End Sub
Reply With Quote
  #3  
Old 26-05-2008, 17:08
Manuel
Guest
 
Posts: n/a
Default

WOW! Thanks, Alex.
The VBA help wasn't very helpful on this.
This is what it says

"The Story property returns all of the text from all of the text frames.
The Story property returns a read-only value".
Reply With Quote
  #4  
Old 11-07-2009, 14:03
nlussier
Guest
 
Posts: n/a
Default Additional question

Alex,

Thanks for your code! I have a question for you : do you know how to add the option for a dropdown menu, allowing to select the font face needed (instead of having a fix "Times New Roman" like in this example)? I just need the font face type.
Reply With Quote
  #5  
Old 13-07-2009, 09:06
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

Are you looking to populate the drop-down list with currently installed fonts? If so you would add a ComboBox to your form (let's call this "cbxFonts"), then in the userform initialization section of your code you would add this...
Code:
Private Sub UserForm_Initialize()
    Dim n As Long
    
    For n = 1 To FontList.Count
        cbxFonts.AddItem FontList(n)
    Next n
End Sub
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #6  
Old 16-07-2009, 03:40
Kursad
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Alex View Post
Here is how you would do that:

Code:
Sub ChangeAllFonts()
    Dim p As Page
    Dim s As Shape
    
    For Each p In ActiveDocument.Pages
        For Each s In p.SelectableShapes.FindShapes(, cdrTextShape)
            s.Text.Story.Font = "Times New Roman"
        Next s
    Next p
End Sub
If the text in powerclip it doesnt work.
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
Font displaying while going thru font list signweld General 2 19-03-2008 09:42
leading (line spacing) between lines of artistic text that have different font size michael_maberly General 4 15-07-2007 11:07
Select specified text, change font size? fiddler2b CorelDRAW/Corel DESIGNER VBA 3 23-04-2006 08:11
Change styles throughout entire document Ruffus General 0 12-12-2005 19:58
weird font issue bbolte CorelDRAW/Corel DESIGNER VBA 1 21-04-2005 15:20


All times are GMT -5. The time now is 06:55.


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