Opening Resources

rbulph

Well-known member
Joined
Feb 17, 2003
Messages
343
If you add a Word file as a Resource to a project, how do you then open that file from within your code? Not like this, at least:

Code:
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim p As New Word.Application
        p.Visible = True
        p.Documents.Add(My.Resources._2002_AGM_Minutes)
    End Sub
End Class

I cant figure it out. It was so easy in VB6 with an OLE container. Grateful if someone can tell me.
 
Last edited by a moderator:
Not knowing anything at all about Office interop, if I had to guess I would say that one approach would be to extract the resource to a file on the disk and open it from there. If the Word.Application can accept a stream, it should also be possible to create a stream to read the resource and skip the intermediate step of using the hard drive. But thats all coming from someone who doesnt know anything at all about Office interop.
 
Back
Top