• Search and replace text in the entire document, including headers

    From Ferenc Ferenc@21:1/5 to All on Sun Oct 1 13:52:34 2023
    Hi,
    Does anyone have any idea how to replace text in Word document headers?
    The oWord:Selection:Find:Execute method only replaces text in the text header.

    Ferenc

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ferenc Ferenc@21:1/5 to All on Sun Oct 1 23:14:07 2023
    To clarify, the oWord:Selection:Find:Execute method only replaces the text in the text stem.

    Ferenc

    Ferenc Ferenc ezt írta (2023. október 1., vasárnap, 22:52:36 UTC+2):
    Hi,
    Does anyone have any idea how to replace text in Word document headers?
    The oWord:Selection:Find:Execute method only replaces text in the text header.

    Ferenc

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Norbert Kolb@21:1/5 to Ferenc Ferenc on Mon Oct 2 05:51:04 2023
    Hello Frence,
    You have to selct the header first. Here is a small example that worked for me.

    oWord:ActiveWindow:ActivePane:View:SeekView := wdSeekCurrentPageHeader
    oSelection:TypeText("Das ist eine Probe")
    oSelection:HomeKey( 6, 0 )
    oSelection:Find:Execute("ist",,,,,,,,,"wird")
    oSelection:EscapeKey()

    Kind regards
    Norbert

    On Monday, October 2, 2023 at 8:14:08 AM UTC+2, Ferenc Ferenc wrote:
    To clarify, the oWord:Selection:Find:Execute method only replaces the text in the text stem.

    Ferenc
    Ferenc Ferenc ezt írta (2023. október 1., vasárnap, 22:52:36 UTC+2):
    Hi,
    Does anyone have any idea how to replace text in Word document headers? The oWord:Selection:Find:Execute method only replaces text in the text header.

    Ferenc

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ferenc Ferenc@21:1/5 to All on Fri Oct 6 02:06:18 2023
    Hi Norbert,

    Thanks for the helpful help. I am glad there are still people on the forum like you.

    Ferenc


    Norbert Kolb ezt írta (2023. október 2., hétfő, 14:51:06 UTC+2):
    Hello Frence,
    You have to selct the header first. Here is a small example that worked for me.

    oWord:ActiveWindow:ActivePane:View:SeekView := wdSeekCurrentPageHeader oSelection:TypeText("Das ist eine Probe")
    oSelection:HomeKey( 6, 0 )
    oSelection:Find:Execute("ist",,,,,,,,,"wird")
    oSelection:EscapeKey()

    Kind regards
    Norbert
    On Monday, October 2, 2023 at 8:14:08 AM UTC+2, Ferenc Ferenc wrote:
    To clarify, the oWord:Selection:Find:Execute method only replaces the text in the text stem.

    Ferenc
    Ferenc Ferenc ezt írta (2023. október 1., vasárnap, 22:52:36 UTC+2):
    Hi,
    Does anyone have any idea how to replace text in Word document headers? The oWord:Selection:Find:Execute method only replaces text in the text header.

    Ferenc

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)