Converting Field Names to Text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi ther
I have designed a form in WORD (Microsoft Office XP version) that generates a letter using a combination of standard text and user input field values. A great many {if} statements determine which paragraphs get included in the letter depending on the user inputs

The user needs to be able to amend the letter prior to printing (eg to correct their typos etc.) and whilst I can make amendments on the screen, the printed version of the letter still uses the original field values – typos and all!

I know that Ctrl Shift F9 converts field values to text but i need to be able to write a macro that will select only Section 3 of my document and convert this section into text and this is where i am struggling

The letter will vary in length each time it is generated depending on the user inputs but i will always end with the traditional 'Yours sincerely' sign off.

What would you suggest is the best way to get the macro to select the text i need each time

Thank
 
Use

Dim myrange As Range, afield As Field
Set myrange = ActiveDocument.Sections(3).Range
For Each afield In myrange.Fields
afield.Unlink
Next afield


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Dawn said:
Hi there
I have designed a form in WORD (Microsoft Office XP version) that
generates a letter using a combination of standard text and user input field
values. A great many {if} statements determine which paragraphs get
included in the letter depending on the user inputs.
The user needs to be able to amend the letter prior to printing (eg to
correct their typos etc.) and whilst I can make amendments on the screen,
the printed version of the letter still uses the original field values –
typos and all!!
I know that Ctrl Shift F9 converts field values to text but i need to be
able to write a macro that will select only Section 3 of my document and
convert this section into text and this is where i am struggling.
The letter will vary in length each time it is generated depending on the
user inputs but i will always end with the traditional 'Yours sincerely'
sign off.
 
Back
Top