Editing field properties

Hi everyone,
I need to change the properties of a lot of StyleRef fields, but am not sure 
how to go about it. Where a StyleRef refers to "Heading 1" I need it to refer 
to "Heading 2". The fields are mainly in headers and footers, but could be 
anywhere in a document.
-- 
Stephenc
0
Utf
4/23/2010 3:24:01 PM
word.vba.general 1023 articles. 1 followers. Follow

5 Replies
1134 Views

Similar Articles

[PageSpeed] 19

The first step is to press Alt+F9 to display all the field codes in the 
document.

The StyleRef field codes will probably look like

{ STYLEREF  "Heading 1"  \* MERGEFORMAT }

although the keywords may be lower case or mixed case if some of the fields 
were created manually instead of using the Insert Field dialog.

Open the Replace dialog, click the More button, and check the "Use 
wildcards" box. Put the following expression in the Find What box:

(STYLEREF*Heading) 1

and put this one in the Replace With box:

\1 2

Be careful to include the spaces in the expressions, or use copy/paste from 
this post. Make sure the Search dropdown is set to All, and click the 
Replace All button. This will search all the areas of the document, 
including headers and footers.

If some of the field codes are lower case or mixed case, you'll need to 
repeat the replacement with the matching case in the Find What box; wildcard 
searches are always case-sensitive.

-- 
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so 
all may benefit.

stephenc wrote:
> Hi everyone,
> I need to change the properties of a lot of StyleRef fields, but am
> not sure how to go about it. Where a StyleRef refers to "Heading 1" I
> need it to refer to "Heading 2". The fields are mainly in headers and
> footers, but could be anywhere in a document. 


0
Jay
4/23/2010 4:29:46 PM
Thanks for helping me, Jay. I really appreciate it.
-- 
Stephenc


"Jay Freedman" wrote:

> The first step is to press Alt+F9 to display all the field codes in the 
> document.
> 
> The StyleRef field codes will probably look like
> 
> { STYLEREF  "Heading 1"  \* MERGEFORMAT }
> 
> although the keywords may be lower case or mixed case if some of the fields 
> were created manually instead of using the Insert Field dialog.
> 
> Open the Replace dialog, click the More button, and check the "Use 
> wildcards" box. Put the following expression in the Find What box:
> 
> (STYLEREF*Heading) 1
> 
> and put this one in the Replace With box:
> 
> \1 2
> 
> Be careful to include the spaces in the expressions, or use copy/paste from 
> this post. Make sure the Search dropdown is set to All, and click the 
> Replace All button. This will search all the areas of the document, 
> including headers and footers.
> 
> If some of the field codes are lower case or mixed case, you'll need to 
> repeat the replacement with the matching case in the Find What box; wildcard 
> searches are always case-sensitive.
> 
> -- 
> Regards,
> Jay Freedman
> Microsoft Word MVP        FAQ: http://word.mvps.org
> Email cannot be acknowledged; please post all follow-ups to the newsgroup so 
> all may benefit.
> 
> stephenc wrote:
> > Hi everyone,
> > I need to change the properties of a lot of StyleRef fields, but am
> > not sure how to go about it. Where a StyleRef refers to "Heading 1" I
> > need it to refer to "Heading 2". The fields are mainly in headers and
> > footers, but could be anywhere in a document. 
> 
> 
> .
> 
0
Utf
4/24/2010 9:58:01 AM
I've not used Replace to work with fields before. Just out of interest, what 
is the construct for replacing the style name? For example, if I wanted to 
change "Heading 1" to "Contents"?
-- 
Stephenc


"Jay Freedman" wrote:

> The first step is to press Alt+F9 to display all the field codes in the 
> document.
> 
> The StyleRef field codes will probably look like
> 
> { STYLEREF  "Heading 1"  \* MERGEFORMAT }
> 
> although the keywords may be lower case or mixed case if some of the fields 
> were created manually instead of using the Insert Field dialog.
> 
> Open the Replace dialog, click the More button, and check the "Use 
> wildcards" box. Put the following expression in the Find What box:
> 
> (STYLEREF*Heading) 1
> 
> and put this one in the Replace With box:
> 
> \1 2
> 
> Be careful to include the spaces in the expressions, or use copy/paste from 
> this post. Make sure the Search dropdown is set to All, and click the 
> Replace All button. This will search all the areas of the document, 
> including headers and footers.
> 
> If some of the field codes are lower case or mixed case, you'll need to 
> repeat the replacement with the matching case in the Find What box; wildcard 
> searches are always case-sensitive.
> 
> -- 
> Regards,
> Jay Freedman
> Microsoft Word MVP        FAQ: http://word.mvps.org
> Email cannot be acknowledged; please post all follow-ups to the newsgroup so 
> all may benefit.
> 
> stephenc wrote:
> > Hi everyone,
> > I need to change the properties of a lot of StyleRef fields, but am
> > not sure how to go about it. Where a StyleRef refers to "Heading 1" I
> > need it to refer to "Heading 2". The fields are mainly in headers and
> > footers, but could be anywhere in a document. 
> 
> 
> .
> 
0
Utf
4/26/2010 3:37:02 PM
For the Find What box, use the expression

