Dim exa As String
Dim Book As New XLS.Book(ProjectPath & "Attachments\fabricdeveloping.xls")
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Book.Build() '生成细节区
exa =ProjectPath & "reports\" & Tables("面料开发").current("编号") & ".xls"
Book.Save(exa)
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(exa)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
Dim Rng As MSExcel.Range
Dim Pic As MSExcel.shape
For Each Pic In ws.shapes
On Error Resume Next
rng = pic.TopLeftCell
With Pic
If .Height / .Width > rng.Height / rng.Width Then
.Height = rng.Height - 5
.Top = rng.Top + 2.5
.Left = rng.Left + (rng.Width - .Width) / 2
' .Placement = xlMoveAndSize
Else
.Width = rng.Width - 5
.Left = rng.Left + 2.5
.Top = rng.Top + (rng.Height - .Height) / 2
' .Placement = xlMoveAndSize
End If
End With
Next
App.Visible = True
////////////////////////////////////////////////////////////
以上代码作用是在excel里面单元格里面放入的照片,根据单元格大小自动缩放大小, 其中 xlMoveAndSize 在VBA里面可以用,但是在foxtable里面无法运行,请问如何写