user2266045
user2266045

Reputation: 41

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

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

Upvotes: 4

Views: 6079

Answers (2)

Freelancer
Freelancer

Reputation: 9074

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.

Upvotes: 5

W.Schmerz
W.Schmerz

Reputation: 97

  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!!!

Upvotes: 4

Related Questions