(STYLEREF*)Heading 1

For the Replace With box, use

\1Contents

The (STYLEREF*) part of the search expression will match the word STYLEREF 
plus the space and quote mark, and that will be used as the value of the \1 
in the replacement expression.

-- 
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so 
all may benefit.

stephenc wrote:
> I've not used Replace to work with fields before. Just out of
> interest, what is the construct for replacing the style name? For
> example, if I wanted to change "Heading 1" to "Contents"?
>
>> The first step is to press Alt+F9 to display all the field codes in
>> the document.
>>
>> The StyleRef field codes will probably look like
>>
>> { STYLEREF  "Heading 1"  \* MERGEFORMAT }
>>
>> although the keywords may be lower case or mixed case if some of the
>> fields were created manually instead of using the Insert Field
>> dialog.
>>
>> Open the Replace dialog, click the More button, and check the "Use
>> wildcards" box. Put the following expression in the Find What box:
>>
>> (STYLEREF*Heading) 1
>>
>> and put this one in the Replace With box:
>>
>> \1 2
>>
>> Be careful to include the spaces in the expressions, or use
>> copy/paste from this post. Make sure the Search dropdown is set to
>> All, and click the Replace All button. This will search all the
>> areas of the document, including headers and footers.
>>
>> If some of the field codes are lower case or mixed case, you'll need
>> to repeat the replacement with the matching case in the Find What
>> box; wildcard searches are always case-sensitive.
>>
>> --
>> Regards,
>> Jay Freedman
>> Microsoft Word MVP        FAQ: http://word.mvps.org
>> Email cannot be acknowledged; please post all follow-ups to the
>> newsgroup so all may benefit.
>>
>> stephenc wrote:
>>> Hi everyone,
>>> I need to change the properties of a lot of StyleRef fields, but am
>>> not sure how to go about it. Where a StyleRef refers to "Heading 1"
>>> I need it to refer to "Heading 2". The fields are mainly in headers
>>> and footers, but could be anywhere in a document.
>>
>>
>> . 


0
Jay
4/26/2010 4:37:43 PM
Thanks for sharing your knowledge. I've since spent some time playing around 
with this in VBA, to really understand what Find|Replace can do with fields.
-- 
Stephenc


"Jay Freedman" wrote:

> For the Find What box, use the expression
> 
> (STYLEREF*)Heading 1
> 
> For the Replace With box, use
> 
> \1Contents
> 
> The (STYLEREF*) part of the search expression will match the word STYLEREF 
> plus the space and quote mark, and that will be used as the value of the \1 
> in the replacement expression.
> 
> -- 
> Regards,
> Jay Freedman
> Microsoft Word MVP        FAQ: http://word.mvps.org
> Email cannot be acknowledged; please post all follow-ups to the newsgroup so 
> all may benefit.
> 
> stephenc wrote:
> > I've not used Replace to work with fields before. Just out of
> > interest, what is the construct for replacing the style name? For
> > example, if I wanted to change "Heading 1" to "Contents"?
> >
> >> The first step is to press Alt+F9 to display all the field codes in
> >> the document.
> >>
> >> The StyleRef field codes will probably look like
> >>
> >> { STYLEREF  "Heading 1"  \* MERGEFORMAT }
> >>
> >> although the keywords may be lower case or mixed case if some of the
> >> fields were created manually instead of using the Insert Field
> >> dialog.
> >>
> >> Open the Replace dialog, click the More button, and check the "Use
> >> wildcards" box. Put the following expression in the Find What box:
> >>
> >> (STYLEREF*Heading) 1
> >>
> >> and put this one in the Replace With box:
> >>
> >> \1 2
> >>
> >> Be careful to include the spaces in the expressions, or use
> >> copy/paste from this post. Make sure the Search dropdown is set to
> >> All, and click the Replace All button. This will search all the
> >> areas of the document, including headers and footers.
> >>
> >> If some of the field codes are lower case or mixed case, you'll need
> >> to repeat the replacement with the matching case in the Find What
> >> box; wildcard searches are always case-sensitive.
> >>
> >> --
> >> Regards,
> >> Jay Freedman
> >> Microsoft Word MVP        FAQ: http://word.mvps.org
> >> Email cannot be acknowledged; please post all follow-ups to the
> >> newsgroup so all may benefit.
> >>
> >> stephenc wrote:
> >>> Hi everyone,
> >>> I need to change the properties of a lot of StyleRef fields, but am
> >>> not sure how to go about it. Where a StyleRef refers to "Heading 1"
> >>> I need it to refer to "Heading 2". The fields are mainly in headers
> >>> and footers, but could be anywhere in a document.
> >>
> >>
> >> . 
> 
> 
> .
> 
0
Utf
4/27/2010 9:53:01 AM
Reply:

