资源描述:
《对word中来自excel的图表进行格式设置code(format the chart from excel in word, code)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、对word中来自excel的图表进行格式设置code(Formatthechartfromexcelinword,code)公共runcount为整数子setfigure()“下面的命令将刚刚从Excel中复制过来的图形设定为悬浮锁定格式,并且将图形的来源位置设定为批注内容screenupdating=false我的照片是模糊的形状,MyInPictureAsInlineShape昏暗的FPath,shtname,chtadd,chtname,chttitle,S、S2为字符串昏暗的xlapp应用Excel。昏暗的xlbokExcel工作簿。昏暗的intre
2、turn为整数“如果没有选中图形或者选中的图形不是嵌入形状类型则结束程序如果选择类型=wdselectioninlineshape然后。把我的照片=选择。InlineShapes(1)。converttoshaperuncount=0“类型=wdselectionshape然后选择。把我的照片=选择。ShapeRange(1)其他的本你可能没有选中任何图形,请选中图形后重试!”,“”货币供应量,“不图选择”退出子最后如果“对图片的格式进行设定,可以设置缩放比例H1高度=我的照片。宽度W1=我的照片。有我的照片lockaspectratio=msotrue。。
3、高度=222.8如果设定固定值选用这一语句,并将下面比例缩放语句前面加上英文单引号宽度=371.35'。高度=H1×0.85”设置为原图高度为0.85倍,可以设置其他按比例'。宽度=W1×0.85”设置为原图宽度为0.85倍,可以设计其他比例wrapformat.type=wdwraptopbottom”上下型。wrapformat.allowoverlap=假”不允许重叠。wrapformat.side=wdwrapboth。relativehorizontalposition=_。wdrelativehorizontalpositioncolumnrel
4、ativeverticalposition=_。wdrelativeverticalpositionparagraphwdshapecenter左=。centimeterstopoints最高(0.2)。锁脚锚杆的组合控制措施=真。layoutincell=false。结束runcount=runcount+11“将刚刚从Excel中拷贝出来的图表所在的位置设定为字批注内容“同时还将为图片设定了超链接,链接地址为刚刚复制图片所在Excel文件“但是如果Excel没有打开,ThenthemapmaynothavecomefromtheExcellaunchpr
5、ogramOnErrorResumeNext"SetxlApp=GetObject"("excel.application")IfErr.Number=429ThenTheMsgBoxExcelprogramisnotopen.ThisdiagrammaynotcomefromExcel,sothesourceofthisfigureisnotaddedasanannotation!"VbExclamation,"No,Excel,is,Open"Else"IfExcelopensbutdoesnotselectanygraphicsintheExcel,t
6、henthemiddleoperationmaycausethegraphnottobeselected.Setxlbok=xlApp.ActiveWorkbookSetxlcht=xlbok.Application.ActiveChartIf,xlcht,Is,Nothing,ThenMsgBox"youdidnotchecktheoriginalinExcel.Ifyouwanttoaddthismap,theExcelsourceisusedasanannotation.Pleasecopy,pastethediagram,andtryagain!Wh
7、atshouldIdoifIdon'tneedtoaddapprovalandclickOK?!"VbExclamation,_"No,Chart,Selected.""Else"Ifthegraphisselected,thegraphicalparametersareobtainedFpath=xlbok.FullNameShtname=xlbok.Application.ActiveSheet.NameChtadd=xlbok.Application.ActiveChart.Parent.TopLeftCell.AddressChtname=xlbok
8、.Application.ActiveChart.P