Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Translate a VB module
Message
 
À
23/01/2001 14:39:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00467503
Message ID:
00467568
Vues:
8
Try its... (not free bug code...)

FUNCTION MyFunc
lParameters toWord,;
tcOutputDestination, ;
tiSepTray, ;
tcSepType, ;
tcSection

On Error DO SeparatorError WITH ERROR(),MESSAGE()
=DoEvents()
toWord.Documents.Add() &&Always put () for methods...
--------------
NOTE: Words Const is not accesible by VFP. You need a somenthing like word.h file (find it in files section), or replace wd* const with number values (see this in VB)
--------------
With toWord.ActiveDocument.PageSetup
.FirstPageTray = tiSepTray
.OtherPagesTray = tiSepTray
.VerticalAlignment = wdAlignVerticalCenter
EndWith

With toWord.Selection
If tcSepType = "P" Then
.InsertBreak Type:=wdPageBreak
.InsertBreak Type:=wdPageBreak
EndIf

If (tcSection <> "") Then
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Font.Bold = wdToggle
.Font.Size = 18
.TypeText('Text')=ConvertSepType(tcSection)
.TypeParagraph
EndIf
EndWith

=DoEvents()

DO Case
Case tcOutputDestination= "Printer"
toWord.PrintOut
Case tcOutputDestination= "Preview"
toWord.PrintPreview = True
=MESSAGEBOX("Separator Print Preview Ready")
EndCase

toWord.ActiveDocument.Close(wdDoNotSaveChanges)
=DoEvents()
RETURN

END FUNCTION

FUNCTION SeparatorError
lParametres errNumber,errDescrip

=MessageBox("Error:" + STR(ErrNumber)+CHR(13)+;
"In: PrintSeparator" +CHR(13)+;
"Description: " + ErrDescrip
END FUNCTION
The Life is Beautiful!

Programmer in
Delphi, VS.NET
MCP
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform