Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio, C# how to add a doc file as a resource

Tags:

c#

ms-office

I am trying to add a word document (.doc) to my project as a resource so I could open it with a button.

like image 723
user2266045 Avatar asked Jan 14 '23 17:01

user2266045


2 Answers

You can take the following steps to add a doc file into as resource into your project:

  1. Right-click your project and select the "Properties" option.
  2. Then click the "Resources" tab and it will show the dialog for you to add resources in the design time.
  3. The default page is for add String resources, you can select the combobox in the top-right to select the "file" item.
  4. Then click the "Add Resource" button to select the doc file and click OK.
  5. At last, the doc file will show in the blank area. It means that you have added it successfully.
like image 135
Freelancer Avatar answered Jan 19 '23 00:01

Freelancer


  1. Add your document with Add->Existing Item... context menu of your project.
  2. Right-click on your document item in your Solution Explorer
  3. Select Properties from the context menu
  4. Change Build Action from Compile to Embedded Resource
  5. ...
  6. PROFIT!!!
like image 28
W.Schmerz Avatar answered Jan 19 '23 01:01

W.Schmerz