通过 PowerApps 将图像添加到 Excel 中Add images to Excel from PowerApps

自动创建应用,用户可以在其中显示、添加或删除各文件中的图像,或通过“笔”控件绘制的画图。Create an app automatically in which users can show, add, or delete images from files or drawings from a Pen control. 此应用以你创建并上载到云存储帐户中的 Excel 文件为依据。The app is based on an Excel file that you create and upload to a cloud-storage account.

先决条件Prerequisites

创建数据源和应用Create the data source and the app

  1. 在 Excel 中,向任意两个并排且正下方是空单元格的单元格(例如,A1 和 B1)添加“Caption”和“Image [image]”。In Excel, add Caption and Image [image] to any two cells that are side by side (for example, A1 and B1) and that are just above two empty cells.
  2. 将更新的单元格及其正下方的单元格格式化为表,然后命名此表(例如,“Images”)。Format the cells that you updated and the cells just below them as a table, and name the table (for example, Images).

    创建表

  3. 保存此文件(例如,另存为“ImageDemo”),然后将其上载到云存储帐户中。Save the file (for example, as ImageDemo), and upload it to your cloud-storage account.
  4. 在 PowerApps 中,依次单击或点击“文件”菜单上的“新建”(如果尚未打开应用,请单击或点击左边缘中的“新建”)和云存储帐户磁贴中的“手机布局”。In PowerApps, click or tap New on the File menu (along the left edge if you haven't yet opened an app), and then click or tap Phone layout in the tile for your cloud-storage account.

    选择云存储帐户

  5. 在“选择 Excel 文件”下,单击或点击你创建的文件。Under Choose an Excel file, click or tap the file that you created.

    选择你创建的工作簿

  6. 在“选择表”下,依次单击或点击你创建的表和“连接”。Under Choose a table, click or tap the table that you created, and then click or tap Connect.

    选择你创建的表

  7. 如果是刚刚才安装或升级 PowerApps,请使用快速导览功能,或者单击或点击“跳过”。If you just installed or upgraded PowerApps, take the quick tour, or click or tap Skip.

    快速导览功能的第一屏

添加文件中的图像Add an image from a file

  1. 按 F5 键(或者单击或点击右上角附近的播放按钮),打开预览模式,然后单击或点击右上角的加号图标。Open Preview mode by pressing F5 (or by clicking or tapping the play button near the upper-right corner), and then click or tap the plus icon in the upper-right corner.

    加号图标

  2. 在“说明”框中,键入或粘贴要添加的图像文件的简短说明,然后单击或点击其下方来指定文件。In the Caption box, type or paste a short description of the image file that you want to add, and then click or tap below it to specify the file.
  3. 在“打开”对话框中,转到要添加的文件,然后依次单击或点击此文件和“打开”。In the Open dialog box, browse to the file that you want to add, click or tap it, and then click or tap Open.

    添加说明和图像

  4. 单击或点击右上角的复选标记图标来保存更改。Click or tap the checkmark icon in the upper-right corner to save your changes.

    保存更改

  5. 重复执行最后三步,根据需要添加任意多张图像,然后按 Esc 键返回到默认工作区。Add as many images as you want by repeating the last three steps, and then press Esc to return to the default workspace.
  6. (可选)删除显示每张图像的说明的“标签”控件。(optional) Delete either Label control that shows the caption for each image.

添加绘图Add a drawing

  1. 单击或点击左侧导航栏中的“EditScreen1”显示此屏幕,然后单击或点击图像卡以选择此卡。Show EditScreen1 by clicking or tapping it in the left navigation bar, and then click or tap the image card to select it.

    选择图像卡

  2. 在右侧窗格中,依次单击或点击图像卡的卡选择器和“添加注释”。In the right-hand pane, click or tap the card selector for the image card, and then click or tap Add Notes.

    添加注释

  3. 单击或点击左侧导航栏中的“BrowseScreen1”显示此屏幕,然后打开预览模式。Show BrowseScreen1 by clicking or tapping it in the left navigation bar, and then open Preview mode.
  4. 单击或点击右上角的加号图标,添加说明,然后在“笔”控件中绘制图像。Click or tap the plus icon in the upper-right corner, add a caption, and draw an image in the Pen control.

    绘制图像

  5. 单击或点击右上角的复选标记图标来保存更改。Click or tap the checkmark icon in the upper-right corner to save your changes.

    保存更改

  6. 重复执行最后两步,根据需要添加任意多张绘图,然后按 Esc 键返回到默认工作区。Add as many drawings as you want by repeating the last two steps, and then press Esc to return to the default workspace.