Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
My Word/VBA problem
Message
 
À
05/01/2001 04:53:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00459701
Message ID:
00459732
Vues:
35
>sorry to bother you with such trifle:
>
>with oWord && Win98, Word97, VFP6
> .Visible = .t.
> .Application.Activate
> .Documents.Open(mydoc)
> .ActiveWindow.WindowState = 1
> .Selection.MoveDown Unit:=wdScreen, Count:=1
> .Selection.TypeText("XXXXXXXXXX"+chr(13))
>endwith
>
>Why is text insterted at top of doc instead of bottom?
>If I create a macro, similar code works...

I think that this line is giving you fits:
.Selection.MoveDown Unit:=wdScreen, Count:=1
Try changing it to:
 #DEFINE wdScreen 7
 .Selection.MoveDown(wdScreen, 1)
VBA supports Named Parameters, which is that Unit:=wdScreen construct. This allows you to specify the wdScreen is the value for the Unit parameter; you can mix the order of the parameters, and not have to count commas to pass only the seventh parameter (if that's what you need to do).

Try changing the code and see if that works.

- della Martin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform