Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
blocking specific text in Word
Hello-
I am creating a document for a client. There will be certain areas that will be locked and certain areas where my client will need to input information. They wanted to know if there is a way that when their team types in their information that they can block out specific words so they wouldn't be able to type them in. For example, they have a long list of products and only want the client to be able to input certain product words but block out other ones. Is there anyway to do this? Thanks! |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
blocking specific text in Word
I don't know of any way to block specific words, but they could use a
dropdown form field instead of a text form field, allowing the team to select only from the list. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Tammy" wrote in message ... Hello- I am creating a document for a client. There will be certain areas that will be locked and certain areas where my client will need to input information. They wanted to know if there is a way that when their team types in their information that they can block out specific words so they wouldn't be able to type them in. For example, they have a long list of products and only want the client to be able to input certain product words but block out other ones. Is there anyway to do this? Thanks! |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
blocking specific text in Word
I don't know of any way to block specific words, but they could use a
dropdown form field instead of a text form field, allowing the team to select only from the list. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Tammy" wrote in message ... Hello- I am creating a document for a client. There will be certain areas that will be locked and certain areas where my client will need to input information. They wanted to know if there is a way that when their team types in their information that they can block out specific words so they wouldn't be able to type them in. For example, they have a long list of products and only want the client to be able to input certain product words but block out other ones. Is there anyway to do this? Thanks! |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
blocking specific text in Word
If you are using potected text form fields then you can validate those
fields for incorrect entry. The principles involved are described at http://www.gmayor.com/formfieldmacros.htm . To exclude words in a list, you can add code to the macros shown to validate the content against a list of banned words e.g. in the following example the list of banned words separated by commas is Const sList = "Tea,Coffee,Cocoa" The macro will filter out those words and require the user to re-enter a value in the field that is not banned. If the list of allowed expressions is less than 25, you can use a dropdown field instead (as suggested by Suzanne) which will eliminate the need for the macros. If the list is longer than 25 items and you wish to select from a list, you will need a userform. See instead http://gregmaxey.mvps.org/FormField_...rm_ListBox.htm Option Explicit Private mstrFF As String Private sBarred() As String Private i As Long Const sList = "Tea,Coffee,Cocoa" Private Sub AOnExit() sBarred = Split(sList, Chr(44)) With GetCurrentFF mstrFF = .name If Len(.Result) = 0 Then MsgBox "You can't leave field: " _ & .name & " blank" End If For i = 0 To UBound(sBarred) If InStr(1, .Result, LCase(sBarred(i))) = 1 Then MsgBox "You cannot use " & sBarred(i) Exit For End If Next i End With End Sub Private Sub AOnEntry() sBarred = Split(sList, Chr(44)) 'Goto another FormField if we weren't supposed to leave it! For i = 0 To UBound(sBarred) If InStr(1, ActiveDocument.FormFields(mstrFF).Result, _ LCase(sBarred(i))) = 1 Then ActiveDocument.FormFields(mstrFF).Select Exit For End If Next i If Len(ActiveDocument.FormFields(mstrFF).Result) = 0 Then ActiveDocument.FormFields(mstrFF).Select End If mstrFF = vbNullString End Sub Private Function GetCurrentFF() As Word.FormField Dim rngFF As Word.Range Dim fldFF As Word.FormField Set rngFF = Selection.Range rngFF.Expand wdParagraph For Each fldFF In rngFF.FormFields Set GetCurrentFF = fldFF Exit For Next End Function http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "Tammy" wrote in message ... Hello- I am creating a document for a client. There will be certain areas that will be locked and certain areas where my client will need to input information. They wanted to know if there is a way that when their team types in their information that they can block out specific words so they wouldn't be able to type them in. For example, they have a long list of products and only want the client to be able to input certain product words but block out other ones. Is there anyway to do this? Thanks! |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
blocking specific text in Word
If you are using potected text form fields then you can validate those
fields for incorrect entry. The principles involved are described at http://www.gmayor.com/formfieldmacros.htm . To exclude words in a list, you can add code to the macros shown to validate the content against a list of banned words e.g. in the following example the list of banned words separated by commas is Const sList = "Tea,Coffee,Cocoa" The macro will filter out those words and require the user to re-enter a value in the field that is not banned. If the list of allowed expressions is less than 25, you can use a dropdown field instead (as suggested by Suzanne) which will eliminate the need for the macros. If the list is longer than 25 items and you wish to select from a list, you will need a userform. See instead http://gregmaxey.mvps.org/FormField_...rm_ListBox.htm Option Explicit Private mstrFF As String Private sBarred() As String Private i As Long Const sList = "Tea,Coffee,Cocoa" Private Sub AOnExit() sBarred = Split(sList, Chr(44)) With GetCurrentFF mstrFF = .name If Len(.Result) = 0 Then MsgBox "You can't leave field: " _ & .name & " blank" End If For i = 0 To UBound(sBarred) If InStr(1, .Result, LCase(sBarred(i))) = 1 Then MsgBox "You cannot use " & sBarred(i) Exit For End If Next i End With End Sub Private Sub AOnEntry() sBarred = Split(sList, Chr(44)) 'Goto another FormField if we weren't supposed to leave it! For i = 0 To UBound(sBarred) If InStr(1, ActiveDocument.FormFields(mstrFF).Result, _ LCase(sBarred(i))) = 1 Then ActiveDocument.FormFields(mstrFF).Select Exit For End If Next i If Len(ActiveDocument.FormFields(mstrFF).Result) = 0 Then ActiveDocument.FormFields(mstrFF).Select End If mstrFF = vbNullString End Sub Private Function GetCurrentFF() As Word.FormField Dim rngFF As Word.Range Dim fldFF As Word.FormField Set rngFF = Selection.Range rngFF.Expand wdParagraph For Each fldFF In rngFF.FormFields Set GetCurrentFF = fldFF Exit For Next End Function http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "Tammy" wrote in message ... Hello- I am creating a document for a client. There will be certain areas that will be locked and certain areas where my client will need to input information. They wanted to know if there is a way that when their team types in their information that they can block out specific words so they wouldn't be able to type them in. For example, they have a long list of products and only want the client to be able to input certain product words but block out other ones. Is there anyway to do this? Thanks! |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
blocking specific text in Word
Graham-
Let me rephrase, I don't think I was specific enough... The words that I need to have blocked out will actually be in a text box and not in any drop down list or form field. The phrase of words or word will change from person to person and from event to event. For example: My company is sponsoring an event to help "name of cause"; Stop by on 3/22/2010 for free samples of "name of product". The next time another representative would type in words for their event is might be rephrased to: On April 15, 2010 come join "our company" for a taste test about "name of product" and learn more about ways to help "name of cause" My client has given me specific "brands" that they don't want their representatives to use; this is where I need to know if there is any way specific "brands" can be blocked out and a phrase such as "[invalid text]" will be put in it's place once the representative types in the blocked word. I tried using Auto Correct but realized that it is only effective on my computer. Many different representatives will be using the word template so we basically want them to open document, type their info in, print and close the doc. We don't want to make this complicated where they will be having to launch any other features or install a new template feature etc. My client is using Word 2003; i am on a Mac using Word 2004 but have access to a PC with Word 2003 if need be. many thanks, tammy "Graham Mayor" wrote: If you are using potected text form fields then you can validate those fields for incorrect entry. The principles involved are described at http://www.gmayor.com/formfieldmacros.htm . To exclude words in a list, you can add code to the macros shown to validate the content against a list of banned words e.g. in the following example the list of banned words separated by commas is Const sList = "Tea,Coffee,Cocoa" The macro will filter out those words and require the user to re-enter a value in the field that is not banned. If the list of allowed expressions is less than 25, you can use a dropdown field instead (as suggested by Suzanne) which will eliminate the need for the macros. If the list is longer than 25 items and you wish to select from a list, you will need a userform. See instead http://gregmaxey.mvps.org/FormField_...rm_ListBox.htm Option Explicit Private mstrFF As String Private sBarred() As String Private i As Long Const sList = "Tea,Coffee,Cocoa" Private Sub AOnExit() sBarred = Split(sList, Chr(44)) With GetCurrentFF mstrFF = .name If Len(.Result) = 0 Then MsgBox "You can't leave field: " _ & .name & " blank" End If For i = 0 To UBound(sBarred) If InStr(1, .Result, LCase(sBarred(i))) = 1 Then MsgBox "You cannot use " & sBarred(i) Exit For End If Next i End With End Sub Private Sub AOnEntry() sBarred = Split(sList, Chr(44)) 'Goto another FormField if we weren't supposed to leave it! For i = 0 To UBound(sBarred) If InStr(1, ActiveDocument.FormFields(mstrFF).Result, _ LCase(sBarred(i))) = 1 Then ActiveDocument.FormFields(mstrFF).Select Exit For End If Next i If Len(ActiveDocument.FormFields(mstrFF).Result) = 0 Then ActiveDocument.FormFields(mstrFF).Select End If mstrFF = vbNullString End Sub Private Function GetCurrentFF() As Word.FormField Dim rngFF As Word.Range Dim fldFF As Word.FormField Set rngFF = Selection.Range rngFF.Expand wdParagraph For Each fldFF In rngFF.FormFields Set GetCurrentFF = fldFF Exit For Next End Function http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "Tammy" wrote in message ... Hello- I am creating a document for a client. There will be certain areas that will be locked and certain areas where my client will need to input information. They wanted to know if there is a way that when their team types in their information that they can block out specific words so they wouldn't be able to type them in. For example, they have a long list of products and only want the client to be able to input certain product words but block out other ones. Is there anyway to do this? Thanks! . |
#7
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
blocking specific text in Word
Graham-
Let me rephrase, I don't think I was specific enough... The words that I need to have blocked out will actually be in a text box and not in any drop down list or form field. The phrase of words or word will change from person to person and from event to event. For example: My company is sponsoring an event to help "name of cause"; Stop by on 3/22/2010 for free samples of "name of product". The next time another representative would type in words for their event is might be rephrased to: On April 15, 2010 come join "our company" for a taste test about "name of product" and learn more about ways to help "name of cause" My client has given me specific "brands" that they don't want their representatives to use; this is where I need to know if there is any way specific "brands" can be blocked out and a phrase such as "[invalid text]" will be put in it's place once the representative types in the blocked word. I tried using Auto Correct but realized that it is only effective on my computer. Many different representatives will be using the word template so we basically want them to open document, type their info in, print and close the doc. We don't want to make this complicated where they will be having to launch any other features or install a new template feature etc. My client is using Word 2003; i am on a Mac using Word 2004 but have access to a PC with Word 2003 if need be. many thanks, tammy "Graham Mayor" wrote: If you are using potected text form fields then you can validate those fields for incorrect entry. The principles involved are described at http://www.gmayor.com/formfieldmacros.htm . To exclude words in a list, you can add code to the macros shown to validate the content against a list of banned words e.g. in the following example the list of banned words separated by commas is Const sList = "Tea,Coffee,Cocoa" The macro will filter out those words and require the user to re-enter a value in the field that is not banned. If the list of allowed expressions is less than 25, you can use a dropdown field instead (as suggested by Suzanne) which will eliminate the need for the macros. If the list is longer than 25 items and you wish to select from a list, you will need a userform. See instead http://gregmaxey.mvps.org/FormField_...rm_ListBox.htm Option Explicit Private mstrFF As String Private sBarred() As String Private i As Long Const sList = "Tea,Coffee,Cocoa" Private Sub AOnExit() sBarred = Split(sList, Chr(44)) With GetCurrentFF mstrFF = .name If Len(.Result) = 0 Then MsgBox "You can't leave field: " _ & .name & " blank" End If For i = 0 To UBound(sBarred) If InStr(1, .Result, LCase(sBarred(i))) = 1 Then MsgBox "You cannot use " & sBarred(i) Exit For End If Next i End With End Sub Private Sub AOnEntry() sBarred = Split(sList, Chr(44)) 'Goto another FormField if we weren't supposed to leave it! For i = 0 To UBound(sBarred) If InStr(1, ActiveDocument.FormFields(mstrFF).Result, _ LCase(sBarred(i))) = 1 Then ActiveDocument.FormFields(mstrFF).Select Exit For End If Next i If Len(ActiveDocument.FormFields(mstrFF).Result) = 0 Then ActiveDocument.FormFields(mstrFF).Select End If mstrFF = vbNullString End Sub Private Function GetCurrentFF() As Word.FormField Dim rngFF As Word.Range Dim fldFF As Word.FormField Set rngFF = Selection.Range rngFF.Expand wdParagraph For Each fldFF In rngFF.FormFields Set GetCurrentFF = fldFF Exit For Next End Function http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "Tammy" wrote in message ... Hello- I am creating a document for a client. There will be certain areas that will be locked and certain areas where my client will need to input information. They wanted to know if there is a way that when their team types in their information that they can block out specific words so they wouldn't be able to type them in. For example, they have a long list of products and only want the client to be able to input certain product words but block out other ones. Is there anyway to do this? Thanks! . |
#8
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
blocking specific text in Word
I believe I figured out a solution to my problem; I created a macro that
input all of the "brands" that I would like "blocked" into Auto Correct and had it change my blocked words to: [invalid text] and it seems to be working out great. However, is there any way that this macro can start up automatically without having my client going to Macro and then Run or pressing a button on the toolbar? I saved the macro as an autoExec and then also tried Auto_Open but without clicking on Macro and then Run the macro will not execute. thanks, tammy "Tammy" wrote: Graham- Let me rephrase, I don't think I was specific enough... The words that I need to have blocked out will actually be in a text box and not in any drop down list or form field. The phrase of words or word will change from person to person and from event to event. For example: My company is sponsoring an event to help "name of cause"; Stop by on 3/22/2010 for free samples of "name of product". The next time another representative would type in words for their event is might be rephrased to: On April 15, 2010 come join "our company" for a taste test about "name of product" and learn more about ways to help "name of cause" My client has given me specific "brands" that they don't want their representatives to use; this is where I need to know if there is any way specific "brands" can be blocked out and a phrase such as "[invalid text]" will be put in it's place once the representative types in the blocked word. I tried using Auto Correct but realized that it is only effective on my computer. Many different representatives will be using the word template so we basically want them to open document, type their info in, print and close the doc. We don't want to make this complicated where they will be having to launch any other features or install a new template feature etc. My client is using Word 2003; i am on a Mac using Word 2004 but have access to a PC with Word 2003 if need be. many thanks, tammy "Graham Mayor" wrote: If you are using potected text form fields then you can validate those fields for incorrect entry. The principles involved are described at http://www.gmayor.com/formfieldmacros.htm . To exclude words in a list, you can add code to the macros shown to validate the content against a list of banned words e.g. in the following example the list of banned words separated by commas is Const sList = "Tea,Coffee,Cocoa" The macro will filter out those words and require the user to re-enter a value in the field that is not banned. If the list of allowed expressions is less than 25, you can use a dropdown field instead (as suggested by Suzanne) which will eliminate the need for the macros. If the list is longer than 25 items and you wish to select from a list, you will need a userform. See instead http://gregmaxey.mvps.org/FormField_...rm_ListBox.htm Option Explicit Private mstrFF As String Private sBarred() As String Private i As Long Const sList = "Tea,Coffee,Cocoa" Private Sub AOnExit() sBarred = Split(sList, Chr(44)) With GetCurrentFF mstrFF = .name If Len(.Result) = 0 Then MsgBox "You can't leave field: " _ & .name & " blank" End If For i = 0 To UBound(sBarred) If InStr(1, .Result, LCase(sBarred(i))) = 1 Then MsgBox "You cannot use " & sBarred(i) Exit For End If Next i End With End Sub Private Sub AOnEntry() sBarred = Split(sList, Chr(44)) 'Goto another FormField if we weren't supposed to leave it! For i = 0 To UBound(sBarred) If InStr(1, ActiveDocument.FormFields(mstrFF).Result, _ LCase(sBarred(i))) = 1 Then ActiveDocument.FormFields(mstrFF).Select Exit For End If Next i If Len(ActiveDocument.FormFields(mstrFF).Result) = 0 Then ActiveDocument.FormFields(mstrFF).Select End If mstrFF = vbNullString End Sub Private Function GetCurrentFF() As Word.FormField Dim rngFF As Word.Range Dim fldFF As Word.FormField Set rngFF = Selection.Range rngFF.Expand wdParagraph For Each fldFF In rngFF.FormFields Set GetCurrentFF = fldFF Exit For Next End Function http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "Tammy" wrote in message ... Hello- I am creating a document for a client. There will be certain areas that will be locked and certain areas where my client will need to input information. They wanted to know if there is a way that when their team types in their information that they can block out specific words so they wouldn't be able to type them in. For example, they have a long list of products and only want the client to be able to input certain product words but block out other ones. Is there anyway to do this? Thanks! . |
#9
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
blocking specific text in Word
I believe I figured out a solution to my problem; I created a macro that
input all of the "brands" that I would like "blocked" into Auto Correct and had it change my blocked words to: [invalid text] and it seems to be working out great. However, is there any way that this macro can start up automatically without having my client going to Macro and then Run or pressing a button on the toolbar? I saved the macro as an autoExec and then also tried Auto_Open but without clicking on Macro and then Run the macro will not execute. thanks, tammy "Tammy" wrote: Graham- Let me rephrase, I don't think I was specific enough... The words that I need to have blocked out will actually be in a text box and not in any drop down list or form field. The phrase of words or word will change from person to person and from event to event. For example: My company is sponsoring an event to help "name of cause"; Stop by on 3/22/2010 for free samples of "name of product". The next time another representative would type in words for their event is might be rephrased to: On April 15, 2010 come join "our company" for a taste test about "name of product" and learn more about ways to help "name of cause" My client has given me specific "brands" that they don't want their representatives to use; this is where I need to know if there is any way specific "brands" can be blocked out and a phrase such as "[invalid text]" will be put in it's place once the representative types in the blocked word. I tried using Auto Correct but realized that it is only effective on my computer. Many different representatives will be using the word template so we basically want them to open document, type their info in, print and close the doc. We don't want to make this complicated where they will be having to launch any other features or install a new template feature etc. My client is using Word 2003; i am on a Mac using Word 2004 but have access to a PC with Word 2003 if need be. many thanks, tammy "Graham Mayor" wrote: If you are using potected text form fields then you can validate those fields for incorrect entry. The principles involved are described at http://www.gmayor.com/formfieldmacros.htm . To exclude words in a list, you can add code to the macros shown to validate the content against a list of banned words e.g. in the following example the list of banned words separated by commas is Const sList = "Tea,Coffee,Cocoa" The macro will filter out those words and require the user to re-enter a value in the field that is not banned. If the list of allowed expressions is less than 25, you can use a dropdown field instead (as suggested by Suzanne) which will eliminate the need for the macros. If the list is longer than 25 items and you wish to select from a list, you will need a userform. See instead http://gregmaxey.mvps.org/FormField_...rm_ListBox.htm Option Explicit Private mstrFF As String Private sBarred() As String Private i As Long Const sList = "Tea,Coffee,Cocoa" Private Sub AOnExit() sBarred = Split(sList, Chr(44)) With GetCurrentFF mstrFF = .name If Len(.Result) = 0 Then MsgBox "You can't leave field: " _ & .name & " blank" End If For i = 0 To UBound(sBarred) If InStr(1, .Result, LCase(sBarred(i))) = 1 Then MsgBox "You cannot use " & sBarred(i) Exit For End If Next i End With End Sub Private Sub AOnEntry() sBarred = Split(sList, Chr(44)) 'Goto another FormField if we weren't supposed to leave it! For i = 0 To UBound(sBarred) If InStr(1, ActiveDocument.FormFields(mstrFF).Result, _ LCase(sBarred(i))) = 1 Then ActiveDocument.FormFields(mstrFF).Select Exit For End If Next i If Len(ActiveDocument.FormFields(mstrFF).Result) = 0 Then ActiveDocument.FormFields(mstrFF).Select End If mstrFF = vbNullString End Sub Private Function GetCurrentFF() As Word.FormField Dim rngFF As Word.Range Dim fldFF As Word.FormField Set rngFF = Selection.Range rngFF.Expand wdParagraph For Each fldFF In rngFF.FormFields Set GetCurrentFF = fldFF Exit For Next End Function http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "Tammy" wrote in message ... Hello- I am creating a document for a client. There will be certain areas that will be locked and certain areas where my client will need to input information. They wanted to know if there is a way that when their team types in their information that they can block out specific words so they wouldn't be able to type them in. For example, they have a long list of products and only want the client to be able to input certain product words but block out other ones. Is there anyway to do this? Thanks! . |
#10
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
blocking specific text in Word
I believe I figured out a solution to my problem; I created a macro that input all of the "brands" that I would like "blocked" into Auto Correct and had it change my blocked words to: [invalid text] and it seems to be working out great. However, is there any way that this macro can start up automatically without having my client going to Macro and then Run or pressing a button on the toolbar? I saved the macro as an autoExec and then also tried Auto_Open but without clicking on Macro and then Run the macro will not execute. thanks, tammy "Tammy" wrote: Graham- Let me rephrase, I don't think I was specific enough... The words that I need to have blocked out will actually be in a text box and not in any drop down list or form field. The phrase of words or word will change from person to person and from event to event. For example: My company is sponsoring an event to help "name of cause"; Stop by on 3/22/2010 for free samples of "name of product". The next time another representative would type in words for their event is might be rephrased to: On April 15, 2010 come join "our company" for a taste test about "name of product" and learn more about ways to help "name of cause" My client has given me specific "brands" that they don't want their representatives to use; this is where I need to know if there is any way specific "brands" can be blocked out and a phrase such as "[invalid text]" will be put in it's place once the representative types in the blocked word. I tried using Auto Correct but realized that it is only effective on my computer. Many different representatives will be using the word template so we basically want them to open document, type their info in, print and close the doc. We don't want to make this complicated where they will be having to launch any other features or install a new template feature etc. My client is using Word 2003; i am on a Mac using Word 2004 but have access to a PC with Word 2003 if need be. many thanks, tammy "Graham Mayor" wrote: If you are using potected text form fields then you can validate those fields for incorrect entry. The principles involved are described at http://www.gmayor.com/formfieldmacros.htm . To exclude words in a list, you can add code to the macros shown to validate the content against a list of banned words e.g. in the following example the list of banned words separated by commas is Const sList = "Tea,Coffee,Cocoa" The macro will filter out those words and require the user to re-enter a value in the field that is not banned. If the list of allowed expressions is less than 25, you can use a dropdown field instead (as suggested by Suzanne) which will eliminate the need for the macros. If the list is longer than 25 items and you wish to select from a list, you will need a userform. See instead http://gregmaxey.mvps.org/FormField_...rm_ListBox.htm Option Explicit Private mstrFF As String Private sBarred() As String Private i As Long Const sList = "Tea,Coffee,Cocoa" Private Sub AOnExit() sBarred = Split(sList, Chr(44)) With GetCurrentFF mstrFF = .name If Len(.Result) = 0 Then MsgBox "You can't leave field: " _ & .name & " blank" End If For i = 0 To UBound(sBarred) If InStr(1, .Result, LCase(sBarred(i))) = 1 Then MsgBox "You cannot use " & sBarred(i) Exit For End If Next i End With End Sub Private Sub AOnEntry() sBarred = Split(sList, Chr(44)) 'Goto another FormField if we weren't supposed to leave it! For i = 0 To UBound(sBarred) If InStr(1, ActiveDocument.FormFields(mstrFF).Result, _ LCase(sBarred(i))) = 1 Then ActiveDocument.FormFields(mstrFF).Select Exit For End If Next i If Len(ActiveDocument.FormFields(mstrFF).Result) = 0 Then ActiveDocument.FormFields(mstrFF).Select End If mstrFF = vbNullString End Sub Private Function GetCurrentFF() As Word.FormField Dim rngFF As Word.Range Dim fldFF As Word.FormField Set rngFF = Selection.Range rngFF.Expand wdParagraph For Each fldFF In rngFF.FormFields Set GetCurrentFF = fldFF Exit For Next End Function http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "Tammy" wrote in message ... Hello- I am creating a document for a client. There will be certain areas that will be locked and certain areas where my client will need to input information. They wanted to know if there is a way that when their team types in their information that they can block out specific words so they wouldn't be able to type them in. For example, they have a long list of products and only want the client to be able to input certain product words but block out other ones. Is there anyway to do this? Thanks! . |
#11
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
blocking specific text in Word
I believe I figured out a solution to my problem; I created a macro that input all of the "brands" that I would like "blocked" into Auto Correct and had it change my blocked words to: [invalid text] and it seems to be working out great. However, is there any way that this macro can start up automatically without having my client going to Macro and then Run or pressing a button on the toolbar? I saved the macro as an autoExec and then also tried Auto_Open but without clicking on Macro and then Run the macro will not execute. thanks, tammy "Tammy" wrote: Graham- Let me rephrase, I don't think I was specific enough... The words that I need to have blocked out will actually be in a text box and not in any drop down list or form field. The phrase of words or word will change from person to person and from event to event. For example: My company is sponsoring an event to help "name of cause"; Stop by on 3/22/2010 for free samples of "name of product". The next time another representative would type in words for their event is might be rephrased to: On April 15, 2010 come join "our company" for a taste test about "name of product" and learn more about ways to help "name of cause" My client has given me specific "brands" that they don't want their representatives to use; this is where I need to know if there is any way specific "brands" can be blocked out and a phrase such as "[invalid text]" will be put in it's place once the representative types in the blocked word. I tried using Auto Correct but realized that it is only effective on my computer. Many different representatives will be using the word template so we basically want them to open document, type their info in, print and close the doc. We don't want to make this complicated where they will be having to launch any other features or install a new template feature etc. My client is using Word 2003; i am on a Mac using Word 2004 but have access to a PC with Word 2003 if need be. many thanks, tammy "Graham Mayor" wrote: If you are using potected text form fields then you can validate those fields for incorrect entry. The principles involved are described at http://www.gmayor.com/formfieldmacros.htm . To exclude words in a list, you can add code to the macros shown to validate the content against a list of banned words e.g. in the following example the list of banned words separated by commas is Const sList = "Tea,Coffee,Cocoa" The macro will filter out those words and require the user to re-enter a value in the field that is not banned. If the list of allowed expressions is less than 25, you can use a dropdown field instead (as suggested by Suzanne) which will eliminate the need for the macros. If the list is longer than 25 items and you wish to select from a list, you will need a userform. See instead http://gregmaxey.mvps.org/FormField_...rm_ListBox.htm Option Explicit Private mstrFF As String Private sBarred() As String Private i As Long Const sList = "Tea,Coffee,Cocoa" Private Sub AOnExit() sBarred = Split(sList, Chr(44)) With GetCurrentFF mstrFF = .name If Len(.Result) = 0 Then MsgBox "You can't leave field: " _ & .name & " blank" End If For i = 0 To UBound(sBarred) If InStr(1, .Result, LCase(sBarred(i))) = 1 Then MsgBox "You cannot use " & sBarred(i) Exit For End If Next i End With End Sub Private Sub AOnEntry() sBarred = Split(sList, Chr(44)) 'Goto another FormField if we weren't supposed to leave it! For i = 0 To UBound(sBarred) If InStr(1, ActiveDocument.FormFields(mstrFF).Result, _ LCase(sBarred(i))) = 1 Then ActiveDocument.FormFields(mstrFF).Select Exit For End If Next i If Len(ActiveDocument.FormFields(mstrFF).Result) = 0 Then ActiveDocument.FormFields(mstrFF).Select End If mstrFF = vbNullString End Sub Private Function GetCurrentFF() As Word.FormField Dim rngFF As Word.Range Dim fldFF As Word.FormField Set rngFF = Selection.Range rngFF.Expand wdParagraph For Each fldFF In rngFF.FormFields Set GetCurrentFF = fldFF Exit For Next End Function http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "Tammy" wrote in message ... Hello- I am creating a document for a client. There will be certain areas that will be locked and certain areas where my client will need to input information. They wanted to know if there is a way that when their team types in their information that they can block out specific words so they wouldn't be able to type them in. For example, they have a long list of products and only want the client to be able to input certain product words but block out other ones. Is there anyway to do this? Thanks! . |
#12
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
blocking specific text in Word
OK autocorrect might work, but as you have gathered autocorrect is a local
setting and is not stored with the document template What might work is the following. Add an autonew macro to the document template and create new documents from it. This uses a sequence of Words to create the entries, separated by commas. In this case word1, word2, word3 and word4. You can change these for the real words and add to them as required. It might be nice also to tidy up when you have finished with them so a second macro AutoClose deletes the same list of entries. sEntry = Split("word1,word2,word3,word4", ",") Option Explicit Public sEntry() As String Public i As Long, j As Long Sub AutoNew() sEntry = Split("word1,word2,word3,word4", ",") For i = 0 To UBound(sEntry) Word.AutoCorrect.Entries.Add Name:=sEntry(i), Value:="[invalid text]" Next i End Sub Sub AutoClose() sEntry = Split("word1,word2,word3,word4", ",") For i = Word.AutoCorrect.Entries.Count To 1 Step -1 For j = 0 To UBound(sEntry) If Word.AutoCorrect.Entries.Item(i).Name = sEntry(j) Then Word.AutoCorrect.Entries.Item(i).Delete End If Next j Next i End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "Tammy" wrote in message ... I believe I figured out a solution to my problem; I created a macro that input all of the "brands" that I would like "blocked" into Auto Correct and had it change my blocked words to: [invalid text] and it seems to be working out great. However, is there any way that this macro can start up automatically without having my client going to Macro and then Run or pressing a button on the toolbar? I saved the macro as an autoExec and then also tried Auto_Open but without clicking on Macro and then Run the macro will not execute. thanks, tammy "Tammy" wrote: Graham- Let me rephrase, I don't think I was specific enough... The words that I need to have blocked out will actually be in a text box and not in any drop down list or form field. The phrase of words or word will change from person to person and from event to event. For example: My company is sponsoring an event to help "name of cause"; Stop by on 3/22/2010 for free samples of "name of product". The next time another representative would type in words for their event is might be rephrased to: On April 15, 2010 come join "our company" for a taste test about "name of product" and learn more about ways to help "name of cause" My client has given me specific "brands" that they don't want their representatives to use; this is where I need to know if there is any way specific "brands" can be blocked out and a phrase such as "[invalid text]" will be put in it's place once the representative types in the blocked word. I tried using Auto Correct but realized that it is only effective on my computer. Many different representatives will be using the word template so we basically want them to open document, type their info in, print and close the doc. We don't want to make this complicated where they will be having to launch any other features or install a new template feature etc. My client is using Word 2003; i am on a Mac using Word 2004 but have access to a PC with Word 2003 if need be. many thanks, tammy "Graham Mayor" wrote: If you are using potected text form fields then you can validate those fields for incorrect entry. The principles involved are described at http://www.gmayor.com/formfieldmacros.htm . To exclude words in a list, you can add code to the macros shown to validate the content against a list of banned words e.g. in the following example the list of banned words separated by commas is Const sList = "Tea,Coffee,Cocoa" The macro will filter out those words and require the user to re-enter a value in the field that is not banned. If the list of allowed expressions is less than 25, you can use a dropdown field instead (as suggested by Suzanne) which will eliminate the need for the macros. If the list is longer than 25 items and you wish to select from a list, you will need a userform. See instead http://gregmaxey.mvps.org/FormField_...rm_ListBox.htm Option Explicit Private mstrFF As String Private sBarred() As String Private i As Long Const sList = "Tea,Coffee,Cocoa" Private Sub AOnExit() sBarred = Split(sList, Chr(44)) With GetCurrentFF mstrFF = .name If Len(.Result) = 0 Then MsgBox "You can't leave field: " _ & .name & " blank" End If For i = 0 To UBound(sBarred) If InStr(1, .Result, LCase(sBarred(i))) = 1 Then MsgBox "You cannot use " & sBarred(i) Exit For End If Next i End With End Sub Private Sub AOnEntry() sBarred = Split(sList, Chr(44)) 'Goto another FormField if we weren't supposed to leave it! For i = 0 To UBound(sBarred) If InStr(1, ActiveDocument.FormFields(mstrFF).Result, _ LCase(sBarred(i))) = 1 Then ActiveDocument.FormFields(mstrFF).Select Exit For End If Next i If Len(ActiveDocument.FormFields(mstrFF).Result) = 0 Then ActiveDocument.FormFields(mstrFF).Select End If mstrFF = vbNullString End Sub Private Function GetCurrentFF() As Word.FormField Dim rngFF As Word.Range Dim fldFF As Word.FormField Set rngFF = Selection.Range rngFF.Expand wdParagraph For Each fldFF In rngFF.FormFields Set GetCurrentFF = fldFF Exit For Next End Function http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "Tammy" wrote in message ... Hello- I am creating a document for a client. There will be certain areas that will be locked and certain areas where my client will need to input information. They wanted to know if there is a way that when their team types in their information that they can block out specific words so they wouldn't be able to type them in. For example, they have a long list of products and only want the client to be able to input certain product words but block out other ones. Is there anyway to do this? Thanks! . |
#13
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
blocking specific text in Word
OK autocorrect might work, but as you have gathered autocorrect is a local
setting and is not stored with the document template What might work is the following. Add an autonew macro to the document template and create new documents from it. This uses a sequence of Words to create the entries, separated by commas. In this case word1, word2, word3 and word4. You can change these for the real words and add to them as required. It might be nice also to tidy up when you have finished with them so a second macro AutoClose deletes the same list of entries. sEntry = Split("word1,word2,word3,word4", ",") Option Explicit Public sEntry() As String Public i As Long, j As Long Sub AutoNew() sEntry = Split("word1,word2,word3,word4", ",") For i = 0 To UBound(sEntry) Word.AutoCorrect.Entries.Add Name:=sEntry(i), Value:="[invalid text]" Next i End Sub Sub AutoClose() sEntry = Split("word1,word2,word3,word4", ",") For i = Word.AutoCorrect.Entries.Count To 1 Step -1 For j = 0 To UBound(sEntry) If Word.AutoCorrect.Entries.Item(i).Name = sEntry(j) Then Word.AutoCorrect.Entries.Item(i).Delete End If Next j Next i End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "Tammy" wrote in message ... I believe I figured out a solution to my problem; I created a macro that input all of the "brands" that I would like "blocked" into Auto Correct and had it change my blocked words to: [invalid text] and it seems to be working out great. However, is there any way that this macro can start up automatically without having my client going to Macro and then Run or pressing a button on the toolbar? I saved the macro as an autoExec and then also tried Auto_Open but without clicking on Macro and then Run the macro will not execute. thanks, tammy "Tammy" wrote: Graham- Let me rephrase, I don't think I was specific enough... The words that I need to have blocked out will actually be in a text box and not in any drop down list or form field. The phrase of words or word will change from person to person and from event to event. For example: My company is sponsoring an event to help "name of cause"; Stop by on 3/22/2010 for free samples of "name of product". The next time another representative would type in words for their event is might be rephrased to: On April 15, 2010 come join "our company" for a taste test about "name of product" and learn more about ways to help "name of cause" My client has given me specific "brands" that they don't want their representatives to use; this is where I need to know if there is any way specific "brands" can be blocked out and a phrase such as "[invalid text]" will be put in it's place once the representative types in the blocked word. I tried using Auto Correct but realized that it is only effective on my computer. Many different representatives will be using the word template so we basically want them to open document, type their info in, print and close the doc. We don't want to make this complicated where they will be having to launch any other features or install a new template feature etc. My client is using Word 2003; i am on a Mac using Word 2004 but have access to a PC with Word 2003 if need be. many thanks, tammy "Graham Mayor" wrote: If you are using potected text form fields then you can validate those fields for incorrect entry. The principles involved are described at http://www.gmayor.com/formfieldmacros.htm . To exclude words in a list, you can add code to the macros shown to validate the content against a list of banned words e.g. in the following example the list of banned words separated by commas is Const sList = "Tea,Coffee,Cocoa" The macro will filter out those words and require the user to re-enter a value in the field that is not banned. If the list of allowed expressions is less than 25, you can use a dropdown field instead (as suggested by Suzanne) which will eliminate the need for the macros. If the list is longer than 25 items and you wish to select from a list, you will need a userform. See instead http://gregmaxey.mvps.org/FormField_...rm_ListBox.htm Option Explicit Private mstrFF As String Private sBarred() As String Private i As Long Const sList = "Tea,Coffee,Cocoa" Private Sub AOnExit() sBarred = Split(sList, Chr(44)) With GetCurrentFF mstrFF = .name If Len(.Result) = 0 Then MsgBox "You can't leave field: " _ & .name & " blank" End If For i = 0 To UBound(sBarred) If InStr(1, .Result, LCase(sBarred(i))) = 1 Then MsgBox "You cannot use " & sBarred(i) Exit For End If Next i End With End Sub Private Sub AOnEntry() sBarred = Split(sList, Chr(44)) 'Goto another FormField if we weren't supposed to leave it! For i = 0 To UBound(sBarred) If InStr(1, ActiveDocument.FormFields(mstrFF).Result, _ LCase(sBarred(i))) = 1 Then ActiveDocument.FormFields(mstrFF).Select Exit For End If Next i If Len(ActiveDocument.FormFields(mstrFF).Result) = 0 Then ActiveDocument.FormFields(mstrFF).Select End If mstrFF = vbNullString End Sub Private Function GetCurrentFF() As Word.FormField Dim rngFF As Word.Range Dim fldFF As Word.FormField Set rngFF = Selection.Range rngFF.Expand wdParagraph For Each fldFF In rngFF.FormFields Set GetCurrentFF = fldFF Exit For Next End Function http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "Tammy" wrote in message ... Hello- I am creating a document for a client. There will be certain areas that will be locked and certain areas where my client will need to input information. They wanted to know if there is a way that when their team types in their information that they can block out specific words so they wouldn't be able to type them in. For example, they have a long list of products and only want the client to be able to input certain product words but block out other ones. Is there anyway to do this? Thanks! . |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Watermark is blocking out text | Microsoft Word Help | |||
How to find specific documents with specific text in Word 2007 | Microsoft Word Help | |||
Blocking a column from text flow | Page Layout | |||
Blocking out text in a table | Tables | |||
text blocking | Microsoft Word Help |