Similar Artilces:

Query with two date field for Date range
How do I create a Query using two tables that have dates field to calculate a value using both the tables for a Date Range. For Example I have four TABLES- Time Card(TC), PROJECT, TC hours(HOURS), and TC expenses(EXPENSE). TC contains name of employees and their billing rates. PROJECT contains Name of Project. HOURS field are TCId, PROJECTId, Dateworked, and Hours. EXPENSE contains fields TCId, PROJECTId, Dateexpense, Expense. I want to build a query that over a Date Range that sums billable amount=hours worked* billing rate+ expense. I set the Dateworked >=[forms]![Report Date Range]![Be...

Error when to edit a forwarded mail.
Hello you all=) Outlook 2000 She has logged in to her mail klient, and she has rights to another mailbox, ex webmaster@mydomain When mail comes in to that box she wants to forward them, she clicks the FW button and then she wants to edit the email, when she does that she cannot edit the mail, she can fw the mail and add text to it but cant edit the previus mail. When she tries to edit it, a text comes up "webmaster, int" ???? is this all about rights to the other mailbox?? "webmaster, int" is the account name. And what is your question? --� Milly Staples [MVP - Outlo...

Table properties
Is there a way to determine what the cell height is in Pub 2002? I know I can change it by dragging but I'm rather anal - I want to make all of them the same. -- The problem with resting on your laurels is that eventually you are sitting on dead branches. JoAnn What you do is select the whole table and say enter font size 16. Now when you go to make the Table smaller, the cells will only go to that point size. Consequently they will now all be the same height. You can now select the whole table again and change it to the point size of the font you want to use. Don't forget ...

Grouping Data Fields
Can the following be accomplished in Access 2K3? Name City ABC123 Tampa ABC123 Orlando ABC123 Miami I want to group on name and get the following result in City field or add another field to store the combined city names. ABC123 Tampa, Orlando, Miami On Mon, 15 Feb 2010 21:34:01 -0800, NEWER USER <NEWERUSER@discussions.microsoft.com> wrote: >Can the following be accomplished in Access 2K3? > >Name City >ABC123 Tampa >ABC123 Orlando >ABC123 Miami > >I want to gro...

Displaying property menu at runtime
Hello, Is there a way to display at runtime the property menu of a control so that the user may interact with the control? In my case, I'm speaking about the MsChart control which has a property menu at the design phase (when picking "properties" after right clicking on the control) Thanks Avi "avi" <aviben@bezeqint.net.il> wrote in message news:e2fc8178-471a-48b1-9671-fc81ca23c912@l14g2000yql.googlegroups.com... > Is there a way to display at runtime the property menu of a control so > that the user may interact with the control? > ...

Default height for Edit Control in Dialog Editor
When using the Dialog Editor, the default size for the Edit Control is 40x14. The font size for the dialog is MS Shell Dlg(8) At run time, the edit control height is too big Is there any way I can set the default Edit Control height to 12 I know that I can 'resize' the Edit Control when I'm generating the dialog or I can manually edit the .rc file to change all the EDITTEXT height values, but there must be a way to change the default 40x14 to 40x12 Thanks... ...

Making fields uneditable
I want to add a table to my database which has 3 fields, Date, Time, Action Log (I'll use field names that don't conflict with Access reserved names) I will then create a datasheet form with these fields as the source for 3 controls. I want the Date and Time to be system generated as the user starts to complete the form. The Action log will be a memo filed. I can get this far but I want the fields to be un-editable once they have been input. I am trying to create an Action Log table for a user to complete as they perform an action, possibly on a daily but infrequent basis, which...

edit number in cell without it changing to text
I recently upgraded from Office 97 to Office 2000. In a worksheet I was previously able to hit F2 to edit a number, hit the + or - to add or subtract from the original number. The revised total would show when I hit enter. Now the number changes to text and shows as 1+1 instead of 2. There needs to be an equal sign preceeding the 1+1. After hitting F2, hit the home key to put the curson on the left of the existing number value in the cell then enter "=1+" so you end up with "=1+1" (e.g.). - Will "rklremote" wrote: > I recently upgraded from Office 9...

add information fields for 1099 processing
Would like to see an option added to 1009-MISC accounts to indicate and print to the appropriate reporting box. For example: Box 1 = Rents, Box 2 = Royalties, Box 7 = Nonemployee compensation. Currently, if you have more than 1 type of reporting, you have to run the 1099 print function multiple times. Thanks, ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion ...

Compare adjacent fields in adjacent rows
I need to flag duplicate names in a spread sheet sorted by Surname, Given Name (separate columns). In other words... IF (the surname and the given name in row(n) match the surname and given name in the row above(n-1) or below(n+1), display "Dupe", else display " " ) Thank you for your help. Joan Assuming the 2 source cols are cols B and C, data in row 2 down Put this in D2: =IF(COUNTA(B2:C2)=0,"",IF(SUMPRODUCT((B$2:B2=B2)*(C$2:C2=C2))>1,"dupe","")) Copy down to the last row of source data -- Max Singapore http://savefile.com/proj...

ID field not showing
Hi, I am using Project 2007 and my ID field is not showing in the Gantt Chart. I am trying to see the recurring task symbol next to the task but can't seem to get the ID column to come into view. Any ideas? Thanks Sorry I meant Indicator column, not ID column. "Caz" wrote: > Hi, > > I am using Project 2007 and my ID field is not showing in the Gantt Chart. > I am trying to see the recurring task symbol next to the task but can't seem > to get the ID column to come into view. > > Any ideas? > > Thanks This is a m...

Custom Fields in Views.. 04-22-10
Good Afternoon, We are working with a MOPS 2007 and WSS 3.0 SP2 (no c.u.'s) environment, and have created several enterprise custom fields at the task level. We can use and see them just fine in the schedules in Project Professional 2007, but when we try to add them to the 'my assignments' and 'assignment details' views, the custom data does not show up....any thoughts? Thanks! and have a great spring! Submitted via EggHeadCafe - Software Developer Portal of Choice Get Silverlight 4 Installed: Tips and Tricks http://www.eggheadcafe.com/tutorials/aspnet/05910e...

Populating a field using a pull-down/combo box menu
Hello all, I'm working on MS Excel. I am trying to find the source code for something that will allow me to do the following novel procedure with a pull-down menu and a text box: There is a pull-down menu, and another text box right besides the pull-down menu. The pull-down menu has the names of all the states in the USA in it. When one state is selected, the text box is automatically populated with the capital of that state. In MS Excel, I've created a novel way to handle this issue using Boolean logic. Unfortunately, I can only have 7 states in my pull-down menu, and the sour...

match a subform field value to a field in a 2nd subform
I have a main form named user_Match. It has three subform containers: sub_BUSays with source object form named sub_match_BUSays sub_RptSays with source object form named sub_match_ReportSays sub_BTSays with source object form named sub_match_BTSays sub_match_BUSays has a field called BU_BT_Portfolio_ID. sub_match_ReportSays has a field called MRE_PortfolioID. sub_match_BTSays has a field called BT_Portfolio_ID. The portfolio id is a unique 10 digit number stored as a string. I want to use the parent form to identify incorrect portfolio id's in the BUSays and ReportSays subforms. I wou...

Spurious data being inserted in field
Hello Periodically, some of the records in one table have one field updated to the following value: <!--<1586567094>--> It is the most bizarre thing I have ever seen. We have checked all our servers and stored procedures for any occurrence of this value in scripts or ASP pages but none exist. We're fearing SQL injection or similar but in our application this field is only updated from one place and it's tight against hacking. If it was a hack we would think the value might be something else, so we're presuming some sort of corruption or sim...

Commas and other separator characters in Custom Text Fields
I am working on a proposal. This means an individual can be responsible for several paragraphs in the statement of work (SOW). I pasted SOW paragraph numbers separated by commas into a text field. No problem. Here is the text I want to paste: 3.2.7, 3.2.7.1, 3.2.7.1.1, 3.2.7.1.2, 3.2.7.2, 3.2.7.2.1, 3.7.2.2.2 However, when I made the text field a Custom Field, Project 2007 stripped off everything after the first comma. Is there any way to make this work in a custom field? Thanks in advance. The text from your post pasted perfectly to Project 2007 for me in the Tex...

Printing of Drafts / Editing of Messages
a) I found that Outlook Express does not let me print a draft before I send it. Does anyone has an answer to that problem? b) When a message is received, it is sometimes necessary to delete older messages at the bottom of the page before printing. However, Outlook Express does not let me "edit" the received message. How can this be removed? Thank you. ...

