Word 2003 Automation Alt-F9 (ViewFieldCodes/IncludeFieldCodes) With IncludeText Field

I

Ian

I need to toggle the ViewFieldCodes (for example the Alt-F9 key) using
automation in C#. Is there anyway to do this in Word 2003?

The two problems that I'm having are:
1. When building the document template I need to force the field codes
to be visible.
2. When displaying the final merged document I need to for the field
codes to be evaluated (and not visible).

Additional information:
I'm using a merge to join a master and child document with the
INCLUDETEXT field. The file location of the child document is only
known just prior to the merge, so I have added it to my datasource,
and it appears as another merge field in the master document.

Master Document:
This is the master doc
{INCLUDETEXT "{MERGEFIELD ChildDocumentPath }"}

Any help would be greatly appreciated.

--Ian
 
D

dixie

Care to post the solution for toggling on and off in VBA code? I am
interested.

dixie
 
I

Ian

Here is the line in C#, it shouldn't be that much different in VBA.

wordApplication.ActiveDocument.ActiveWindow.View.ShowFieldCodes = true
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top