A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Converting Field Names to Text



 
 
Thread Tools Display Modes
  #1  
Old May 16th, 2004, 07:36 AM
Dawn
external usenet poster
 
Posts: n/a
Default Converting Field Names to Text

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.

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

Thanks

  #2  
Old May 16th, 2004, 07:57 AM
Doug Robbins - Word MVP
external usenet poster
 
Posts: n/a
Default Converting Field Names to Text

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" wrote in message
...
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.

What would you suggest is the best way to get the macro to select the text

i need each time?

Thanks


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.