Re: reducing font of a bookmark field by Charlie
Charlie
Wed Jan 12 11:19:03 CST 2005
Many Many thanks, Greg
ps. is there some kind of help file download that would help me with basic
word programming that would have lots of examples? The built in help file
seems limited... Thanks, Chalrie
"Greg Maxey" wrote:
> Charlie,
>
> What have your tried?
>
> Try:
>
> Sub ScratchMacro()
> Dim oFld As Field
>
> For Each oFld In ActiveDocument.Fields
> If oFld.Type = wdFieldRef Then
> If InStr(oFld.Code.Text, "Location") Then
> If InStr(oFld.Result.Text, Chr(11)) > 0 Then
> oFld.Result.Font.Size = 10
> End If
> End If
> End If
> Next oFld
> End Sub
>
> --
> Greg Maxey/Word MVP
> A Peer in Peer to Peer Support
>
> Charlie wrote:
> > GREAT!!! This worked. However, I need to update only a specific
> > field with the name {LOCATION}, but this changed other fields, too.
> > How do I change this code to do only the field {location}? many
> > thanks, charlie
> >
> > "Greg Maxey" wrote:
> >
> >> Charlie,
> >>
> >> Then you don't have bookmarked text in your document, you have REF
> >> Fields. If you proviided the input via a ASK input screen then what
> >> you call paragraph marks are line breaks. Try:
> >>
> >> Sub ScratchMacro()
> >> Dim oFld As Field
> >>
> >> For Each oFld In ActiveDocument.Fields
> >> If InStr(oFld.Result.Text, Chr(11)) > 0 Then
> >> oFld.Result.Font.Size = 10
> >> End If
> >> Next oFld
> >> End Sub
> >>
> >> --
> >> Greg Maxey/Word MVP
> >> A Peer in Peer to Peer Support
> >>
> >> Charlie wrote:
> >>> PS. I copied the code out of your scratchmacro and inserted it right
> >>> at the end of my AutoNew() macro.
> >>>
> >>> "Charlie" wrote:
> >>>
> >>>> I'd like to add some code that would check to see if the text of a
> >>>> bookmark field is two lines (containing a paragraph mark) and if it
> >>>> is, then to reduce the font of all those bookmarks to 10 point so
> >>>> it will fit in the allotted space in my form. Thanks, charlie
>
>
>