Skip to content
开发文档
能力中心
应用市场
WebOffice
开发者后台

设置图片与附件类型值

说明

设置 图片与附件字段 类型值

语法

DBCellValue([{
  fileData: "",
  fileName: "",
}])

参数

参数名是否必需类型描述
fileDatastring支持2种类型:base64云文档链接
fileNamestring附件名称

返回值

浏览器环境示例

javascript
async function example() {
    await instance.ready();
    const app = instance.Application;
    // 设置云文档类型
    app.Sheets(1).Views(1).RecordRange(2, "@图片和附件").Value = await Application.DBCellValue([{
      fileData: "https://kdocs.cn/l/csGRGIzv9PvF",
      fileName: "11.png",
    }])
    // 设置base64
    app.Sheets(1).Views(1).RecordRange(2, "@图片和附件").Value = await Application.DBCellValue([{
      fileData: url/base64,
      fileName: "11.png",
    }])
}

脚本编辑器 示例

javascript
function main() {
    // 设置云文档类型
    Application.Sheets(1).Views(1).RecordRange(2, "@图片和附件").Value = Application.DBCellValue([{
      fileData: "https://kdocs.cn/l/csGRGIzv9PvF",
      fileName: "11.png",
    }])
    // 设置base64
    Application.Sheets(1).Views(1).RecordRange(2, "@图片和附件").Value = Application.DBCellValue([{
      fileData: url/base64,
      fileName: "11.png",
    }])
}
main()
回到旧版