Link to home
Start Free TrialLog in
Avatar of cmdolcet
cmdolcetFlag for United States of America

asked on

How to embed a manual into my vb 2005 project

I added in a .pdf manual into my project, I think I got the code to open the .pdf manual  on a button push event:
 Private Sub mnuWUManual_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuWUManual.Click
        Process.Start("ExampleManual.pdf")
    End Sub

Open in new window


However I dont think I am doing it right when saving it inside the project because I do not see it in the build folder? I have it listed in the project but when I build it the button doesn't work or I can see the .pdf
Avatar of HainKurt
HainKurt
Flag of Canada image

copy it to your exe path, include it in your prj, then use

Process.Start(My.Application.Info.DirectoryPath & "ExampleManual.pdf")
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cmdolcet

ASKER

OK I am confused...

Do I add the .pdf file in the resource and select the file?
yes add pdf to default resource of your project, so you can get it and use whanever needed
no need to deal with path/filename

then, grab it, write to a temp file, and open it as in above example...

this is one way...

the other way is just copy it to app folder (next to your exe) then use

Process.Start(My.Application.Info.DirectoryPath & "ExampleManual.pdf")

to open it...
Avatar of Éric Moreau
you have added the pdf to your project? There is a property on the file that you need to set to "Copy always"
The property I am referring to is named "Copy to output directory"