How do you copy raw Microsoft Word fields codes to another text document?











up vote
0
down vote

favorite
1












Is it possible to copy text from a Word document containing field codes, so that when asted into another application, the FIELD CODES REMAIN AS RAW TEXT. i.e. something like



This is about whales { XE "Cetations:Whales" }. This is about dolphins { XE "Cetations:Dolphins" }.



rather than have the field codes stripped out?










share|improve this question
























  • Perhaps I havn't explained it very clearly. I don't want to cut and paste individual field codes one at a time, but rather the body text of entire document with the field codes kept intact...
    – Faye Dyce
    Apr 27 '10 at 15:26










  • you've managed to create two accounts. E-mail team@superuser.com to get them merged.
    – ChrisF
    Apr 27 '10 at 15:27















up vote
0
down vote

favorite
1












Is it possible to copy text from a Word document containing field codes, so that when asted into another application, the FIELD CODES REMAIN AS RAW TEXT. i.e. something like



This is about whales { XE "Cetations:Whales" }. This is about dolphins { XE "Cetations:Dolphins" }.



rather than have the field codes stripped out?










share|improve this question
























  • Perhaps I havn't explained it very clearly. I don't want to cut and paste individual field codes one at a time, but rather the body text of entire document with the field codes kept intact...
    – Faye Dyce
    Apr 27 '10 at 15:26










  • you've managed to create two accounts. E-mail team@superuser.com to get them merged.
    – ChrisF
    Apr 27 '10 at 15:27













up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





Is it possible to copy text from a Word document containing field codes, so that when asted into another application, the FIELD CODES REMAIN AS RAW TEXT. i.e. something like



This is about whales { XE "Cetations:Whales" }. This is about dolphins { XE "Cetations:Dolphins" }.



rather than have the field codes stripped out?










share|improve this question















Is it possible to copy text from a Word document containing field codes, so that when asted into another application, the FIELD CODES REMAIN AS RAW TEXT. i.e. something like



This is about whales { XE "Cetations:Whales" }. This is about dolphins { XE "Cetations:Dolphins" }.



rather than have the field codes stripped out?







microsoft-word microsoft-office-2007 microsoft-word-2007 copy-paste field-codes






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 26 '10 at 0:50









studiohack

11.3k1880113




11.3k1880113










asked Apr 25 '10 at 9:35









Faye Dyce

111




111












  • Perhaps I havn't explained it very clearly. I don't want to cut and paste individual field codes one at a time, but rather the body text of entire document with the field codes kept intact...
    – Faye Dyce
    Apr 27 '10 at 15:26










  • you've managed to create two accounts. E-mail team@superuser.com to get them merged.
    – ChrisF
    Apr 27 '10 at 15:27


















  • Perhaps I havn't explained it very clearly. I don't want to cut and paste individual field codes one at a time, but rather the body text of entire document with the field codes kept intact...
    – Faye Dyce
    Apr 27 '10 at 15:26










  • you've managed to create two accounts. E-mail team@superuser.com to get them merged.
    – ChrisF
    Apr 27 '10 at 15:27
















Perhaps I havn't explained it very clearly. I don't want to cut and paste individual field codes one at a time, but rather the body text of entire document with the field codes kept intact...
– Faye Dyce
Apr 27 '10 at 15:26




Perhaps I havn't explained it very clearly. I don't want to cut and paste individual field codes one at a time, but rather the body text of entire document with the field codes kept intact...
– Faye Dyce
Apr 27 '10 at 15:26












you've managed to create two accounts. E-mail team@superuser.com to get them merged.
– ChrisF
Apr 27 '10 at 15:27




you've managed to create two accounts. E-mail team@superuser.com to get them merged.
– ChrisF
Apr 27 '10 at 15:27










2 Answers
2






active

oldest

votes

















up vote
0
down vote













Add macro to document, select text, run macro, You can now copy fields codes to clipboard.



Ps. in office 2010 ALT+F9 is used to display fields codes.



Sub StuffFieldCode()
Dim sField As String
Dim sTextCode As String
Dim bSFC As Boolean
Dim MyData As DataObject
Dim sTemp As String
Dim J As Integer

Application.ScreenUpdating = False

If Selection.Fields.Count = 1 Then
bSFC = Selection.Fields.Item(1).ShowCodes
Selection.Fields.Item(1).ShowCodes = True
sField = Selection.Text
sTextCode = ""
For J = 1 To Len(sField)
sTemp = Mid(sField, J, 1)
Select Case sTemp
Case Chr(19)
sTemp = "{"
Case Chr(21)
sTemp = "}"
Case vbCr
sTemp = ""
End Select
sTextCode = sTextCode & sTemp
Next J

Set MyData = New DataObject
MyData.SetText sTextCode
MyData.PutInClipboard