Need to automate print reports-- for diff values in the query field
I want to email each of my sales reps a snapshot of a Access report that lists their sales invoices for the month (only their sales invoices) Presently I do this by running a macro that runs a query, report & emails a snapshot. I physically enter the value for a field [REP] as a variable for the query. It works fine, but we now have 20 reps so I have to run this macro and type in each of teh 20 rep codes, and I trasnpose. I need to create to automate this so that Access can change the query based on thte [REP] field in a table. I have table #1 that has one record for each rep ...

Formula for date field
1.I have simple dates in one column (say column A) . 2.In the next column(Column B) I would like the date five months after Column A to be displayed.Eg if Column A has an entry of 9th June 2007,Column B should display 8th November,2007. 3.A simple formula does not do the job as this does not take into account the different number of days in different months! regards S.Sanatani Your post is a bit ambiguous since you don't really say how the different number of days in months should be handled. One way: A1: <date> B1: =DATE(YEAR(A1),MONTH(A1)+5,DAY(A1)-1) In articl...

Editing saved email addresses
When I go to send a new message, the email address comes up automatically if I have emailed to them before...however some people have changed their emails and now the wrong one comes up...where is this information stored so that I can go in and edit/delete the old emails? These are not ones that are in my address book... Are you talking about autocomplete or the GAL? The GAL should correct itself, sometimes it's just slow to refresh. If you're talking about autocomplete then the easy route is just to start typing the name, when the autocomplete suggestions start popping ...

