Article | 60000475 |
Type | HowTo |
Product | Engine |
Version | 6 |
Date Added | 4/14/2008 |
Submitted by | Igor Gegusin |
Keywords |
Private Sub Command1_Click() Dim success As Boolean Dim filename As String ' Vdraw1 is a VDF 6.x Wrapper component ' You should add to your project the VDFOpen control (vdfopen.ocx) that comes with version 6.x filename = App.Path & "\\test.vdi" VDraw1.ActiveDocument.Entities.AddLine Array(0, 0), Array(1, 1) success = VDraw1.ActiveDocument.SaveAs(filename) ' this file is saved as VDI 5.1 ' The SaveToMemory & CreateFromMemory will not work as the Vdraw1 makes a version 6.x "MemoryFile" while ' the CreateFromMemory of VDFOpen1 needs a version 5.x "MemoryFile" VDFOpen1.ActiveDocument.CreateFromMemory success = VDFOpen1.ActiveDocument.Open(filename) ' open the VDI 5.1 If success Then success = VDFOpen1.ActiveDocument.SaveAs(filename, Vd4x1) ' Save this again as VDI 4.1 If success Then MsgBox ("Saved as VDI version 4") End If End Sub