[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 :sick:
What am i doing wrong, can someone help
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
Re: Word Fields, display Code Fields
Here is the code:
VB Code:
ActiveWindow.View.ShowFieldCodes = False
Re: [RESOLVED] Word Fields, display Code Fields
I tested this, works perfect
This is better code, thx