Re: How to Get Text X, Y position?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



In article <d695d13c-2b5a-4003-b727-d130501f1aba@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
wrote:
Hi All,
I am writing an application which will export power point slide
content into a text file. I am iterating through all shapes and
getting each textRange(from textFrame). From textRange getting text
and font style.Everything is working fine except text x, y position.
To get text X-position i am using text range's BoundLeft function and
for Y-Position I am using text range's BoundTop function. Both
functions are returning value in Points. How to convert this into
pixels?

Pixels where? The value will depend on the resolution of the screen you're
showing the presentation on, so you'd have to call a WinAPI function to get
that info. From there it'd be a relatively simple ratio calculation IF the
slide size and screen size are of the same proportions. Otherwise you'll have
to work out some offsets.

And BoundTop is always returning same value for different
TextRanges(Font and Font size is different). How to get X, Y position
of the each textRange?

Can you post some example code that demonstrates this?

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Live and in personable in the Help Center at PowerPoint Live
Sept 21-24, San Diego CA, USA
www.pptlive.com

.



Relevant Pages

  • Re: master reapplied -- and yet not
    ... Michael Koerner [MS PPT MVP] ... have now also tried using a larger font size on my master. ... This is how PPT works -- the font sizes are smaller on those ... I have only one Master Slide showing when I View/Master/Slide Master. ...
    (microsoft.public.powerpoint)
  • RE: Text size changes when copy-pasting
    ... Select "keep source formatting," and it should set things right. ... Echo [MS PPT MVP] ... > when we paste it into a new slide it keeps changing the ... > font size. ...
    (microsoft.public.powerpoint)
  • Re: How to Get Text X, Y position?
    ... created my own example slide. ... TextRanges(Font and Font size is different). ... Steve Rindsberg, PPT MVP ... float boundLeft = eachTextRange.get_BoundLeft; ...
    (microsoft.public.powerpoint)
  • Re: programmatically insert lots of text into a power point presentation.
    ... > one slide for a given font just by opening up PP and typing in lines. ... I could count the number of characters that fit on one ... Steve Rindsberg, PPT MVP ...
    (microsoft.public.powerpoint)
  • Re: clipping of export slide images
    ... I get about 1000 pixels of slide and 200 pixels ... You most likely downloaded Service Pack 1 (SP1) for Office 2007. ... Steve Rindsberg, PPT MVP ...
    (microsoft.public.powerpoint)