Solved

How do I change the tab settings in powerpoint from within a VB .net program

Posted on 2004-08-09
4
171 Views
Last Modified: 2012-08-13
I am creating a powerpoint presentation from within VB .NET.  Does anyone know how I can change the value of the tab settings programatically?  I am using  a text box to enter data that I want to be formatted into columns.  Counting the string length doesn't work, because all different characters have different sizes.  I think I remember from a long time ago that you could change that, but I don't remember the term for that.  That would solve my problem as well, ( if every string that had 20 characters had exactly the same length in inches when displayed)  Any help on this would be greatly appreciated.  Thanks
0
Comment
Question by:spmcmorrow
4 Comments
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 500 total points
Comment Utility
You can measure the exact lenght (in this case in millimeters, but you can change that to inches, pixels etc) of your string depended on the used font like this

    Public Function MeasureStringMin(ByVal StrText As String, ByVal StrFont As Font) As SizeF
        Dim stringSize As New SizeF
        Dim e As Graphics
        e = Me.CreateGraphics
        e.PageUnit = GraphicsUnit.Millimeter
        stringSize = e.MeasureString(StrText, StrFont)
        Return stringSize
    End Function

call like this

        Dim stringFont As New Font("Arial", 8)
        MsgBox(MeasureStringMin("yourtext", stringFont).Width)



0
 

Author Comment

by:spmcmorrow
Comment Utility
Thank you.  That is great to know and would solve my problem.  I also realized that the type of font I was looking for and couldn't remember yesterday was a monospaced font like courier new.  I ending up using that font and lining up my columns using the string length.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now