Solved

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

Posted on 2004-08-09
4
182 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

717 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