FWIW, a win32ole library is in development and should be in JRuby for 1.6.
This is good news for those of us who do a lot of work with the standard Ruby win32ole library.
My sincere thanks to all who are helping to make this happen.
FWIW, a win32ole library is in development and should be in JRuby for 1.6.
I set this group up to focus discussions about a community developed IDE written in Ruby (but not necessarily limited to writing code in just that language. The intent is to take general discussion specific off-line from the main ruby-talk group Hopefully, this will be a high signal-noise ratio discussion.
http://groups.google.com/group/ruby-ide
require 'win32ole'
ppt = WIN32OLE.new('PowerPoint.Application')
ppt.Visible = true
doc = ppt.Presentations.Add()
slide = doc.Slides.Add(1, 2)
slide.Shapes(1).TextFrame.TextRange.Text = "Ruby on Windows"
slide.Shapes(2).TextFrame.TextRange.Text = "Ruby on Windows: PowerPoint"
text_range = slide.Shapes(2).TextFrame.TextRange
action = text_range.ActionSettings(1)
link = action.Hyperlink
link.Address = "http://rubyonwindows.blogspot.com/search/label/powerpoint"
link.ScreenTip = "Click to go to website"
link.TextToDisplay = "Ruby on Windows: PowerPoint"
require 'win32ole'
ppt = WIN32OLE.new('PowerPoint.Application')
ppt.Visible = true
doc = ppt.Presentations.Add()
slide = doc.Slides.Add(1, 2)
slide.Shapes(1).TextFrame.TextRange.Text = "Ruby on Windows"
slide.Shapes(2).TextFrame.TextRange.Text = "Ruby on Windows: PowerPoint"
text_range = slide.Shapes(2).TextFrame.TextRange
action = text_range.ActionSettings(1)
link = action.Hyperlink
link.Address = "http://rubyonwindows.blogspot.com/search/label/powerpoint"
link.ScreenTip = "Click to go to website"
link.TextToDisplay = "Ruby on Windows: PowerPoint"
document.SaveAs('c:\temp\MyDocument.doc')
document.SaveAs('c:\temp\MyDocument.pdf', 17)
workbook.SaveAs('c:\temp\MyWorkbook.pdf', 57)
presentation.SaveAs('c:\temp\MyPresentation.pdf', 32)
word = WIN32OLE.connect('Word.Application')
document = WIN32OLE.connect('C:\Path To File\DocumentB.doc')
word = document.Application
workbook = WIN32OLE.connect('C:\Path To File\WorkbookB.xls')
xl = workbook.Application
require 'win32ole'
itunes = WIN32OLE.new('iTunes.Application')
data = []
itunes.LibraryPlaylist.Tracks.each do |track|
if not track.Podcast
data << [track.Artist, track.Year, track.Album, track.Name]
end
end
itunes.LibraryPlaylist.Tracks.each do |track|
data << [track.Artist, track.Year, track.Album, track.Name]
end
data.sort!
data.insert(0, ['ARTIST', 'YEAR', 'ALBUM', 'NAME'])
xl = WIN32OLE.new('Excel.Application')
xl.Visible = true
wb = xl.Workbooks.Add()
ws = wb.Worksheets(1)
rng = ws.Range('A1').Resize(data.size, data.first.size)
rng.Value = data
ws.Rows(1).Font.Bold = true
ws.Rows(1).AutoFilter()