I am trying to load the content of an RTF file, which I have put inside resources (through Project->Properties->Resources->Add File
).
I want to load Agreement.rtf
's content to a RichTextBox
and I have tried the following:
Dim stream As Stream
stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(My.Resources.ResourceManager.GetObject("Agreement").GetType(), "IOpzioni.Agreement.rtf")
RichTextBox1.SelectAll()
RichTextBox1.Selection.Load(stream, DataFormats.Rtf)
also
stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(My.Resources.Agreement.GetType(), "IOpzioni.Agreement.rtf")
IOpzioni
is my default namespace (I have double checked that).
Nothing seems to work. What is the correct way to do this?