Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word automation - can't find text box
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00782504
Message ID:
00782641
Views:
29
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform