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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|