Bonjour a tous,
Je rencontre un problème avec un code:
Avec ce code, je voudrais le modifier afin de pouvoir posisionner chaque colonne du msflexgrid a des possision spécifique.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 Dim MyFreeFile As Integer Dim icol As Integer Dim irow As Integer Dim MyString As String MyFreeFile = FreeFile Open "C:\Documents and Settings\All Users\Desktop\ord" For Output As MyFreeFile For irow = 1 To MSFlexGrid1.Rows - 1 'Start from top to bottom For icol = 0 To MSFlexGrid1.Cols - 1 'Start from left to Right MyString = MyString & MSFlexGrid1.TextMatrix(irow, icol) & _ IIf((icol = MSFlexGrid1.Cols - 1), "", ",") 'Add value in mystring for each column in Flexgrid Next Print #MyFreeFile, MyString 'Print to notepad MyString = "" 'Reset MyString Next Close MyFreeFile
Exemple du msflexgrid:
Colonne 1 ligne 1 du Grid = "H"
Colonne 2 ligne 1 du Grid = "A"
Colonne 3 ligne 1 du Grid = "HOST"
Colonne 4 ligne 1 du Grid = "08989" etc.
Example de possision pour le fichier .dat:
Colonne 1 ligne 1 du Grid = Possision 1
Colonne 2 ligne 1 du Grid = Possision 2
Colonne 3 ligne 1 du Grid = Possision 3
Colonne 4 ligne 1 du Grid = Possision 9.
Ce qui donnerais comme résultat final dans le fichier dat:
"HAHOST 08989"
Comment faire s.v.p?
Merci encore pour votre aide.
Partager