当前位置:   article > 正文

uipath word html,UiPath - issue - "Append Text: Archive file cannot be size 0." (UiPath.Word.Activit...

uipath html content

【问题描述】

用 UiPath (2019.3.0 Community Edition) 编写了一个Tool,用 While 循环把整数从 10 ,每次循环+1,一直加到100,并利用 Append Text (UiPath.Word.Activities.DocumentAppendText) 把每次的值存入到Word文件中,但是在保存到 Word 时 Append Text 报错,下图是 Designer panel 的 workflow 和 异常截图

b31505da20bb52871b289157d06feeca.png

84447f2bf6046e87fab6f88b72a90898.png

以下是详细的报错信息:

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:

System.IO.FileFormatException: Archive file cannot be size 0.

at UiPath.Word.FileDocument..ctor(String documentPath, Boolean createNew)

at UiPath.Word.Activities.DocumentActivity.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state)

at System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)

at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

a69e568c53f167b54ef91649c68048c8.png

问题关键点:

Append Text: Archive file cannot be size 0.

【解决方法】

原因:

程序中调用的Word文件是新建的,没有被打开过,也没有被编辑过

操作:

把调用的 Word 文件打开,随意写点字再删掉,然后保存,再次运行就不报错了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/326078
推荐阅读
相关标签
  

闽ICP备14008679号