OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 04-01-2005, 15:30
Craig Tucker
Posts: n/a
Default InsertAfter - Retain Font Size

Hi All,
I'm running the "InsertAfter" method on a paragraph text to hold multiple values added to the end of the text. It's working great except I can't figure out how to retain the font size as its not one of the parameters in the method. Any suggestions or better solution for this?
Thanks for the help,

Here's the code...

Set s = mCor.ActivePage.FindShape(lcMenuItem)
If Not s Is Nothing Then
   lnLanguageID = s.Text.Story.LanguageID
   lnCharSet = s.Text.Story.Charset
   lcFont = s.Text.Story.Font
End If
Set s = mCor.ActivePage.FindShape(lcLookFor)
If Not s Is Nothing Then
   Set TextRange = s.Text.Story.InsertAfter(CStr(taImageShapes  (lnCounter3, 2)), lnLanguageID, lnCharSet, lcFont)
   s.Text.Story.InsertAfter (vbCrLf)
End If
Reply With Quote
Old 05-01-2005, 11:45
Craig Tucker
Posts: n/a

Ok Ok, Sometimes I'm slow...
Here's the fix in case any of you are interested.

Set s1 = mCor.ActivePage.FindShape(lcMenuItem)
If Not s1 Is Nothing Then
   s1.Text.Story = CStr(taImageShapes(lnCounter3, 2))
End If
Set s2 = mCor.ActivePage.FindShape(lcLookFor)
If Not s2 Is Nothing Then
   Set lcTextRange = s2.Text.Story.InsertAfter(s1.Text.Story,     s1.Text.Story.LanguageID, s1.Text.Story.Charset, s1.Text.Story.Font)
   [b]lcTextRange.Size = s1.Text.Story.Size[/b]
   s2.Text.Story.InsertAfter (vbCrLf)
End If
Reply With Quote
Old 05-01-2005, 22:46
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4

I knew you could do it
Reply With Quote
Old 07-01-2005, 07:42
Craig Tucker
Posts: n/a

Hi Alex,
Just curious; Why does the InserAfter (and others) method accept 3 additional parameters (LanguageID, CharSet, and Font)? Why these and not others such as font size. It seems to me it should just accept 1 "Text" and return a TextRange to change others. How were these 3 decided, most commonly used or something?
Thanks, Craig...
Reply With Quote

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
T1 fonts & Bitstream font nav. vs Corel draw 12 & 11 xombie General 2 22-05-2005 17:35
weird font issue bbolte CorelDRAW/Corel DESIGNER VBA 1 21-04-2005 15:20
how to specify the font size in inches bbolte CorelDRAW/Corel DESIGNER VBA 14 26-01-2005 22:19
Bitstream Font Nav Problem ddonnahoe General 0 16-12-2004 08:25
Reading Font Properties from selected text in CD9 sherman01 CorelDRAW/Corel DESIGNER VBA 2 24-11-2004 07:59

All times are GMT -5. The time now is 02:57.

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