遇到的错误提示如下:
error C4772: #import 引用了缺少的类型库中的类型;“missing_type”用作占位符
代码定位:
#import "MSWORD.OLB" \
rename_namespace("Word"), raw_interfaces_only, named_guids, exclude("Pages"), \
rename("ExitWindows","ExitWindowsEx"), rename("FindText","FindTextEx"), \
rename("ReplaceText","ReplaceTextEx"), rename("RGB","RGBEx")
using namespace Word;
系统是win11专业版,VS版本是2022。机器上之前装了office2021和wps,后面都给卸了,装上了office2016。
最后解决办法是:在安装office2016的基础上安装了office 2007
为什么编过了,我也不明白~