Solved

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

Posted on 2004-08-09
4
180 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 500 total points
ID: 11760282
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
ID: 11764361
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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