Selection.Fields.Item(1).ShowCodes = bSFC
End If

Application.ScreenUpdating = True
End Sub





share|improve this answer





















  • for this code to run you have to add microsoft forms 2.0 reference to macro. It is located c:windowssystem32FM20.dll. Unfortunately even though the code copies the text representing the field code all of the formatting is lost when it is copied. When you paste back it is simply text.
    – TWood
    Aug 1 '17 at 11:52


















up vote
0
down vote













Press Alt+F9 to show the field code, then highlight all the text inside the braces {}. You can they copy and paste this text.



Here's a link to a macro someone wrote to do all the work: Copy and Pasting Field Codes






share|improve this answer























  • In office 2010 its ALT+F9 cant check right now its the same in previous versions.
    – integratorIT
    Mar 26 '12 at 19:15











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f134507%2fhow-do-you-copy-raw-microsoft-word-fields-codes-to-another-text-document%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













Add macro to document, select text, run macro, You can now copy fields codes to clipboard.



Ps. in office 2010 ALT+F9 is used to display fields codes.



Sub StuffFieldCode()
Dim sField As String
Dim sTextCode As String
Dim bSFC As Boolean
Dim MyData As DataObject
Dim sTemp As String
Dim J As Integer

Application.ScreenUpdating = False

If Selection.Fields.Count = 1 Then
bSFC = Selection.Fields.Item(1).ShowCodes
Selection.Fields.Item(1).ShowCodes = True
sField = Selection.Text
sTextCode = ""
For J = 1 To Len(sField)
sTemp = Mid(sField, J, 1)
Select Case sTemp
Case Chr(19)
sTemp = "{"
Case Chr(21)
sTemp = "}"
Case vbCr
sTemp = ""
End Select
sTextCode = sTextCode & sTemp
Next J

Set MyData = New DataObject
MyData.SetText sTextCode
MyData.PutInClipboard

Selection.Fields.Item(1).ShowCodes = bSFC
End If

Application.ScreenUpdating = True
End Sub





share|improve this answer





















  • for this code to run you have to add microsoft forms 2.0 reference to macro. It is located c:windowssystem32FM20.dll. Unfortunately even though the code copies the text representing the field code all of the formatting is lost when it is copied. When you paste back it is simply text.
    – TWood
    Aug 1 '17 at 11:52















up vote
0
down vote













Add macro to document, select text, run macro, You can now copy fields codes to clipboard.



Ps. in office 2010 ALT+F9 is used to display fields codes.



Sub StuffFieldCode()
Dim sField As String
Dim sTextCode As String
Dim bSFC As Boolean
Dim MyData As DataObject
Dim sTemp As String
Dim J As Integer

Application.ScreenUpdating = False

If Selection.Fields.Count = 1 Then
bSFC = Selection.Fields.Item(1).ShowCodes
Selection.Fields.Item(1).ShowCodes = True
sField = Selection.Text
sTextCode = ""
For J = 1 To Len(sField)
sTemp = Mid(sField, J, 1)
Select Case sTemp
Case Chr(19)
sTemp = "{"
Case Chr(21)
sTemp = "}"
Case vbCr
sTemp = ""
End Select
sTextCode = sTextCode & sTemp
Next J

Set MyData = New DataObject
MyData.SetText sTextCode
MyData.PutInClipboard

Selection.Fields.Item(1).ShowCodes = bSFC
End If

Application.ScreenUpdating = True
End Sub





share|improve this answer





















  • for this code to run you have to add microsoft forms 2.0 reference to macro. It is located c:windowssystem32FM20.dll. Unfortunately even though the code copies the text representing the field code all of the formatting is lost when it is copied. When you paste back it is simply text.
    – TWood
    Aug 1 '17 at 11:52













up vote
0
down vote










up vote
0
down vote









Add macro to document, select text, run macro, You can now copy fields codes to clipboard.



Ps. in office 2010 ALT+F9 is used to display fields codes.



Sub StuffFieldCode()
Dim sField As String
Dim sTextCode As String
Dim bSFC As Boolean
Dim MyData As DataObject
Dim sTemp As String
Dim J As Integer

Application.ScreenUpdating = False

If Selection.Fields.Count = 1 Then
bSFC = Selection.Fields.Item(1).ShowCodes
Selection.Fields.Item(1).ShowCodes = True
sField = Selection.Text
sTextCode = ""
For J = 1 To Len(sField)
sTemp = Mid(sField, J, 1)
Select Case sTemp
Case Chr(19)
sTemp = "{"
Case Chr(21)
sTemp = "}"
Case vbCr
sTemp = ""
End Select
sTextCode = sTextCode & sTemp
Next J

