├── .gitignore
├── CONTRIBUTING.md
├── FileDownloadSample.sln
├── FileDownloadSample
├── FileDownloadSample.csproj
└── FileDownloadSampleManifest
│ ├── FileDownloadSample.xml
│ └── SharePointProjectItem.spdata
├── FileDownloadSampleWeb
├── FileDownloadSampleWeb.csproj
├── Home.css
├── Home.html
├── Home.js
├── Images
│ ├── Button16x16.png
│ ├── Button32x32.png
│ ├── Button80x80.png
│ ├── Close.png
│ └── logo-filled.png
├── Properties
│ └── AssemblyInfo.cs
├── Scripts
│ └── _references.js
├── Web.Debug.config
├── Web.Release.config
├── Web.config
└── testdata.pdf
├── LICENSE
├── Office-Add-in-JavaScript-FileDownload.yml
├── README-Localized
├── README-de-de.md
├── README-es-es.md
├── README-fr-fr.md
├── README-ja-jp.md
├── README-pt-br.md
├── README-ru-ru.md
├── README-zh-cn.md
└── README-zh-tw.md
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | artifacts/
46 |
47 | *_i.c
48 | *_p.c
49 | *_i.h
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.tmp_proj
64 | *.log
65 | *.vspscc
66 | *.vssscc
67 | .builds
68 | *.pidb
69 | *.svclog
70 | *.scc
71 |
72 | # Chutzpah Test files
73 | _Chutzpah*
74 |
75 | # Visual C++ cache files
76 | ipch/
77 | *.aps
78 | *.ncb
79 | *.opendb
80 | *.opensdf
81 | *.sdf
82 | *.cachefile
83 | *.VC.db
84 | *.VC.VC.opendb
85 |
86 | # Visual Studio profiler
87 | *.psess
88 | *.vsp
89 | *.vspx
90 | *.sap
91 |
92 | # TFS 2012 Local Workspace
93 | $tf/
94 |
95 | # Guidance Automation Toolkit
96 | *.gpState
97 |
98 | # ReSharper is a .NET coding add-in
99 | _ReSharper*/
100 | *.[Rr]e[Ss]harper
101 | *.DotSettings.user
102 |
103 | # JustCode is a .NET coding add-in
104 | .JustCode
105 |
106 | # TeamCity is a build add-in
107 | _TeamCity*
108 |
109 | # DotCover is a Code Coverage Tool
110 | *.dotCover
111 |
112 | # NCrunch
113 | _NCrunch_*
114 | .*crunch*.local.xml
115 | nCrunchTemp_*
116 |
117 | # MightyMoose
118 | *.mm.*
119 | AutoTest.Net/
120 |
121 | # Web workbench (sass)
122 | .sass-cache/
123 |
124 | # Installshield output folder
125 | [Ee]xpress/
126 |
127 | # DocProject is a documentation generator add-in
128 | DocProject/buildhelp/
129 | DocProject/Help/*.HxT
130 | DocProject/Help/*.HxC
131 | DocProject/Help/*.hhc
132 | DocProject/Help/*.hhk
133 | DocProject/Help/*.hhp
134 | DocProject/Help/Html2
135 | DocProject/Help/html
136 |
137 | # Click-Once directory
138 | publish/
139 |
140 | # Publish Web Output
141 | *.[Pp]ublish.xml
142 | *.azurePubxml
143 | # TODO: Comment the next line if you want to checkin your web deploy settings
144 | # but database connection strings (with potential passwords) will be unencrypted
145 | *.pubxml
146 | *.publishproj
147 |
148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
149 | # checkin your Azure Web App publish settings, but sensitive information contained
150 | # in these scripts will be unencrypted
151 | PublishScripts/
152 |
153 | # NuGet Packages
154 | *.nupkg
155 | # The packages folder can be ignored because of Package Restore
156 | **/packages/*
157 | # except build/, which is used as an MSBuild target.
158 | !**/packages/build/
159 | # Uncomment if necessary however generally it will be regenerated when needed
160 | #!**/packages/repositories.config
161 | # NuGet v3's project.json files produces more ignoreable files
162 | *.nuget.props
163 | *.nuget.targets
164 |
165 | # Microsoft Azure Build Output
166 | csx/
167 | *.build.csdef
168 |
169 | # Microsoft Azure Emulator
170 | ecf/
171 | rcf/
172 |
173 | # Windows Store app package directories and files
174 | AppPackages/
175 | BundleArtifacts/
176 | Package.StoreAssociation.xml
177 | _pkginfo.txt
178 |
179 | # Visual Studio cache files
180 | # files ending in .cache can be ignored
181 | *.[Cc]ache
182 | # but keep track of directories ending in .cache
183 | !*.[Cc]ache/
184 |
185 | # Others
186 | ClientBin/
187 | ~$*
188 | *~
189 | *.dbmdl
190 | *.dbproj.schemaview
191 | *.pfx
192 | *.publishsettings
193 | node_modules/
194 | orleans.codegen.cs
195 |
196 | # Since there are multiple workflows, uncomment next line to ignore bower_components
197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
198 | #bower_components/
199 |
200 | # RIA/Silverlight projects
201 | Generated_Code/
202 |
203 | # Backup & report files from converting an old project file
204 | # to a newer Visual Studio version. Backup files are not needed,
205 | # because we have git ;-)
206 | _UpgradeReport_Files/
207 | Backup*/
208 | UpgradeLog*.XML
209 | UpgradeLog*.htm
210 |
211 | # SQL Server files
212 | *.mdf
213 | *.ldf
214 |
215 | # Business Intelligence projects
216 | *.rdl.data
217 | *.bim.layout
218 | *.bim_*.settings
219 |
220 | # Microsoft Fakes
221 | FakesAssemblies/
222 |
223 | # GhostDoc plugin setting file
224 | *.GhostDoc.xml
225 |
226 | # Node.js Tools for Visual Studio
227 | .ntvs_analysis.dat
228 |
229 | # Visual Studio 6 build log
230 | *.plg
231 |
232 | # Visual Studio 6 workspace options file
233 | *.opt
234 |
235 | # Visual Studio LightSwitch build output
236 | **/*.HTMLClient/GeneratedArtifacts
237 | **/*.DesktopClient/GeneratedArtifacts
238 | **/*.DesktopClient/ModelManifest.xml
239 | **/*.Server/GeneratedArtifacts
240 | **/*.Server/ModelManifest.xml
241 | _Pvt_Extensions
242 |
243 | # Paket dependency manager
244 | .paket/paket.exe
245 | paket-files/
246 |
247 | # FAKE - F# Make
248 | .fake/
249 |
250 | # JetBrains Rider
251 | .idea/
252 | *.sln.iml
253 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | #Contribute to this code sample
2 |
3 | Thank you for your interest in this sample! Your contributions and improvements will help the developer community.
4 |
5 | ##Ways to contribute
6 |
7 | There are several ways you can contribute to this sample: providing better code comments, fixing open issues, and adding new features.
8 |
9 | ###Provide better code comments
10 |
11 | Code comments make code samples even better by helping developers learn to use the code correctly in their own applications. If you spot a class, method, or section of code that you think could use better descriptions, then create a pull request with your code comments.
12 |
13 |
14 | In general we want our code comments to follow these guidelines:
15 |
16 | - Any code that has associated documentation displayed in an IDE (such as IntelliSense, or JavaDocs) has code comments.
17 | - Classes, methods, parameters, and return values have clear descriptions.
18 | - Exceptions and errors are documented.
19 | - Remarks exist for anything special or notable about the code.
20 | - Sections of code that have complex algorithms have appropriate comments describing what they do.
21 | - Code added from Stack Overflow, or any other source, is clearly attributed.
22 |
23 | ###Fix open issues
24 |
25 | Sometimes we get a lot of issues, and it can be hard to keep up. If you have a solution to an open issue that hasn't been addressed, fix the issue and then submit a pull request.
26 |
27 | ###Add a new feature
28 |
29 | New features are great! Be sure to check with the repository admin first to be sure the feature will fit the intent of the sample. Start by opening an issue in the repository that proposes and describes the feature. The repository admin will respond and may ask for more information. If the admin agrees to the new feature, create the feature and submit a pull request.
30 |
31 | ##Contribution guidelines
32 |
33 | We have some guidelines to help maintain a healthy repo and code for everyone.
34 |
35 | ###The Contribution License Agreement
36 |
37 | For most contributions, you'll be asked to sign a Contribution License Agreement (CLA). This will happen when you submit a pull request. Microsoft will send a link to the CLA to sign via email. Once you sign the CLA, your pull request can proceed. Read the CLA carefully, because you may need to have your employer sign it.
38 |
39 | ###Code contribution checklist
40 |
41 | Be sure to satisfy all of the requirements in the following list before submitting a pull request:
42 |
43 | - Follow the code style that is appropriate for the platform and language in this repo. For example, Android code follows the style conventions found in the [Code Style for Contributors guide](https://source.android.com/source/code-style.html).
44 | - Test your code.
45 | - Test the UI thoroughly to be sure nothing has been broken by your change.
46 | - Keep the size of your code change reasonable. if the repository owner cannot review your code change in 4 hours or less, your pull request may not be reviewed and approved quickly.
47 | - Avoid unnecessary changes. The reviewer will check differences between your code and the original code. Whitespace changes are called out along with your code. Be sure your changes will help improve the content.
48 |
49 | ###Submit a pull request to the master branch
50 |
51 | When you're finished with your work and are ready to have it merged into the master repository, follow these steps. Note: pull requests are typically reviewed within 10 business days. If your pull request is accepted you will be credited for your submission.
52 |
53 | 1. Submit your pull request against the master branch.
54 | 2. Sign the CLA, if you haven't already done so.
55 | 3. One of the repo admins will process your pull request, including performing a code review. If there are questions, discussions, or change requests in the pull request, be sure to respond.
56 | 4. When the repo admins are satisfied, they will accept and merge the pull request.
57 |
58 | Congratulations, you have successfully contributed to the sample!
59 |
60 | ##FAQ
61 |
62 | ###Where do I get a Contributor's License Agreement?
63 |
64 | You will automatically be sent a notice that you need to sign the Contributor's License Agreement (CLA) if your pull request requires one.
65 |
66 | As a community member, you must sign the CLA before you can contribute large submissions to this project. You only need complete and submit the CLA document once. Carefully review the document. You may be required to have your employer sign the document.
67 |
68 | ###What happens with my contributions?
69 |
70 | When you submit your changes, via a pull request, our team will be notified and will review your pull request. You will receive notifications about your pull request from GitHub; you may also be notified by someone from our team if we need more information. We reserve the right to edit your submission for legal, style, clarity, or other issues.
71 |
72 | ###Who approves pull requests?
73 |
74 | The admin of the repository approves pull requests.
75 |
76 | ###How soon will I get a response about my change request or issue?
77 |
78 | We typically review pull requests and respond to issues within 10 business days.
79 |
80 | ##More resources
81 |
82 | - To learn more about Markdown, see [Daring Fireball](http://daringfireball.net/).
83 | - To learn more about using Git and GitHub, check out the [GitHub Help section](http://help.github.com/).
84 |
--------------------------------------------------------------------------------
/FileDownloadSample.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileDownloadSample", "FileDownloadSample\FileDownloadSample.csproj", "{8872EC3A-99B7-46B4-A891-B2A2012DA480}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileDownloadSampleWeb", "FileDownloadSampleWeb\FileDownloadSampleWeb.csproj", "{416C74AD-AE8B-41F3-824A-6805318DAD6F}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {8872EC3A-99B7-46B4-A891-B2A2012DA480}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {8872EC3A-99B7-46B4-A891-B2A2012DA480}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {8872EC3A-99B7-46B4-A891-B2A2012DA480}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
19 | {8872EC3A-99B7-46B4-A891-B2A2012DA480}.Release|Any CPU.ActiveCfg = Release|Any CPU
20 | {8872EC3A-99B7-46B4-A891-B2A2012DA480}.Release|Any CPU.Build.0 = Release|Any CPU
21 | {8872EC3A-99B7-46B4-A891-B2A2012DA480}.Release|Any CPU.Deploy.0 = Release|Any CPU
22 | {416C74AD-AE8B-41F3-824A-6805318DAD6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23 | {416C74AD-AE8B-41F3-824A-6805318DAD6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {416C74AD-AE8B-41F3-824A-6805318DAD6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
25 | {416C74AD-AE8B-41F3-824A-6805318DAD6F}.Release|Any CPU.Build.0 = Release|Any CPU
26 | EndGlobalSection
27 | GlobalSection(SolutionProperties) = preSolution
28 | HideSolutionNode = FALSE
29 | EndGlobalSection
30 | EndGlobal
31 |
--------------------------------------------------------------------------------
/FileDownloadSample/FileDownloadSample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {8872EC3A-99B7-46B4-A891-B2A2012DA480}
8 | Library
9 | Properties
10 | FileDownloadSample
11 | FileDownloadSample
12 | v4.5
13 | 15.0
14 | 512
15 | {C1CDDADD-2546-481F-9697-4EA41081F2FC};{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
16 | False
17 | {688c438b-0e15-4e98-b9af-7ce0a2cbcfd6}
18 | {0e889622-ed2c-4f44-801f-6fe91e2787d2}
19 | {cc1729f5-37aa-409b-b274-de5fb3b42739}
20 | {156a5c80-116a-4288-bb0c-16a9fa2f2da6}
21 | {db95ab3b-748d-4f4c-b941-9eb60db4b392}
22 | OfficeApp
23 | 14.0
24 | 14.0
25 |
26 |
27 | true
28 | full
29 | false
30 | bin\Debug\
31 | DEBUG;TRACE
32 | prompt
33 | 4
34 | false
35 |
36 |
37 | pdbonly
38 | true
39 | bin\Release\
40 | TRACE
41 | prompt
42 | 4
43 | false
44 |
45 |
46 |
47 | {edaa08e5-1524-4af3-b014-acd2ab3ca159}
48 |
49 |
50 | manifest-oemanifest
51 | Designer
52 |
53 |
54 |
55 |
56 | {416C74AD-AE8B-41F3-824A-6805318DAD6F}
57 | FileDownloadSampleWeb
58 | True
59 | Web
60 | SharePointWebProjectOutput
61 | FileDownloadSampleWeb
62 | False
63 |
64 |
65 |
66 | 10.0
67 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
68 |
69 |
70 |
--------------------------------------------------------------------------------
/FileDownloadSample/FileDownloadSampleManifest/FileDownloadSample.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
13 |
14 |
15 |
16 | f8d50480-23ad-44e2-9a0f-a48072faf995
17 |
18 |
19 | 1.0.0.0
20 | [Provider name]
21 | en-US
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | ReadWriteDocument
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | ButtonId1
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
--------------------------------------------------------------------------------
/FileDownloadSample/FileDownloadSampleManifest/SharePointProjectItem.spdata:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/FileDownloadSampleWeb.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 |
8 |
9 | 2.0
10 | {416C74AD-AE8B-41F3-824A-6805318DAD6F}
11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
12 | Library
13 | Properties
14 | FileDownloadSampleWeb
15 | FileDownloadSampleWeb
16 | v4.5
17 | true
18 | 44351
19 |
20 |
21 |
22 |
23 |
24 |
25 | 15.0
26 |
27 |
28 | true
29 | full
30 | false
31 | bin\
32 | DEBUG;TRACE
33 | prompt
34 | 4
35 |
36 |
37 | pdbonly
38 | true
39 | bin\
40 | TRACE
41 | prompt
42 | 4
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | Web.config
69 |
70 |
71 | Web.config
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | 10.0
91 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 | True
101 | True
102 | 1572
103 | /
104 | http://localhost:1572/
105 | False
106 | False
107 |
108 |
109 | False
110 |
111 |
112 |
113 |
114 |
121 |
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/Home.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3 | * See LICENSE in the project root for license information.
4 | */
5 |
6 | html, body {
7 | width: 100%;
8 | height: 100%;
9 | margin: 0;
10 | padding: 0;
11 | overflow: auto; }
12 |
13 | body {
14 | position: relative;
15 | font-size: 16px; }
16 |
17 | main {
18 | height: 100%;
19 | overflow-y: auto; }
20 |
21 | footer {
22 | width: 100%;
23 | position: relative;
24 | bottom: 0; }
25 |
26 | p, h1, h2, h3, h4, h5, h6 {
27 | margin: 0;
28 | padding: 0; }
29 |
30 | ul {
31 | padding: 0; }
32 |
33 | .clearfix {
34 | display: block;
35 | clear: both;
36 | height: 0; }
37 |
38 | .pointerCursor {
39 | cursor: pointer; }
40 |
41 | .invisible {
42 | visibility: hidden; }
43 |
44 | .undisplayed {
45 | display: none; }
46 |
47 | .ms-Icon.enlarge {
48 | position: relative;
49 | font-size: 20px;
50 | top: 4px; }
51 |
52 | .ms-landing-page {
53 | display: -webkit-flex;
54 | display: flex;
55 | -webkit-flex-direction: column;
56 | flex-direction: column;
57 | -webkit-flex-wrap: nowrap;
58 | flex-wrap: nowrap;
59 | height: 100%; }
60 | .ms-landing-page__main {
61 | display: -webkit-flex;
62 | display: flex;
63 | -webkit-flex-direction: column;
64 | flex-direction: column;
65 | -webkit-flex-wrap: nowrap;
66 | flex-wrap: nowrap;
67 | -webkit-flex: 1 1 0;
68 | flex: 1 1 0;
69 | height: 100%; }
70 | .ms-landing-page__header {
71 | border-bottom: solid 2px #0078d7;
72 | display: -webkit-inline-flex;
73 | display: inline-flex; }
74 | .ms-landing-page__header--left {
75 | margin-right: 20px;
76 | cursor: pointer; }
77 | .ms-landing-page__header--right {
78 | padding: 10px 20px;
79 | transition: background ease 0.1s, color ease 0.1s;
80 | cursor: pointer; }
81 | .ms-landing-page__header--right:active, .ms-landing-page__header--right:hover {
82 | background: #c7e0f4;
83 | color: #000;
84 | cursor: pointer; }
85 | .ms-landing-page__header--right:active {
86 | background: #c7e0f4;
87 | -webkit-transform: scale3d(0.98, 0.98, 1);
88 | transform: scale3d(0.98, 0.98, 1); }
89 | .ms-landing-page__header--right--disabled {
90 | opacity: 0.6;
91 | pointer-events: none;
92 | cursor: not-allowed; }
93 | .ms-landing-page__header--right--disabled:active, .ms-landing-page__header--right--disabled:hover {
94 | background: transparent; }
95 | .ms-landing-page__header--right--disabled:active {
96 | -webkit-transform: none;
97 | transform: none; }
98 | .ms-landing-page__header--center {
99 | -webkit-flex: 1 1 auto;
100 | flex: 1 1 auto;
101 | display: -webkit-inline-flex;
102 | display: inline-flex;
103 | -webkit-justify-content: flex-start;
104 | justify-content: flex-start;
105 | -webkit-align-items: center;
106 | align-items: center; }
107 | .ms-landing-page__header--center p {
108 | padding: 0 10px;
109 | -webkit-flex: 1 0 0px;
110 | flex: 1 0 0px;
111 | overflow: hidden;
112 | white-space: nowrap;
113 | text-overflow: ellipsis;
114 | text-align: left;
115 | cursor: pointer;
116 | transition: background ease 0.1s, color ease 0.1s;
117 | padding: 10px; }
118 | .ms-landing-page__header--center p:active, .ms-landing-page__header--center p:hover {
119 | background: #c7e0f4;
120 | color: #000;
121 | cursor: pointer; }
122 | .ms-landing-page__header--center p:active {
123 | background: #c7e0f4;
124 | -webkit-transform: scale3d(0.98, 0.98, 1);
125 | transform: scale3d(0.98, 0.98, 1); }
126 | .ms-landing-page__header--center p--disabled {
127 | opacity: 0.6;
128 | pointer-events: none;
129 | cursor: not-allowed; }
130 | .ms-landing-page__header--center p--disabled:active, .ms-landing-page__header--center p--disabled:hover {
131 | background: transparent; }
132 | .ms-landing-page__header--center p--disabled:active {
133 | -webkit-transform: none;
134 | transform: none; }
135 | .ms-landing-page__content {
136 | display: -webkit-flex;
137 | display: flex;
138 | -webkit-flex-direction: column;
139 | flex-direction: column;
140 | -webkit-flex-wrap: nowrap;
141 | flex-wrap: nowrap;
142 | height: 100%;
143 | -webkit-flex: 1 1 0;
144 | flex: 1 1 0;
145 | padding: 20px; }
146 | .ms-landing-page__content h2 {
147 | margin-bottom: 20px; }
148 | .ms-landing-page__footer {
149 | display: -webkit-inline-flex;
150 | display: inline-flex;
151 | -webkit-justify-content: center;
152 | justify-content: center;
153 | -webkit-align-items: center;
154 | align-items: center; }
155 | .ms-landing-page__footer--left {
156 | transition: background ease 0.1s, color ease 0.1s;
157 | display: -webkit-inline-flex;
158 | display: inline-flex;
159 | -webkit-justify-content: flex-start;
160 | justify-content: flex-start;
161 | -webkit-align-items: center;
162 | align-items: center;
163 | -webkit-flex: 1 0 0px;
164 | flex: 1 0 0px;
165 | padding: 20px; }
166 | .ms-landing-page__footer--left:active, .ms-landing-page__footer--left:hover {
167 | background: #005ca4;
168 | cursor: pointer; }
169 | .ms-landing-page__footer--left:active {
170 | background: #005ca4; }
171 | .ms-landing-page__footer--left--disabled {
172 | opacity: 0.6;
173 | pointer-events: none;
174 | cursor: not-allowed; }
175 | .ms-landing-page__footer--left--disabled:active, .ms-landing-page__footer--left--disabled:hover {
176 | background: transparent; }
177 | .ms-landing-page__footer--left img {
178 | width: 40px;
179 | height: 40px; }
180 | .ms-landing-page__footer--left h1 {
181 | -webkit-flex: 1 0 0px;
182 | flex: 1 0 0px;
183 | margin-left: 15px;
184 | text-align: left;
185 | width: auto;
186 | max-width: auto;
187 | overflow: hidden;
188 | white-space: nowrap;
189 | text-overflow: ellipsis; }
190 | .ms-landing-page__footer--right {
191 | transition: background ease 0.1s, color ease 0.1s;
192 | padding: 29px 20px; }
193 | .ms-landing-page__footer--right:active, .ms-landing-page__footer--right:hover {
194 | background: #005ca4;
195 | cursor: pointer; }
196 | .ms-landing-page__footer--right:active {
197 | background: #005ca4; }
198 | .ms-landing-page__footer--right--disabled {
199 | opacity: 0.6;
200 | pointer-events: none;
201 | cursor: not-allowed; }
202 | .ms-landing-page__footer--right--disabled:active, .ms-landing-page__footer--right--disabled:hover {
203 | background: transparent; }
204 |
205 | .demo-placeholder {
206 | margin-bottom: 20px;
207 | width: 100%; }
208 | .demo-placeholder__img {
209 | width: 60px;
210 | height: 60px;
211 | background-color: #F4F4F4;
212 | display: block;
213 | margin-bottom: 10px; }
214 | .demo-placeholder__text {
215 | height: 5px;
216 | background-color: #F4F4F4;
217 | display: block;
218 | margin-bottom: 10px; }
219 | .demo-placeholder__text--half {
220 | width: 60%; }
221 | .demo-placeholder__text--para {
222 | height: 40px; }
223 | .demo-placeholder__button {
224 | width: 150px;
225 | height: 40px;
226 | margin: 0 auto;
227 | margin-bottom: 20px; }
228 |
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/Home.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | File download (code sample)
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | File download code sample
27 |
28 | Click a button to get started downloading a file.
29 |
30 |
31 |
32 |
33 |
38 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/Home.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3 | * See LICENSE in the project root for license information.
4 | */
5 |
6 |
7 | (function () {
8 | "use strict";
9 |
10 | // The initialize function must be defined in each page of your add-in.
11 | Office.initialize = function (reason) {
12 |
13 | // A function must be assigned to Office.initialize. You can also include initialization code here. In
14 | // this code sample, we don't have anything to initialize.
15 |
16 | };
17 |
18 | $(document).ready(function () {
19 | // Initialize the UI
20 | $('#button-text1').text("Download file");
21 | $('#button-desc1').text("Download file");
22 | $('#btnDownload1').click(
23 | downloadFile);
24 |
25 | $('#button-text2').text("Insert download link");
26 | $('#button-desc2').text("Insert download link");
27 | $('#btnDownload2').click(
28 | InsertURL);
29 | });
30 |
31 | var downloadUri = location.origin + '/testdata.pdf'; // PDF file to download from the remote server.
32 |
33 | /*
34 | For all Office clients and browsers, except Safari, the user gets prompted to save the file.
35 | In Safari, the file is opened in another tab and the user manually chooses where to save the file.
36 | */
37 | function downloadFile() {
38 | // The following line is taken from http://stackoverflow.com/questions/7944460/detect-safari-browser
39 | if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
40 | insertAndClickLink();
41 | }
42 | else {
43 | // First download the file, then prompt the user to save it.
44 | // This function uses the file-saver.js library.
45 | getFile(downloadUri)
46 | .then(function (file) {
47 | saveAs(file, "myfile.pdf");
48 | })
49 | .catch(function (e) {
50 | console.error(e);
51 | });
52 | }
53 | }
54 |
55 | /*
56 | Downloads the file from the remote server.
57 | */
58 | function getFile(url) {
59 | return new OfficeExtension.Promise(function (resolve, reject) {
60 | // Use XHR to fetch the file from the remote server.
61 | var xhr = new XMLHttpRequest();
62 | xhr.open('GET', url, true);
63 | xhr.responseType = 'blob';
64 |
65 | xhr.onload = function () {
66 | try {
67 | if (xhr.status === 200) {
68 | resolve(xhr.response);
69 | }
70 | else if (xhr.status !== 200) {
71 | reject({
72 | error: 'Request failed. ' + xhr.response
73 | });
74 | }
75 | } catch (e) {
76 | reject({
77 | error: e
78 | });
79 | }
80 | };
81 | xhr.send();
82 | });
83 | }
84 |
85 | /*
86 | The following solution programmatically inserts a link and clicks it.
87 | Use with Safari browsers.
88 | */
89 | function insertAndClickLink() {
90 |
91 | //Taken from http://stackoverflow.com/questions/3077242/force-download-a-pdf-link-using-javascript-ajax-jquery/29266135#29266135
92 | try {
93 | if (!window.ActiveXObject) {
94 | var save = document.createElement('a');
95 | save.href = downloadUri;
96 | save.target = '_blank';
97 | save.download = "myfile.pdf" || 'unknown';
98 |
99 | var evt = new MouseEvent('click', {
100 | 'view': window,
101 | 'bubbles': true,
102 | 'cancelable': false
103 | });
104 |
105 | save.dispatchEvent(evt);
106 | (window.URL || window.webkitURL).revokeObjectURL(save.href);
107 | }
108 | }
109 | catch (e) {
110 | console.error(e);
111 | }
112 | }
113 |
114 | /*
115 | This function inserts a URL into a DIV tag, which the user then clicks. This provides a good fallback experience.
116 | */
117 | function InsertURL() {
118 | $("#InsertURL").append("PDF");
119 | }
120 | })();
121 |
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/Images/Button16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-Add-in-JavaScript-FileDownload/d1fa2095149b8f31314b1912d7c50556e519addd/FileDownloadSampleWeb/Images/Button16x16.png
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/Images/Button32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-Add-in-JavaScript-FileDownload/d1fa2095149b8f31314b1912d7c50556e519addd/FileDownloadSampleWeb/Images/Button32x32.png
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/Images/Button80x80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-Add-in-JavaScript-FileDownload/d1fa2095149b8f31314b1912d7c50556e519addd/FileDownloadSampleWeb/Images/Button80x80.png
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/Images/Close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-Add-in-JavaScript-FileDownload/d1fa2095149b8f31314b1912d7c50556e519addd/FileDownloadSampleWeb/Images/Close.png
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/Images/logo-filled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-Add-in-JavaScript-FileDownload/d1fa2095149b8f31314b1912d7c50556e519addd/FileDownloadSampleWeb/Images/logo-filled.png
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FileDownloadSampleWeb")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("FileDownloadSampleWeb")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("416c74ad-ae8b-41f3-824a-6805318dad6f")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/Scripts/_references.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-Add-in-JavaScript-FileDownload/d1fa2095149b8f31314b1912d7c50556e519addd/FileDownloadSampleWeb/Scripts/_references.js
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/FileDownloadSampleWeb/testdata.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-Add-in-JavaScript-FileDownload/d1fa2095149b8f31314b1912d7c50556e519addd/FileDownloadSampleWeb/testdata.pdf
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Word Add-in File Download
2 |
3 | Copyright (c) Microsoft Corporation. All rights reserved.
4 |
5 | MIT License
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining
8 | a copy of this software and associated documentation files (the
9 | "Software"), to deal in the Software without restriction, including
10 | without limitation the rights to use, copy, modify, merge, publish,
11 | distribute, sublicense, and/or sell copies of the Software, and to
12 | permit persons to whom the Software is furnished to do so, subject to
13 | the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be
16 | included in all copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 |
--------------------------------------------------------------------------------
/Office-Add-in-JavaScript-FileDownload.yml:
--------------------------------------------------------------------------------
1 | ### YamlMime:Sample
2 | sample:
3 | - name: Download files in a Word Web Add-in
4 | path: ''
5 | description: This code sample teaches you the different techniques for downloading files programmatically in an Office Add-in.
6 | readme: ''
7 | generateZip: FALSE
8 | isLive: TRUE
9 | technologies:
10 | - Office Add-in
11 | azureDeploy: ''
12 | author: rick-kirkham
13 | platforms: []
14 | languages:
15 | - JavaScript
16 | extensions:
17 | products:
18 | - Word
19 | - Word for Mac
20 | scenarios: []
21 |
--------------------------------------------------------------------------------
/README-Localized/README-de-de.md:
--------------------------------------------------------------------------------
1 | # Herunterladen von Dateien in ein Word-Web-Add-In
2 |
3 | In diesem Codebeispiel erlernen Sie die verschiedenen Techniken zum programmgesteuerten Herunterladen von Dateien in ein Office-Add-In. In anderen Office-Hosts und -Browsern (bei Verwendung von Office Online) werden Dateien unterschiedlich behandelt. Wenn Sie eine einheitliche Umgebung zum Herunterladen von Dateien bereitstellen möchten, verwenden Sie die in diesem Codebeispiel erläuterten Techniken. In diesem Codebeispiel wird außerdem gezeigt, wie Sie eine alternative Methode bereitstellen können, wenn der Office-Host oder -Browser eine der anderen Methoden nicht unterstützt.
4 |
5 | ## Inhalt
6 | * [Änderungsverlauf](#change-history)
7 | * [Voraussetzungen](#prerequisites)
8 | * [In diesem Add-In verwendete Entwurfsvorlagen](#design-templates-used-in-this-add-in)
9 | * [Abrufen der FileSaver-Bibliothek](#get-the-filesaver-library)
10 | * [Ausführen des Projekts](#run-the-project)
11 | * [Fragen und Kommentare](#questions-and-comments)
12 | * [Zusätzliche Ressourcen](#additional-resources)
13 |
14 | ## Änderungsverlauf
15 |
16 | 3. November 2016:
17 |
18 | * Ursprüngliche Version
19 |
20 | ## Voraussetzungen
21 |
22 | * Word 2016 für Windows (Build 16.0.6727.1000 oder höher), Word Online oder Word für Mac (Build 15.26 oder höher)
23 | * Visual Studio 2015
24 |
25 | ## In diesem Add-In verwendete Entwurfsvorlagen
26 |
27 | - Zielseite
28 |
29 | Weitere Informationen zu den Entwurfsmustern finden Sie unter [UX-Entwurfsmustervorlagen für Office-Add-Ins](https://dev.office.com/docs/add-ins/design/ux-design-patterns). Informationen zu Beispielimplementierungen finden Sie unter [Office-Add-in-UX-Design-Patterns-Code](https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns-Code).
30 |
31 | ## Abrufen der FileSaver-Bibliothek
32 |
33 | In diesem Codebeispiel wird die FileSaver.js-Bibliothek verwendet. Gehen Sie wie folgt vor, nachdem Sie dieses Repository geklont haben.
34 |
35 | 1. Klionen Sie das Repository [FileSaver.js](https://github.com/eligrey/FileSaver.js/).
36 | 2. Kopieren Sie die Datei **FileSaver.min.js** in den Ordner **Skripts** in diesem Codebeispiel.
37 | 3. Fügen Sie in „Home.html“ ein Skripttag hinzu, um auf die Datei „FileSaver.min.js“ zu verweisen.
38 |
39 |
40 | ## Ausführen des Projekts
41 |
42 | 1. Öffnen Sie die Visual Studio-Projektmappe.
43 | 2. Drücken Sie **F5**.
44 | 3. Wenn Word geöffnet wird, klicken Sie auf die Schaltfläche **Dateidownload** am rechten Ende des Menübands **Start**. Das Add-In wird in einem Aufgabenbereich geöffnet.
45 | 4. Wählen Sie die Schaltfläche **Downloaddatei** oder **Downloadlink einfügen** aus.
46 |
47 | ## Fragen und Kommentare
48 |
49 | Wir schätzen Ihr Feedback hinsichtlich dieses Beispiels. Sie können uns Ihr Feedback über den Abschnitt *Probleme* dieses Repositorys senden.
50 |
51 | Fragen zur Microsoft Office 365-Entwicklung sollten in [Stack Overflow](http://stackoverflow.com/questions/tagged/office-js+API) gestellt werden. Wenn Ihre Frage die Office JavaScript-APIs betrifft, sollte die Frage mit [office-js] und [API] kategorisiert sein.
52 |
53 | ## Zusätzliche Ressourcen
54 |
55 | *
56 | [Dokumentation zu Office-Add-Ins](https://dev.office.com/docs/add-ins/overview/office-add-ins)
57 | * [Office Dev Center](http://dev.office.com/)
58 | * Weitere Office-Add-In-Beispiele unter [OfficeDev auf Github](https://github.com/officedev)
59 |
60 | ## Copyright
61 | Copyright (c) 2016 Microsoft Corporation. Alle Rechte vorbehalten.
62 |
63 |
64 |
65 | In diesem Projekt wurden die [Microsoft Open Source-Verhaltensregeln](https://opensource.microsoft.com/codeofconduct/) übernommen. Weitere Informationen finden Sie unter [Häufig gestellte Fragen zu Verhaltensregeln](https://opensource.microsoft.com/codeofconduct/faq/), oder richten Sie Ihre Fragen oder Kommentare an [opencode@microsoft.com](mailto:opencode@microsoft.com).
66 |
--------------------------------------------------------------------------------
/README-Localized/README-es-es.md:
--------------------------------------------------------------------------------
1 | # Descargar archivos en un complemento web de Word
2 |
3 | Con este ejemplo de código se explican las distintas técnicas para descargar archivos mediante programación en un complemento web de Office. Los diferentes hosts y exploradores de Office (al utilizar Office Online) pueden gestionar los archivos de distinta forma. Si quiere ofrecer una descarga de archivos uniforme, utilice las técnicas que se indican en este ejemplo de código. En dicho ejemplo también se muestra cómo proporcionar un mecanismo de reserva en caso de que el host o explorador de Office no sea compatible con uno de los otros métodos.
4 |
5 | ## Tabla de contenido
6 | * [Historial de cambios](#change-history)
7 | * [Requisitos previos](#prerequisites)
8 | * [Plantillas de diseño usadas en este complemento](#design-templates-used-in-this-add-in)
9 | * [Obtener la biblioteca de FileSaver](#get-the-filesaver-library)
10 | * [Ejecutar el proyecto](#run-the-project)
11 | * [Preguntas y comentarios](#questions-and-comments)
12 | * [Recursos adicionales](#additional-resources)
13 |
14 | ## Historial de cambios
15 |
16 | 3 de noviembre de 2016:
17 |
18 | * Versión inicial.
19 |
20 | ## Requisitos previos
21 |
22 | * Word 2016 para Windows (compilación 16.0.6727.1000 o posteriores), Word Online o Word para Mac (compilación 15.26 o posteriores).
23 | * Visual Studio 2015
24 |
25 | ## Plantillas de diseño usadas en este complemento
26 |
27 | - Página de aterrizaje
28 |
29 | Para obtener más información sobre los modelos de diseño, vea [Plantillas de modelos de diseño de la experiencia del usuario para complementos de Office](https://dev.office.com/docs/add-ins/design/ux-design-patterns). También puede ver las implementaciones de ejemplos en [Office-Add-in-UX-Design-Patterns-Code](https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns-Code).
30 |
31 | ## Obtener la biblioteca de FileSaver
32 |
33 | En este ejemplo de código se utiliza la biblioteca de FileSaver.js. Siga estos pasos después de clonar este repositorio.
34 |
35 | 1. Clone el repositorio de [FileSaver.js](https://github.com/eligrey/FileSaver.js/).
36 | 2. Copie el archivo **FileSaver.min.js** a la carpeta **Scripts** de este ejemplo de código.
37 | 3. En Home.html, agregue una etiqueta de script para hacer referencia al archivo FileSaver.min.js.
38 |
39 |
40 | ## Ejecutar el proyecto
41 |
42 | 1. Abra el archivo de solución de Visual Studio.
43 | 2. Pulse **F5**.
44 | 3. Cuando se abra Word, haga clic en el botón **Descarga de archivos** del extremo derecho de la pestaña **Inicio** de la cinta de opciones. Se abrirá el complemento en un panel de tareas.
45 | 4. Elija los botones **Descargar archivo** o **Insertar vínculo de descarga**.
46 |
47 | ## Preguntas y comentarios
48 |
49 | Nos encantaría recibir sus comentarios sobre este ejemplo. Puede enviarnos comentarios a través de la sección *Problemas* de este repositorio.
50 |
51 | Las preguntas generales sobre el desarrollo de Microsoft Office 365 deben publicarse en [Desbordamiento de pila](http://stackoverflow.com/questions/tagged/office-js+API). Si su pregunta trata sobre las API de JavaScript para Office, asegúrese de que su pregunta se etiqueta con [office-js] y [API].
52 |
53 | ## Recursos adicionales
54 |
55 | *
56 | [Documentación de complementos de Office](https://dev.office.com/docs/add-ins/overview/office-add-ins)
57 | * [Centro de desarrollo de Office](http://dev.office.com/)
58 | * Más ejemplos de complementos de Office en [OfficeDev en GitHub](https://github.com/officedev)
59 |
60 | ## Copyright
61 | Copyright (c) 2016 Microsoft Corporation. Todos los derechos reservados.
62 |
63 |
64 |
65 | Este proyecto ha adoptado el [Código de conducta de código abierto de Microsoft](https://opensource.microsoft.com/codeofconduct/). Para obtener más información, consulte las [preguntas más frecuentes sobre el Código de conducta](https://opensource.microsoft.com/codeofconduct/faq/) o póngase en contacto con [opencode@microsoft.com](mailto:opencode@microsoft.com) si tiene otras preguntas o comentarios.
66 |
--------------------------------------------------------------------------------
/README-Localized/README-fr-fr.md:
--------------------------------------------------------------------------------
1 | # Télécharger des fichiers dans un complément web Word
2 |
3 | Cet exemple de code montre les différentes techniques pour télécharger des fichiers par programme dans un complément Office. Les différents navigateurs et hôtes Office (lorsque vous utilisez Office Online) peuvent gérer les fichiers différemment. Si vous souhaitez offrir une expérience uniforme pour le téléchargement de fichiers, utilisez les techniques décrites dans cet exemple de code. Cet exemple vous montre également comment fournir un mécanisme de secours si l’hôte ou le navigateur Office ne prend en charge une des autres méthodes.
4 |
5 | ## Sommaire
6 | * [Historique des modifications](#change-history)
7 | * [Conditions préalables](#prerequisites)
8 | * [Modèles de conception utilisés dans ce complément](#design-templates-used-in-this-add-in)
9 | * [Obtenir la bibliothèque FileSaver](#get-the-filesaver-library)
10 | * [Exécution du projet](#run-the-project)
11 | * [Questions et commentaires](#questions-and-comments)
12 | * [Ressources supplémentaires](#additional-resources)
13 |
14 | ## Historique des modifications
15 |
16 | 3 novembre 2016 :
17 |
18 | * Version d’origine.
19 |
20 | ## Configuration requise
21 |
22 | * Word 2016 pour Windows (build 16.0.6727.1000 ou ultérieur), Word Online ou Word pour Mac (build 15.26 ou ultérieur).
23 | * Visual Studio 2015
24 |
25 | ## Modèles de conception utilisés dans le complément
26 |
27 | - Page d’accueil
28 |
29 | Pour plus d’informations sur les modèles de conception, voir l’article sur les [modèles de conception de l’expérience utilisateur pour les compléments Office](https://dev.office.com/docs/add-ins/design/ux-design-patterns). Pour obtenir des exemples d’implémentation, voir [Office-Add-in-UX-Design-Patterns-Code](https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns-Code).
30 |
31 | ## Obtenir la bibliothèque FileSaver
32 |
33 | Cet exemple utilise la bibliothèque FileSaver.js. Une fois que vous avez cloné ce référentiel, procédez comme suit.
34 |
35 | 1. Clonez le référentiel [FileSaver.js](https://github.com/eligrey/FileSaver.js/).
36 | 2. Copiez le fichier **FileSaver.min.js** dans le dossier **Scripts** de cet exemple de code.
37 | 3. Dans Home.html, ajoutez une balise de script pour faire référence au fichier FileSaver.min.js.
38 |
39 |
40 | ## Exécuter le projet
41 |
42 | 1. Ouvrez le fichier de solution Visual Studio.
43 | 2. Appuyez sur la touche **F5**.
44 | 3. Quand Word s’ouvre, cliquez sur le bouton **Téléchargement de fichier** situé sur l’extrémité droite du ruban **Accueil**. Le complément s’ouvre dans un volet Office.
45 | 4. Sélectionnez le bouton **Télécharger un fichier** ou **Insérer un lien de téléchargement**.
46 |
47 | ## Questions et commentaires
48 |
49 | Nous serions ravis de connaître votre opinion sur cet exemple. Vous pouvez nous envoyer vos commentaires via la section *Problèmes* de ce référentiel.
50 |
51 | Les questions générales sur le développement de Microsoft Office 365 doivent être publiées sur [Stack Overflow](http://stackoverflow.com/questions/tagged/office-js+API). Si votre question concerne les API Office JavaScript, assurez-vous qu’elle est marquée avec les balises [office js] et [API].
52 |
53 | ## Ressources supplémentaires
54 |
55 | *
56 | [Documentation de complément Office](https://dev.office.com/docs/add-ins/overview/office-add-ins)
57 | * [Centre de développement Office](http://dev.office.com/)
58 | * Plus d’exemples de complément Office sur [OfficeDev sur Github](https://github.com/officedev)
59 |
60 | ## Copyright
61 | Copyright (c) 2016 Microsoft Corporation. Tous droits réservés.
62 |
63 |
64 |
65 | Ce projet a adopté le [code de conduite Open Source de Microsoft](https://opensource.microsoft.com/codeofconduct/). Pour plus d’informations, reportez-vous à la [FAQ relative au code de conduite](https://opensource.microsoft.com/codeofconduct/faq/) ou contactez [opencode@microsoft.com](mailto:opencode@microsoft.com) pour toute question ou tout commentaire.
66 |
--------------------------------------------------------------------------------
/README-Localized/README-ja-jp.md:
--------------------------------------------------------------------------------
1 | # Word Web アドインでファイルをダウンロードする
2 |
3 | このコード サンプルでは、Office アドインでプログラムを使用してファイルをダウンロードするためのさまざまな手法を説明します。異なる Office ホストとブラウザー (Office Online を使用する場合) では、ファイルの処理方法が異なる場合があります。ファイルのダウンロードの操作性を統一する場合は、このコード サンプルで示す手法を使用します。このサンプル コードでは、Office ホストまたはブラウザーが他のメソッドのいずれかをサポートしていない場合にフォールバック メカニズムを提供する方法も示します。
4 |
5 | ## 目次
6 | * [変更履歴](#change-history)
7 | * [前提条件](#prerequisites)
8 | * [このアドインで使用されるデザイン テンプレート](#design-templates-used-in-this-add-in)
9 | * [FileSaver ライブラリを取得する](#get-the-filesaver-library)
10 | * [プロジェクトを実行する](#run-the-project)
11 | * [質問とコメント](#questions-and-comments)
12 | * [その他のリソース](#additional-resources)
13 |
14 | ## 変更履歴
15 |
16 | 2016 年 11 月 3 日:
17 |
18 | * 初期バージョン。
19 |
20 | ## 前提条件
21 |
22 | * Word 2016 for Windows (ビルド 16.0.6727.1000 以降)、Word Online、または Word for Mac (ビルド 15.26 以降)。
23 | * Visual Studio 2015
24 |
25 | ## このアドインで使用されるデザイン テンプレート
26 |
27 | - ランディング ページ
28 |
29 | デザイン パターンの詳細については、「[Office アドインの UX デザイン パターンのテンプレート](https://dev.office.com/docs/add-ins/design/ux-design-patterns)」を参照してください。サンプルの実装については、「[Office-Add-in-UX-Design-Patterns-Code](https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns-Code)」を参照してください。
30 |
31 | ## FileSaver ライブラリを取得する
32 |
33 | このコード サンプルでは、FileSaver.js ライブラリを使用します。このリポジトリを複製した後、次の手順を実行します。
34 |
35 | 1. [FileSaver.js](https://github.com/eligrey/FileSaver.js/) リポジトリを複製します。
36 | 2. **FileSaver.min.js** ファイルをこのコード サンプルの**スクリプト** フォルダーにコピーします。
37 | 3. Home.html で、FileSaver.min.js ファイルを参照するスクリプト タグを追加します。
38 |
39 |
40 | ## プロジェクトを実行する
41 |
42 | 1. Visual Studio ソリューション ファイルを開きます。
43 | 2. **F5** キーを押します。
44 | 3. Word が開いたら、**[ホーム]** リボンの右端にある **[ファイル ダウンロード]** ボタンをクリックします。アドインが作業ウィンドウで開きます。
45 | 4. **[ダウンロード ファイル]** または **[ダウンロード リンクの挿入]** ボタンを選択します。
46 |
47 | ## 質問とコメント
48 |
49 | このサンプルに関するフィードバックをお寄せください。このリポジトリの「*問題*」セクションでフィードバックを送信できます。
50 |
51 | Microsoft Office 365 開発全般の質問につきましては、「[スタック オーバーフロー](http://stackoverflow.com/questions/tagged/office-js+API)」に投稿してください。Office JavaScript API に関する質問の場合は、必ず質問に [office-js] と [API] のタグを付けてください。
52 |
53 | ## 追加リソース
54 |
55 | * [Office アドインのドキュメント](https://dev.office.com/docs/add-ins/overview/office-add-ins)
56 | * [Office デベロッパー センター](http://dev.office.com/)
57 | * [Github の OfficeDev](https://github.com/officedev) にあるその他の Office アドイン サンプル
58 |
59 | ## 著作権
60 | Copyright (c) 2016 Microsoft Corporation.All rights reserved.
61 |
62 |
63 |
64 | このプロジェクトでは、[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) が採用されています。詳細については、「[Code of Conduct の FAQ](https://opensource.microsoft.com/codeofconduct/faq/)」を参照してください。また、その他の質問やコメントがあれば、[opencode@microsoft.com](mailto:opencode@microsoft.com) までお問い合わせください。
65 |
--------------------------------------------------------------------------------
/README-Localized/README-pt-br.md:
--------------------------------------------------------------------------------
1 | # Baixar arquivos em um Suplemento da Web do Word
2 |
3 | Este exemplo de código mostra as várias técnicas disponíveis para baixar arquivos de forma programática em um suplemento do Office. Os diversos navegadores e hosts do Office (durante o uso do Office Online) podem tratar os arquivos de forma diferente. Se você pretende fornecer uma experiência de download de arquivos uniforme, use as técnicas demonstradas neste exemplo de código. O exemplo de código mostra também como fornecer um mecanismo de fallback se o host do Office ou o navegador não tiver suporte para um dos outros métodos.
4 |
5 | ## Sumário
6 | * [Histórico de Alterações](#change-history)
7 | * [Pré-requisitos](#prerequisites)
8 | * [Modelos de design usados neste suplemento](#design-templates-used-in-this-add-in)
9 | * [Obter a biblioteca FileSaver](#get-the-filesaver-library)
10 | * [Executar o projeto](#run-the-project)
11 | * [Perguntas e comentários](#questions-and-comments)
12 | * [Recursos adicionais](#additional-resources)
13 |
14 | ## Histórico de Alterações
15 |
16 | 3 de novembro de 2016:
17 |
18 | * Versão inicial.
19 |
20 | ## Pré-requisitos
21 |
22 | * Word 2016 para Windows (build 16.0.6727.1000 ou posterior), Word Online ou Word para Mac (build 15.26 ou posterior).
23 | * Visual Studio 2015
24 |
25 | ## Modelos de design usados neste suplemento
26 |
27 | - Página de aterrissagem
28 |
29 | Para saber mais sobre os padrões de design, confira [Modelos de padrão de design da experiência do usuário para suplementos do Office](https://dev.office.com/docs/add-ins/design/ux-design-patterns). Para obter exemplos de implementações, confira [Office-Add-in-UX-Design-Patterns-Code](https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns-Code).
30 |
31 | ## Obter a biblioteca FileSaver
32 |
33 | Este exemplo de código usa a biblioteca FileSaver.js. Após clonar este repositório, execute os procedimentos a seguir.
34 |
35 | 1. Faça a clonagem do repositório [FileSaver.js](https://github.com/eligrey/FileSaver.js/).
36 | 2. Copie o arquivo **FileSaver.min.js** para a pasta **Scripts** deste exemplo de código.
37 | 3. Em Home.html, adicione uma marca de script ao arquivo FileSaver.min.js.
38 |
39 |
40 | ## Executar o projeto
41 |
42 | 1. Abra o arquivo de solução do Visual Studio.
43 | 2. Pressione **F5**.
44 | 3. Quando o Word abrir, clique no botão **Download de arquivo**, na extremidade direita da faixa de opções da **Página Inicial**. O suplemento é aberto em um painel de tarefas.
45 | 4. Escolha os botões **Baixar arquivo** ou **Inserir link de download**.
46 |
47 | ## Perguntas e comentários
48 |
49 | Gostaríamos de saber sua opinião sobre este exemplo. Você pode nos enviar comentários na seção *Issues* deste repositório.
50 |
51 | As perguntas sobre o desenvolvimento do Microsoft Office 365 em geral devem ser postadas no [Stack Overflow](http://stackoverflow.com/questions/tagged/office-js+API). Se sua pergunta estiver relacionada às APIs JavaScript para Office, não deixe de marcá-la com as tags [office-js] e [API].
52 |
53 | ## Recursos adicionais
54 |
55 | *
56 | [Documentação dos suplementos do Office](https://dev.office.com/docs/add-ins/overview/office-add-ins)
57 | * [Centro de Desenvolvimento do Office](http://dev.office.com/)
58 | * Confira outros exemplos de Suplemento do Office em [OfficeDev no Github](https://github.com/officedev)
59 |
60 | ## Copyright
61 | Copyright (c) 2016 Microsoft Corporation. Todos os direitos reservados.
62 |
63 |
64 |
65 | Este projeto adotou o [Código de Conduta de Software Livre da Microsoft](https://opensource.microsoft.com/codeofconduct/). Para saber mais, confira as [Perguntas frequentes sobre o Código de Conduta](https://opensource.microsoft.com/codeofconduct/faq/) ou contate [opencode@microsoft.com](mailto:opencode@microsoft.com) se tiver outras dúvidas ou comentários.
66 |
--------------------------------------------------------------------------------
/README-Localized/README-ru-ru.md:
--------------------------------------------------------------------------------
1 | # Скачивание файлов в веб-надстройке Word
2 |
3 | Из этого примера кода вы узнаете, как скачивать файлы в надстройке Office программным путем. Разные основные приложения Office и браузеры (при работе с Office Online) могут обрабатывать файлы по-разному. Чтобы унифицировать скачивание файлов, используйте методы, показанные в этом примере кода. В этом примере кода также показано, как обеспечить резервный механизм, если основное приложение Office или браузер не поддерживает один из методов.
4 |
5 | ## Содержание
6 | * [История изменений](#change-history)
7 | * [Необходимые компоненты](#prerequisites)
8 | * [Шаблоны оформления, используемые в этой надстройке](#design-templates-used-in-this-add-in)
9 | * [Получение библиотеки FileSaver](#get-the-filesaver-library)
10 | * [Запуск проекта](#run-the-project)
11 | * [Вопросы и комментарии](#questions-and-comments)
12 | * [Дополнительные ресурсы](#additional-resources)
13 |
14 | ## История изменений
15 |
16 | 3 ноября 2016 г.
17 |
18 | * Исходная версия.
19 |
20 | ## Необходимые компоненты
21 |
22 | * Word 2016 для Windows (сборка 16.0.6727.1000 или более новая), Word Online или Word для Mac (сборка 15.26 или более новая).
23 | * Visual Studio 2015
24 |
25 | ## Шаблоны оформления, используемые в этой надстройке
26 |
27 | - Целевая страница
28 |
29 | Дополнительные сведения о шаблонах оформления см. в статье [Конструктивные шаблоны пользовательского интерфейса надстроек Office](https://dev.office.com/docs/add-ins/design/ux-design-patterns). Примеры реализации см. в статье [Office-Add-in-UX-Design-Patterns-Code](https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns-Code).
30 |
31 | ## Получение библиотеки FileSaver
32 |
33 | В этом примере кода используется библиотека FileSaver.js. После клонирования этого репозитория выполните указанные ниже действия.
34 |
35 | 1. Склонируйте репозиторий [FileSaver.js](https://github.com/eligrey/FileSaver.js/).
36 | 2. Скопируйте файл **FileSaver.min.js** в папку **Scripts** в этом примере кода.
37 | 3. В файле Home.html добавьте тег сценария для ссылки на файл FileSaver.min.js.
38 |
39 |
40 | ## Запуск проекта
41 |
42 | 1. Откройте файл решения в Visual Studio.
43 | 2. Нажмите клавишу **F5**.
44 | 3. Когда Word откроется, нажмите кнопку **File download** (Скачивание файлов) в правой части ленты **Главная**. Надстройка откроется в области задач.
45 | 4. Нажмите кнопку **Download file** (Скачать файл) или **Insert download link** (Вставить ссылку для скачивания).
46 |
47 | ## Вопросы и комментарии
48 |
49 | Мы будем рады узнать ваше мнение об этом примере. Своими мыслями можете поделиться на вкладке *Issues* (Проблемы) этого репозитория.
50 |
51 | Общие вопросы о разработке решений для Microsoft Office 365 следует задавать на сайте [Stack Overflow](http://stackoverflow.com/questions/tagged/office-js+API). Если ваш вопрос касается API JavaScript для Office, добавьте к нему теги [office-js] и [API].
52 |
53 | ## Дополнительные ресурсы
54 |
55 | *
56 | [Документация по надстройкам Office](https://dev.office.com/docs/add-ins/overview/office-add-ins)
57 | * [Центр разработки для Office](http://dev.office.com/)
58 | * Другие примеры надстроек Office см. на странице [OfficeDev на Github](https://github.com/officedev).
59 |
60 | ## Авторское право
61 | © Корпорация Майкрософт (Microsoft Corporation), 2016. Все права защищены.
62 |
63 |
64 |
65 | Этот проект соответствует [правилам поведения Майкрософт, касающимся обращения с открытым кодом](https://opensource.microsoft.com/codeofconduct/). Дополнительную информацию см. в разделе [часто задаваемых вопросов по правилам поведения](https://opensource.microsoft.com/codeofconduct/faq/). Если у вас возникли вопросы или замечания, напишите нам по адресу [opencode@microsoft.com](mailto:opencode@microsoft.com).
66 |
--------------------------------------------------------------------------------
/README-Localized/README-zh-cn.md:
--------------------------------------------------------------------------------
1 | # 在 Word Web 外接程序中下载文件
2 |
3 | 此示例代码展示了在 Office 外接程序中以编程方式下载文件的不同技巧。不同的 Office 主机和浏览器(若使用 Office Online)处理文件的方式可能也不同。若要提供一致的下载体验,请使用此示例代码中展示的技巧。此示例代码还展示了如何在 Office 主机或浏览器不支持其他一种方法时提供回退机制。
4 |
5 | ## 目录
6 | * [修订记录](#change-history)
7 | * [先决条件](#prerequisites)
8 | * [此外接程序中使用的设计模板](#design-templates-used-in-this-add-in)
9 | * [获取 FileSaver 库](#get-the-filesaver-library)
10 | * [运行项目](#run-the-project)
11 | * [问题和意见](#questions-and-comments)
12 | * [其他资源](#additional-resources)
13 |
14 | ## 修订记录
15 |
16 | 2016 年 11 月 3 日:
17 |
18 | * 首版。
19 |
20 | ## 系统必备
21 |
22 | * Word 2016 for Windows(内部版本 16.0.6727.1000 或更高版本)、Word Online 或 Word for Mac(内部版本 15.26 或更高版本)。
23 | * Visual Studio 2015
24 |
25 | ## 此外接程序中使用的设计模板
26 |
27 | - 登陆页面
28 |
29 | 有关设计模式的详细信息,请参阅 [Office 外接程序的用户体验设计模式模板](https://dev.office.com/docs/add-ins/design/ux-design-patterns)。有关实现示例,请参阅 [Office-Add-in-UX-Design-Patterns-Code](https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns-Code)。
30 |
31 | ## 获取 FileSaver 库
32 |
33 | 此示例代码使用 FileSaver.js 库。克隆此存储库后,请按以下步骤操作。
34 |
35 | 1. 克隆 [FileSaver.js](https://github.com/eligrey/FileSaver.js/) 存储库。
36 | 2. 将 **FileSaver.min.js** 文件复制到此示例代码的 **Scripts** 文件夹。
37 | 3. 在 Home.html 中,添加脚本标记,以引用 FileSaver.min.js 文件。
38 |
39 |
40 | ## 运行项目
41 |
42 | 1. 打开 Visual Studio 解决方案文件。
43 | 2. 按 **F5**。
44 | 3. 在 Word 打开后,单击“**主页**”功能区右端的“**文件下载**”按钮。此时,系统会在任务窗格中打开外接程序。
45 | 4. 选择“**下载文件**”或“**插入下载链接**”按钮。
46 |
47 | ## 问题和意见
48 |
49 | 我们乐意倾听你对此示例的反馈。你可以在此存储库中的“*问题*”部分向我们发送反馈。
50 |
51 | 与 Microsoft Office 365 开发相关的一般问题应发布到 [Stack Overflow](http://stackoverflow.com/questions/tagged/office-js+API)。如果你的问题是关于 Office JavaScript API,请务必为问题添加 [office-js] 和 [API].标记。
52 |
53 | ## 其他资源
54 |
55 | *
56 | [Office 外接程序文档](https://dev.office.com/docs/add-ins/overview/office-add-ins)
57 | * [Office 开发人员中心](http://dev.office.com/)
58 | * 有关更多 Office 外接程序示例,请访问 [Github 上的 OfficeDev](https://github.com/officedev)。
59 |
60 | ## 版权
61 | 版权所有 (c) 2016 Microsoft Corporation。保留所有权利。
62 |
63 |
64 |
65 | 此项目已采用 [Microsoft 开放源代码行为准则](https://opensource.microsoft.com/codeofconduct/)。有关详细信息,请参阅[行为准则 FAQ](https://opensource.microsoft.com/codeofconduct/faq/)。如有其他任何问题或意见,也可联系 [opencode@microsoft.com](mailto:opencode@microsoft.com)。
66 |
--------------------------------------------------------------------------------
/README-Localized/README-zh-tw.md:
--------------------------------------------------------------------------------
1 | # 在 Word Web 增益集下載檔案
2 |
3 | 此程式碼範例會教您在 Office 增益集中以程式控制方式下載檔案的不同技術。不同的 Office 主機和瀏覽器 (使用 Office Online 時) 可能以不同的方式處理檔案。如果您想要提供制式的檔案下載經驗,請使用此程式碼範例中示範的技巧。此程式碼範例也向您展示,如何在 Office 主機或瀏覽器不支援其他方法之一時提供遞補機制。
4 |
5 | ## 目錄
6 | * [變更歷程記錄](#change-history)
7 | * [必要條件](#prerequisites)
8 | * [此增益集使用的設計範本](#design-templates-used-in-this-add-in)
9 | * [取得 FileSaver 程式庫](#get-the-filesaver-library)
10 | * [執行專案](#run-the-project)
11 | * [問題和建議](#questions-and-comments)
12 | * [其他資源](#additional-resources)
13 |
14 | ## 變更歷程記錄
15 |
16 | 2016 年 11 月 3 日
17 |
18 | * 初始版本。
19 |
20 | ## 必要條件
21 |
22 | * Word 2016 for Windows (組建 16.0.6727.1000 或更新版本)、Word Online 或 Word for Mac (組建 15.26 或更新版本)。
23 | * Visual Studio 2015
24 |
25 | ## 此增益集使用的設計範本
26 |
27 | - 登陸頁面
28 |
29 | 如需有關設計模式的詳細資訊,請參閱 [Office 增益集的 UX 設計模式範本](https://dev.office.com/docs/add-ins/design/ux-design-patterns)。欲取得實作範例,請參閱 [Office-Add-in-UX-Design-Patterns-Code](https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns-Code)。
30 |
31 | ## 取得 FileSaver 程式庫
32 |
33 | 這個程式碼範例會使用 FileSaver.js 程式庫。複製儲存機制之後,請執行下列步驟。
34 |
35 | 1. 複製[FileSaver.js](https://github.com/eligrey/FileSaver.js/) 儲存機制。
36 | 2. 將 **FileSaver.min.js** 檔案複製到此程式碼範例的**指令碼**資料夾。
37 | 3. 在 Home.html 中,新增指令碼標籤以參照 FileSaver.min.js 檔案。
38 |
39 |
40 | ## 執行專案
41 |
42 | 1. 開啟 Visual Studio 解決方案檔案。
43 | 2. 按 [F5]****。
44 | 3. 當 Word 開啟時,在 [首頁]**** 功能區右端上,按一下 [檔案下載]**** 按鈕。增益集會在工作窗格中開啟。
45 | 4. 選擇[下載檔案]**** 或 [插入下載連結]**** 按鈕。
46 |
47 | ## 問題和建議
48 |
49 | 我們很樂於收到您對於此範例的意見反應。您可以在此存放庫的 [問題]** 區段中,將您的意見反應傳送給我們。
50 |
51 | 請在 [Stack Overflow](http://stackoverflow.com/questions/tagged/office-js+API) 提出有關 Microsoft Office 365 開發的一般問題。如果您的問題是關於 Office JavaScript API,請確定您的問題標記有 [office js] 與 [API]。
52 |
53 | ## 其他資源
54 |
55 | * [Office 增益集文件](https://dev.office.com/docs/add-ins/overview/office-add-ins)
56 | * [Office 開發人員中心](http://dev.office.com/)
57 | * 在 [Github 上的 OfficeDev](https://github.com/officedev) 中有更多 Office 增益集範例
58 |
59 | ## 著作權
60 | Copyright (c) 2016 Microsoft Corporation.著作權所有,並保留一切權利。
61 |
62 |
63 |
64 | 此專案已採用 [Microsoft 開放原始碼管理辦法](https://opensource.microsoft.com/codeofconduct/)。如需詳細資訊,請參閱[管理辦法常見問題集](https://opensource.microsoft.com/codeofconduct/faq/),如果有其他問題或意見,請連絡 [opencode@microsoft.com](mailto:opencode@microsoft.com)。
65 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # [ARCHIVED] Download files in a Word Web Add-in
2 |
3 | **Note:** This repo is archived and no longer actively maintained. Security vulnerabilities may exist in the project, or its dependencies. If you plan to reuse or run any code from this repo, be sure to perform appropriate security checks on the code or dependencies first. Do not use this project as the starting point of a production Office Add-in. Always start your production code by using the Office/SharePoint development workload in Visual Studio, or the [Yeoman generator for Office Add-ins](https://github.com/OfficeDev/generator-office), and follow security best practices as you develop the add-in.
4 |
5 | This code sample teaches you the different techniques for downloading files programmatically in an Office Add-in. Different Office hosts and browsers (when using Office Online) may handle files differently. If you'd like to provide a uniform file download experience, use the techniques demonstrated in this code sample. This code sample also shows you how you can provide a fallback mechanism if the Office host or browser does not support one of the other methods.
6 |
7 | ## Table of Contents
8 | * [Change History](#change-history)
9 | * [Prerequisites](#prerequisites)
10 | * [Design templates used in this add-in](#design-templates-used-in-this-add-in)
11 | * [Get the FileSaver library](#get-the-filesaver-library)
12 | * [Run the project](#run-the-project)
13 | * [Questions and comments](#questions-and-comments)
14 | * [Additional resources](#additional-resources)
15 |
16 | ## Change History
17 |
18 | November 3, 2016:
19 |
20 | * Initial version.
21 |
22 | ## Prerequisites
23 |
24 | * Word 2016 for Windows (build 16.0.6727.1000 or later), Word Online, or Word for Mac (build 15.26 or later).
25 | * Visual Studio 2015
26 |
27 | ## Design templates used in this add-in
28 |
29 | - Landing page
30 |
31 | For more information about the design patterns, see [UX design pattern templates for Office Add-ins](https://dev.office.com/docs/add-ins/design/ux-design-patterns). And for sample implementations, see [Office-Add-in-UX-Design-Patterns-Code](https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns-Code).
32 |
33 | ## Get the FileSaver library
34 |
35 | This code sample uses the FileSaver.js library. Take the following steps after you have cloned this repo.
36 |
37 | 1. Clone the [FileSaver.js](https://github.com/eligrey/FileSaver.js/) repo.
38 | 2. Copy the **FileSaver.min.js** file to the **Scripts** folder of this code sample.
39 | 3. In Home.html, add a script tag to reference the FileSaver.min.js file.
40 |
41 |
42 | ## Run the project
43 |
44 | 1. Open the Visual Studio solution file.
45 | 2. Press **F5**.
46 | 3. When Word opens, click the **File download** button on the right end of the **Home** ribbon. The add-in opens in a task pane.
47 | 4. Choose the **Download file** or **Insert download link** buttons.
48 |
49 | ## Questions and comments
50 |
51 | We'd love to get your feedback about this sample. You can send your feedback to us in the *Issues* section of this repository.
52 |
53 | Questions about Microsoft Office 365 development in general should be posted to [Stack Overflow](http://stackoverflow.com/questions/tagged/office-js+API). If your question is about the Office JavaScript APIs, make sure that your questions are tagged with [office-js] and [API].
54 |
55 | ## Additional resources
56 |
57 | * [Office add-in documentation](https://dev.office.com/docs/add-ins/overview/office-add-ins)
58 | * [Office Dev Center](http://dev.office.com/)
59 | * More Office Add-in samples at [OfficeDev on Github](https://github.com/officedev)
60 |
61 | ## Copyright
62 | Copyright (c) 2016 Microsoft Corporation. All rights reserved.
63 |
64 |
65 |
66 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
67 |
--------------------------------------------------------------------------------