Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word automation - can't find text box
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00782504
Message ID:
00782641
Vues:
27
AFAIK text boxes are not visible if active view is set to 'normal'. Try to
set active view to 'page layout'. Then text in textboxes could be also searched for pattern with "FIND". Something like this:

wdPaneNone=0
wdPageView=3
WITH objWord
If .ActiveWindow.View.SplitSpecial = wdPaneNone
.ActiveWindow.ActivePane.View.Type = wdPageView
Else
.ActiveWindow.View.Type = wdPageView
EndIf
ENDWITH

>I have a word template that has been driving me crazy. I can replace all the text in the "main story" that I need to, but I have a couple of text boxes on this template that also needs some text replaced. I have tried everything I could think of to get to the text inside these boxes. Everything I've read tells me this should work:
>
>
>
>#DEFINE wdTextFrameStory 5
>NewRange = oDoc.StoryRanges(wdTextFrameStory)
>With NewRange.Find
>  .ClearFormatting
>  .Forward = .T.
>  .Text = "!lcActNbr!"
>  .Execute
>  If .Found
>    NewRange.Text = ALLTR(ltrctr.act_nbr)
>  EndIf
>EndWith
>
>
>
>No luck. Any help would be greatly appreciated.
>
>Thanks,
>Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform