From: Doug G on 1 Mar 2010 09:36 I have some docvariables tied to docvariable fields of which some need to be BOLD fonts but others tied to the same field do not. If I bold the field in the document, then all the docvariables are bold which is not my intent. How can i selectively bold some but not all of the docvariables? I've tried to highlight the specific variable and "control-B" but it doesn't seem to have any affect. tx
From: Greg Maxey on 1 Mar 2010 09:53 Sub ScratchMaco() MsgBox "Use the ""\* CharFormat"" switch in your DocVariable fields and format" _ & "the ""D"" in ""DocVarialbe"" as ""BOLD""" End Sub Doug G wrote: > I have some docvariables tied to docvariable fields of which some > need to be BOLD fonts but others tied to the same field do not. If I > bold the field in the document, then all the docvariables are bold > which is not my intent. How can i selectively bold some but not all > of the docvariables? I've tried to highlight the specific variable > and "control-B" but it doesn't seem to have any affect. tx
From: Doug G on 1 Mar 2010 11:12 Greg, thanks for the reply I copy pasted your macro into a new macro but not sure how to apply your MsgBox. If i modify the DocVariable field, won't that affect all the DocVariables associated with that field. Also, i'm not familiar with what the ""\* CharFormat"" switch is and the underscore you referenced after the FORMAT" below. I think i understand making the "D" in docvariable bold, that one seems simple enough. Apologies for rookie questions. "Greg Maxey" wrote: > Sub ScratchMaco() > MsgBox "Use the ""\* CharFormat"" switch in your DocVariable fields and > format" _ > & "the ""D"" in ""DocVarialbe"" as ""BOLD""" > End Sub > > > > Doug G wrote: > > I have some docvariables tied to docvariable fields of which some > > need to be BOLD fonts but others tied to the same field do not. If I > > bold the field in the document, then all the docvariables are bold > > which is not my intent. How can i selectively bold some but not all > > of the docvariables? I've tried to highlight the specific variable > > and "control-B" but it doesn't seem to have any affect. tx > > > . >
From: Greg Maxey on 1 Mar 2010 12:01 Doug, I was being a bit playful. Your question seemed to deal with DocVariable fields (vice VBA) and I simply used a VBA messagebox function to provide an answer. Sorry for the confusion. Say you have created a variable named "Test" ActiveDocument.Variables("Test").Value = "This is a test" In the document you have several fields referencing that variable: { DocVariable Test }, {DocVariable Test}, etc. The oney you want to display as bold construct like this: {DocVariable Test \* CharFormat } and apply bold text to the "D" in "DocVariable. Doug G wrote: > Greg, thanks for the reply > I copy pasted your macro into a new macro but not sure how to apply > your MsgBox. If i modify the DocVariable field, won't that affect all > the DocVariables associated with that field. Also, i'm not familiar > with what the ""\* CharFormat"" switch is and the underscore you > referenced after the FORMAT" below. I think i understand making the > "D" in docvariable bold, that one seems simple enough. Apologies for > rookie questions. > > "Greg Maxey" wrote: > >> Sub ScratchMaco() >> MsgBox "Use the ""\* CharFormat"" switch in your DocVariable fields >> and format" _ >> & "the ""D"" in ""DocVarialbe"" as ""BOLD""" >> End Sub >> >> >> >> Doug G wrote: >>> I have some docvariables tied to docvariable fields of which some >>> need to be BOLD fonts but others tied to the same field do not. If I >>> bold the field in the document, then all the docvariables are bold >>> which is not my intent. How can i selectively bold some but not all >>> of the docvariables? I've tried to highlight the specific variable >>> and "control-B" but it doesn't seem to have any affect. tx >> >> >> .
From: Doug G on 4 Mar 2010 10:38 Greg, thanks for clarifying. I was able to get your solution to work however my situation is a reversed concept I think. My DocVariable Field is shared by a number of DocVariables that are pulled into the Active Document field based on a pull down menu macro. Some of these DocVariables I want in BOLD font whereas others I do not, e.g. DocVariable Field={DocVariable "varApplianceBrand"} and the DocVariable=ActiveDocument.Variables("varApplianceBrand").Value = "Frigidaire" or ActiveDocument.Variables("varApplianceBrand").Value = "General Electric" or ActiveDocument.Variables("varApplianceBrand").Value = "Viking" I would like to BOLD font the word "Viking" but not the others when it's applied to the field. "Greg Maxey" wrote: > Doug, > > I was being a bit playful. Your question seemed to deal with DocVariable > fields (vice VBA) and I simply used a VBA messagebox function to provide an > answer. Sorry for the confusion. > > Say you have created a variable named "Test" > > ActiveDocument.Variables("Test").Value = "This is a test" > > In the document you have several fields referencing that variable: > > { DocVariable Test }, {DocVariable Test}, etc. > > The oney you want to display as bold construct like this: {DocVariable Test > \* CharFormat } and apply bold text to the "D" in "DocVariable. > > > > Doug G wrote: > > Greg, thanks for the reply > > I copy pasted your macro into a new macro but not sure how to apply > > your MsgBox. If i modify the DocVariable field, won't that affect all > > the DocVariables associated with that field. Also, i'm not familiar > > with what the ""\* CharFormat"" switch is and the underscore you > > referenced after the FORMAT" below. I think i understand making the > > "D" in docvariable bold, that one seems simple enough. Apologies for > > rookie questions. > > > > "Greg Maxey" wrote: > > > >> Sub ScratchMaco() > >> MsgBox "Use the ""\* CharFormat"" switch in your DocVariable fields > >> and format" _ > >> & "the ""D"" in ""DocVarialbe"" as ""BOLD""" > >> End Sub > >> > >> > >> > >> Doug G wrote: > >>> I have some docvariables tied to docvariable fields of which some > >>> need to be BOLD fonts but others tied to the same field do not. If I > >>> bold the field in the document, then all the docvariables are bold > >>> which is not my intent. How can i selectively bold some but not all > >>> of the docvariables? I've tried to highlight the specific variable > >>> and "control-B" but it doesn't seem to have any affect. tx > >> > >> > >> . > > > . >
|
Pages: 1 Prev: VBA Macro: Word 2003 (FormFields) Next: Capture user selection of font |