Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (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 by rbulph
  • Leaders
Posted
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.
[sIGPIC]e[/sIGPIC]
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...