How Ruby Interacts with Powerpoint

31 views
Skip to first unread message

arihan sinha

unread,
Feb 1, 2010, 1:08:38 PM2/1/10
to watir-...@googlegroups.com


Hi All,

I was trying to do the ruby script for validation of  a powerpoint.

I've done upto some extent

ppt = WIN32OLE.new('PowerPoint.Application')
ppt.Visible = true
## open the ppt
doc = ppt.Presentations.Open('c:\sample.ppt')
## count the no of slides
slidecount = doc.Slides.Count
 ## retrieve the Text present in the slide 1 in shape 1
 slidetext = doc.slides(1).shapes(1).TextFrame.TextRange.Text
 


Now I want that there are some hyperlinks in the slide1.

Could anyone pls let me know how I would retrieve those links.

Thanks
Arihan

Tiffany Fodor

unread,
Feb 1, 2010, 3:23:41 PM2/1/10
to Watir General
Hi Arihan!

This is not really a question for this group - you would probably have
more luck with a Ruby group.

I haven't checked in detail, but you might have some luck with the
Ruby on Windows blog:

http://rubyonwindows.blogspot.com/search/label/powerpoint

Hope this helps!

-Tiffany

arihan sinha

unread,
Feb 2, 2010, 6:46:02 AM2/2/10
to watir-...@googlegroups.com
Thanks Tiffany.

Actually the extent I've done by only refering to the url you ve mentioned. Also with some of my knowledge on QTP+VB script. where in QTP I've done this thing already.

now as the url you ve mentioned, the links part is not covered . so stuck.. Any way Thanks. will try my luck :)

Thanks

Arihan

--
You received this message because you are subscribed to the Google Groups "Watir General" group.
To post to this group, send email to watir-...@googlegroups.com
Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to watir-genera...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/watir-general

David Mullet

unread,
Feb 5, 2010, 9:00:15 AM2/5/10
to Watir General
Here's a very brief example, where doc is your document:

ppMouseClick = 1
ppActionHyperlink = 7

slide1 = doc.slides(1)
textbox = slide1.shapes(3)

link = textbox.ActionSettings(ppMouseClick)
link.Action = ppActionHyperlink
link.Hyperlink.Address = "http://www.microsoft.com"

I hope that helps. I'm short on time at this moment, but let me know
if you have further questions.

David

http://rubyonwindows.blogspot.com/
http://rubyonwindows.blogspot.com/search/label/powerpoint


On Feb 2, 6:46 am, arihan sinha <arihan.si...@googlemail.com> wrote:
> Thanks Tiffany.
>
> Actually the extent I've done by only refering to the url you ve mentioned.
> Also with some of my knowledge on QTP+VB script. where in QTP I've done this
> thing already.
>
> now as the url you ve mentioned, the links part is not covered . so stuck..
> Any way Thanks. will try my luck :)
>
> Thanks
>
> Arihan
>

Reply all
Reply to author
Forward
0 new messages