CListCtrl edit labels problem
Hi there, I have a list (CListCtrl derivate) which uses the LVS_OWNERDATA (for speed), LVS_REPORT and LVS_EDITLABELS styles. Everything works OK except for the edit labels. At the end of editing (in LVN_ENDLABELEDIT notification message) all the time the item.pszText member is NULL as I canceled the edit. I can start the edit session (I don't call anything special, I let the system start it) but when I press ENTER the notification message tells me the edit "was canceled". I cannot get the text entered in the edit label. It's possible that LVS_EDITLABELS doesn't wo...

How to add custom toolbar(with edit box and Spin controlls) in my application
hi frnds i have to add a toolbar in my application and toolbar should have two edit box with spin controls and 4 buttons and i have to add it in my existing application. so plz help me, how to do it plz reply with code n suggestion ur frnd Premanshu sInha See here: http://www.codeguru.com/cpp/controls/toolbar/placingcontrolsintoolbars/article.php/c2547/ --- Ajay ...

Report Writer: Have "Description" field.
Hi, Here's a thought: In Report Writer, it would be nice if the "Calculated Field Definition" window had an additional field for "Description". There the Great Plains developers could key in the "long" description of the current short field called "Name". Ex: "F/O Markdown Amount" = "Functional/Originating Markdown Amount". That would be a help to understanding the calculated field's purpose. Regards, Bret ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most...

Updating text field to new numeric field & moving minus sign to fr
Hi, I need some help with the below IF statement for update query. I got it to move the negative sign to the front of the number, but now it is removing all numbers after my decimal point. I've checked to make sure my formatting for [MyNumericField] is double and 2 decimal points. For example: [MyTextField] is 23.32- I run update query and.... [MyNumericField] is -23 Here is what I have for the update query: UPDATE [MyTable] SET [MyTable].[MyNumericField] = IIf(Right([MyTextField],1)="-",-CLng(Left([MyTextField],Len([MyTextField])-1)),CLng([MyTe...

Hyperlink address property
Hi, Can we use Hyperlink address property on Label Form to run the table (e.g: Table1) in my current database?. If anybody can help me, I am very appriciated. KT -- Message posted via http://www.accessmonster.com Are you asking if you can place a hyperlink on a form that will open a table in your db. The answer to that is yes. When you place the hyperlink on the form you will have a chance to designate objects in the current db. KimTong wrote: >Hi, > >Can we use Hyperlink address property on Label Form to run the table (e.g: >Table1) in my current database?. If anybody ca...