從 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 中,將 [標題] 和 [影像 [image]] 新增至任何兩個空白儲存格上方且並排的儲存格 (例如,A1 和 B1)。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. 將您已更新的儲存格以及其下方的儲存格格式化為資料表,並為資料表命名 (例如,影像)。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.