Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Urgent :: Need help in PPT macro (get text from PowerPoint)
#1
I need one macro by which i can take data from text boxes in slides(to excel or notepad or in first slide)

for example : i show a engine pic in one slide and call out its parts in text boxes. I need to make a list of all part which i included in Text box..

Please please help me on this
#2
create this function
Function PowerPointSlideGetText
Code:
Copy      Help
;/
function ARRAY(str)&a [slide]

;Gets text from a PowerPoint slide.
;Error if fails.
;On Vista/7 must run in separate process as User. Set it in macro Properties dialog.
;Tested with MS Office 2003. Should work with other versions too.

;a - variable that receives text. Each array element will contain text of a text box.
;slide - 1-based slide index. If omitted or 0, uses current slide.


a=0
typelib PowerPoint {91493440-5A91-11CF-8700-00AA0060263B} 2.8

PowerPoint.Application ap._getactive; err end "failed to connect to PowerPoint. Try to run this macro in separate process as User."

PowerPoint.Slide d
if(slide<1) d=ap.ActiveWindow.View.Slide
else d=ap.ActivePresentation.Slides.Item(slide); err end "incorrect slide index"

PowerPoint.Shape h
foreach h d.Shapes
,if(!h.HasTextFrame) continue
,if(!h.TextFrame.HasText) continue
,a[]=h.TextFrame.TextRange.Text

err+ end _error

example
Macro Macro1386
Code:
Copy      Help
;/exe 1
out

ARRAY(str) a; int i
PowerPointSlideGetText a

out "--- text boxes ---"
for i 0 a.len
,out "%i. %s" i+1 a[i]

out "--- all ---"
str s=a
out s


Forum Jump:


Users browsing this thread: 1 Guest(s)