Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Translate a VB module
Message
From
23/01/2001 14:39:10
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Translate a VB module
Miscellaneous
Thread ID:
00467503
Message ID:
00467503
Views:
49
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
Next
Reply
Map
View

Click here to load this message in the networking platform