Forum: Ruby Edit msg files with ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F821ef13e9d7fcbb6b746aa70b37cca0?d=identicon&s=25 Daniel Ritter (spellsleeper)
on 2017-04-03 15:45
Hi, I try to customize many msg files. I wan't convert them with an
application. but there's the problem many of the mails have a
unconvential message class the application can't handle. I wan't set the
default message class for all msg files. With 'ruby-msg' I can read all
properties like that:
-----
require 'mapi/msg'
msg=Mapi::Msg.open('C:\Users\***.MSG')
h=Hash[t.keys.zip(t.values)]
h.each_key do |k|
  puts "#{k.to_s}:\t#{h[k].to_s}"
end
-----
That works! But I found no way to write to change mail properties like
here.
-----
require 'mapi/msg'
msg=Mapi::Msg.open('C:\Users\***.MSG')
msg=msg.properties.raw.add_property('message_class','IPM.Note')
f=File.open('C:\Users\**.MSG','w')
f.write(msg)
-----
That doesn't work. Is somebody knowing a way to accomplish this? All
possible solutions are welcome:)!
This topic is locked and can not be replied to.