Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-08-09
4
Medium Priority
?
184 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

609 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