Set MyData = New DataObject
MyData.SetText sTextCode
MyData.PutInClipboard

Selection.Fields.Item(1).ShowCodes = bSFC
End If

Application.ScreenUpdating = True
End Sub





share|improve this answer












Add macro to document, select text, run macro, You can now copy fields codes to clipboard.



Ps. in office 2010 ALT+F9 is used to display fields codes.



Sub StuffFieldCode()
Dim sField As String
Dim sTextCode As String
Dim bSFC As Boolean
Dim MyData As DataObject
Dim sTemp As String
Dim J As Integer

Application.ScreenUpdating = False

If Selection.Fields.Count = 1 Then
bSFC = Selection.Fields.Item(1).ShowCodes
Selection.Fields.Item(1).ShowCodes = True
sField = Selection.Text
sTextCode = ""
For J = 1 To Len(sField)
sTemp = Mid(sField, J, 1)
Select Case sTemp
Case Chr(19)
sTemp = "{"
Case Chr(21)
sTemp = "}"
Case vbCr
sTemp = ""
End Select
sTextCode = sTextCode & sTemp
Next J

Set MyData = New DataObject
MyData.SetText sTextCode
MyData.PutInClipboard

Selection.Fields.Item(1).ShowCodes = bSFC
End If

Application.ScreenUpdating = True
End Sub






share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 26 '12 at 19:15









integratorIT

671615




671615












  • for this code to run you have to add microsoft forms 2.0 reference to macro. It is located c:windowssystem32FM20.dll. Unfortunately even though the code copies the text representing the field code all of the formatting is lost when it is copied. When you paste back it is simply text.
    – TWood
    Aug 1 '17 at 11:52


















  • for this code to run you have to add microsoft forms 2.0 reference to macro. It is located c:windowssystem32FM20.dll. Unfortunately even though the code copies the text representing the field code all of the formatting is lost when it is copied. When you paste back it is simply text.
    – TWood
    Aug 1 '17 at 11:52
















for this code to run you have to add microsoft forms 2.0 reference to macro. It is located c:windowssystem32FM20.dll. Unfortunately even though the code copies the text representing the field code all of the formatting is lost when it is copied. When you paste back it is simply text.
– TWood
Aug 1 '17 at 11:52




for this code to run you have to add microsoft forms 2.0 reference to macro. It is located c:windowssystem32FM20.dll. Unfortunately even though the code copies the text representing the field code all of the formatting is lost when it is copied. When you paste back it is simply text.
– TWood
Aug 1 '17 at 11:52












up vote
0
down vote













Press Alt+F9 to show the field code, then highlight all the text inside the braces {}. You can they copy and paste this text.



Here's a link to a macro someone wrote to do all the work: Copy and Pasting Field Codes






share|improve this answer























  • In office 2010 its ALT+F9 cant check right now its the same in previous versions.
    – integratorIT
    Mar 26 '12 at 19:15















up vote
0
down vote













Press Alt+F9 to show the field code, then highlight all the text inside the braces {}. You can they copy and paste this text.



Here's a link to a macro someone wrote to do all the work: Copy and Pasting Field Codes






share|improve this answer























  • In office 2010 its ALT+F9 cant check right now its the same in previous versions.
    – integratorIT
    Mar 26 '12 at 19:15













up vote
0
down vote










up vote
0
down vote









Press Alt+F9 to show the field code, then highlight all the text inside the braces {}. You can they copy and paste this text.



Here's a link to a macro someone wrote to do all the work: Copy and Pasting Field Codes






share|improve this answer














Press Alt+F9 to show the field code, then highlight all the text inside the braces {}. You can they copy and paste this text.



Here's a link to a macro someone wrote to do all the work: Copy and Pasting Field Codes







share|improve this answer














share|improve this answer



share|improve this answer








edited May 13 '16 at 14:51









MonoThreaded

1228




1228










answered Apr 25 '10 at 23:53









WireGuy

1,46311316




1,46311316












  • In office 2010 its ALT+F9 cant check right now its the same in previous versions.
    – integratorIT
    Mar 26 '12 at 19:15


















  • In office 2010 its ALT+F9 cant check right now its the same in previous versions.
    – integratorIT
    Mar 26 '12 at 19:15
















In office 2010 its ALT+F9 cant check right now its the same in previous versions.
– integratorIT
Mar 26 '12 at 19:15




In office 2010 its ALT+F9 cant check right now its the same in previous versions.
– integratorIT
Mar 26 '12 at 19:15


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f134507%2fhow-do-you-copy-raw-microsoft-word-fields-codes-to-another-text-document%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

QoS: MAC-Priority for clients behind a repeater

Ивакино (Тотемский район)

Can't locate Autom4te/ChannelDefs.pm in @INC (when it definitely is there)