Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to copy a .bmp into the clip board (from General)
Message
De
29/01/2001 07:02:53
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00469598
Message ID:
00469619
Vues:
8
I've never done much with General fields as I do not need them but seems to me that if you can save the BMP as a file on disk, even temporarily, then using OLE Automation should be simple to add it to Excel.
oExcel = createobject("Excel.Automation")
oExcel.visible = .T.    && just to see what's happening during development
ThisWorkbook = oExcel.Workbooks.Open("c:\my documents\sample.xls")
* then you could set local variables to matfch the parameters (arguments) passed to your former VBA procedure and then translate your procedure to VFP: 
ThisWorkbook.Sheets(SheetName).Range("B6").Select
ThisWorkbook.Sheets(SheetName).PasteSpecial("Bitmap",.F.,.F.)
Selection.ShapeRange.Left = 5
Selection.ShapeRange.Top = 40 + (ChartNo - 1) * 215
Selection.ShapeRange.Height = 210 * ScaleFactor
Selection.ShapeRange.Width = 460 * ScaleFactor
This is off the top of my head. The code has not been tested but it should give you an idea.

HTH

>>>>>>>>>>>>>>>>>>>
>Thats my question, a clean solution to push the contend of a General field into excel. My General filed is loaded with a .Bmp image....
>I've no problem to get the contend of clip board(.bmp) and insert it into excel (via ole automation), in this case, i call a small VBA procedure like this:
>"
>Public Sub Teechart_add(SheetName, ChartNo, ScaleFactor)
> ThisWorkbook.Sheets(SheetName).Range("B6").Select
> ThisWorkbook.Sheets(SheetName).PasteSpecial Format:="Bitmap", Link:=False, DisplayAsIcon:= _
> False
> Selection.ShapeRange.Left = 5
> Selection.ShapeRange.Top = 40 + (ChartNo - 1) * 215
> Selection.ShapeRange.Height = 210 * ScaleFactor
> Selection.ShapeRange.Width = 460 * ScaleFactor
>End Sub
>>>>>>>>>>>>>>>>>>>


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform