Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

getting position of paragraph range in powerpoint 2010 vba

Posted on 2014-01-07
1
Medium Priority
?
818 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 2000 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
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: …

715 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