rbulph Posted October 2, 2006 Posted October 2, 2006 (edited) 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: 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 can't figure it out. It was so easy in VB6 with an OLE container. Grateful if someone can tell me. Edited October 2, 2006 by rbulph Quote
Leaders snarfblam Posted October 2, 2006 Leaders Posted October 2, 2006 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 that's all coming from someone who doesn't know anything at all about Office interop. Quote [sIGPIC]e[/sIGPIC]
rbulph Posted October 5, 2006 Author Posted October 5, 2006 Here's the answer, if you're interested http://forums.microsoft.com/MSDN/showpost.aspx?postid=790038&siteid=1 Quote
Recommended Posts