Results 1 to 4 of 4

Thread: [RESOLVED] Word Fields, display Code Fields

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Posts
    91

    Resolved [RESOLVED] Word Fields, display Code Fields

    I use word automation WOrdXP in may VB6 app.
    I have a word doc open and i have to make sure i am in the field code display mode.
    I know i can toggle with ALT-F9 and in code this can be done
    with Appword.activeDocument.range.Fields.ToggleShowCodes
    or i first select to whole doc content
    Appword.activeDocument.Content.Select
    Appword.selection.Fields.ToggleShowCodes

    but this didn't work
    Somehow i have to make sure i am in the Field code display mode
    and no matter with mode the user's open doc is, beause he can use Alt F9 and change the mode, so i have to scheck the mode first.

    Allso i tried selecting all the fields and then using
    Appword.Selection.Fields(i).ShowCodes = True
    Allso this didn't work
    What am i doing wrong, can someone help

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Posts
    91

    Re: Word Fields, display Code Fields

    Oke i found a way how to check for th eactiveDocument Field display status
    I did abandon ToggleShowCodes, somehow didn't work
    But i used Sendkeys %{F9} instead and works perfectly

  3. #3

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Posts
    91

    Re: [RESOLVED] Word Fields, display Code Fields

    I tested this, works perfect
    This is better code, thx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width