Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Translate a VB module
Message
De
23/01/2001 14:39:10
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Translate a VB module
Divers
Thread ID:
00467503
Message ID:
00467503
Vues:
48
Hi everyone:

I have a Fox2.6 application I support. The way printing is done is by putting information in a series of tables. A Visual Basic program then polls those tables and does the printing. I want to convert that VB application to VFP but my VB skills are virtually non-existent and my VFP skills are what one would expect from a DOSasaurous who has spent 15+ years doing dBase III and Fox 2.6 and the past year lurking here.

At any rate.... Here is a sample of the code from the VB application. I realize I'm asking somebody here to do my job but I would be extremely grateful if one of you could post the equivalent VFP code.
Private Sub PrintSeparator(toWord, _
    ByVal tcOutputDestination, _
    ByVal tiSepTray, _
    ByVal tcSepType, _
    ByVal tcSection)
    On Error GoTo SeparatorError
    DoEvents
    toWord.Documents.Add
    With toWord.ActiveDocument.PageSetup
        .FirstPageTray = tiSepTray
        .OtherPagesTray = tiSepTray
        .VerticalAlignment = wdAlignVerticalCenter
    End With
    With toWord.Selection
        If tcSepType = "P" Then
            .InsertBreak Type:=wdPageBreak 
            .InsertBreak Type:=wdPageBreak
        End If
        If (tcSection <> "") Then
            .ParagraphFormat.Alignment = wdAlignParagraphCenter
            .Font.Bold = wdToggle
            .Font.Size = 18
            .TypeText Text:=ConvertSepType(tcSection)
            .TypeParagraph
        End If
    End With
    DoEvents
    Select Case tcOutputDestination
        Case "Printer"
            toWord.PrintOut
        Case "Preview"
            toWord.PrintPreview = True
            MsgBox "Separator Print Preview Ready"
    End Select
    toWord.ActiveDocument.Close (wdDoNotSaveChanges)
    DoEvents
    Exit Sub
SeparatorError:
    MsgBox "Error:" & Err.Number & vbCr _
        & "In: PrintSeparator" & vbCr _
        & "Description: " & Err.Description
End Sub
Thanks to all............Rich
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform