Solved

getting position of paragraph range in powerpoint 2010 vba

Posted on 2014-01-07
1
783 Views
Last Modified: 2014-01-07
Have the follwoing code:

pptSlide.Shapes.Range(2).TextFrame.TextRange.Paragraphs(3).text = vbNewLine & "Priority:     1     2     3"

Based on a query I need to draw a red box around either the 1, 2, or 3 on the slide.  How can i get the x and y of the paragraph(3) to do so?  Unless there is an alternative method that is easier :)
0
Comment
Question by:HyperBPP
[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
1 Comment
 
LVL 23

Accepted Solution

by:
JSRWilson earned 500 total points
ID: 39762563
Dim otxR As TextRange
Dim myBox As Shape
Set otxR = pptSlide.Shapes.Range(2).TextFrame.TextRange.Paragraphs(3)
Set myBox = pptSlide.Shapes.AddShape(msoShapeRectangle, Left:=otxR.BoundLeft, _
Top:=otxR.BoundTop, _
Width:=otxR.BoundWidth, _
Height:=otxR.BoundHeight)
myBox.Fill.Visible = False
myBox.Line.ForeColor.RGB = vbRed

NOTE because you added a NewLine the box may draw around the blank newline! You may need to change the paragraph number to 4
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

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