当前位置:主页>仓库管理软件> 列表

麻烦高手帮个小忙,转换下这个宏代码 找酒店管理软件

仓库管理软件版1楼: 把这段代码转化为delphi代码。谢谢
Selection.InlineShapes.AddOLEObject ClassType:="Excel.Sheet.8", FileName:= _
"F:\Excel\Demo1.xls", LinkToFile:=False, DisplayAsIcon:=False

2楼: 如果分数不够啊。。呵呵。。可以加[:)] 如酒店管理软件

3楼: 顶上去

4楼: var
WordObject : TWordObject;
ClassType,FileName,LinkToFile,DisplayAsIcon:olevariant;
IconFileName,IconIndex,IconLabel,Range:olevariant;
begin
ClassType:=''Excel.Sheet.8'';
FileName:=''F:\Excel\Demo1.xls'';
LinkToFile:=False;
DisplayAsIcon:=False;
IconFileName:=''_'';
IconIndex:=0;
IconLabel:='''';
Range:=WordObject.Application.Selection.Range;
wordobject.Application.Selection.InlineShapes.AddOLEObject(ClassType,FileName,LinkToFile,DisplayAsIcon,IconFileName,IconIndex,IconLabel,Range);
执行之后出现。。。命令失败。。
请问是哪个地方出现问题了?谢谢

5楼: 经过调试,得知是IconIndex原因。如果没有icon,那IconIndex的值应该设为什么呢



谢谢

6楼: 晕。。。没人理会

仓库管理软件版7楼: IconIndex
Optional Object. The index number of the icon within IconFileName. The order of icons in the specified file corresponds to the order in which the icons appear in the Change Icon dialog box (Insert menu, Object dialog box) when the Display as icon check box is selected. The first icon in the file has the index number 0 (zero). If an icon with the given index number doesn''t exist in IconFileName, the icon with the index number 1 (the second icon in the file) is used. The default value is 0 (zero).

照着上面做了,还是有问题

8楼: 已经解决