Set font programatically on text object in

I am trying to dynamically set the font and color of a text object in a section of a report. The code listed only sets the color and font on the first embedded field. These are simple database generated address labels but I canoo figure out how to access (reference) individual embeded fields or tell the report to set the font and color on the completetext object.
Dim section As Section = report.ReportDefinition.Sections.Item("Section3")
        Dim textObject As TextObject = section.ReportObjects("Text4")
        textObject.Color = Color.Red
        textObject.ApplyFont(New Font("Arial", 8.25F))

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I don't believe you can dynamically access the individual embedded fields.

You can format them by selecting them from the textbox and right clicking
You should be able to use the formula buttons on the FONT tab to set the values you want.

jtesdallAuthor Commented:
Yes, but I want to do this programatically. Basically based on certain criteria at runtime I want to change the font and color on these labels.

I may have found a solution but it is a work around. I duplicated the text object and set the new font and color I want. Then at runtime I set the length of the text object I don't want to zero so the one I do want displays. This seems to work for now, but setting the font on the text object should have worked for the whole object instead of just the first embedded field. I guess this is a bug.
The formula method I mentioned is at runtime.  Is the information you use to set the color available in the report?

C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

jtesdallAuthor Commented:
No its not. I just want people to be able to select a standard font or script font for printing out address labels from our database with my app.
PAQed with points refunded (500)

EE Admin

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Why were points awarded for this solution? It doesn't say anything!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.