Home Forums General XMetaL Discussion Load Access Forms in XMetaL? Reply To: Load Access Forms in XMetaL?

Derek Read

Reply to: Load Access Forms in XMetaL?

Here is an article from the turn of the century that might be of some use:
[url=http://www.google.ca/url?sa=t&source=web&ct=res&cd=1&url=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Faa140069(office.10).aspx&ei=ARbpSc-FCYSKtAPjvtXmAQ&usg=AFQjCNGIMF9_aeFkoVlqFZkbHP619EYV8Q&sig2=pHzPGFXWNZarMXX2BLnpxA]MSDN Library (2000) 'Effortlessly Convert Access Forms to VB Objects'[/url]

If I read that correctly, you could convert your forms (using some 3rd party tool) and they can be called from (or used in) VB. In theory this means you might be able to create a VB application that reuses them and (again in theory) this VB application might instantiate XMetaL Author using COM and (assuming the VB app can extract information from your form) pass it to XMetaL Author. Such a VB app, at the very simplest, might look like this (code for a form containing a button called “Button1”):

[code]Public Class Form1
    Dim xma
    Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        'Destroy XMetaL COM object when form closes
        xma = Nothing
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Instantiate XMetaL as COM object at form open
        xma = CreateObject(“XmetaL.Application”)
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim dataVal
        '…the code that somehow interacts with your converted Access form here…
        dataVal = “test” 'note: hardcoded for testing

        'Put the data into XMetaL (extremely simplistic example):
        xma.Selection.MoveToDocumentStart()
        xma.Selection.MoveToElement(“Para”)
        xma.Selection.ContainerAttribute(“Id”) = dataVal
    End Sub
End Class[/code]

I have not tested this, and unfortunately I do not have time to do so (though it seems interesting).

If you can find a tool that will convert these Access forms to compatible ActiveX objects you might be able to embed them directly into an XFT form. However, I have no idea if such a tool exists (perhaps one of the ones listed at the link above does this, or you can find one given the right search phrasing).

Reply

Products
Downloads
Support