Use the Field in Word 2003.

本文介绍了一种在Word文档中实现头部内容自动更新的方法,无需修改代码即可完成。通过创建样式并利用字段功能,使得当头部内容变化时能够自动更新。此外还介绍了如何去除首页的线条以及一些快捷键和字段的使用。

Today, the customer give me a document, he need the special content shown in header. To avoid change my code, I find a method to fix the problem without code, only used the Work's functional.

The following picture has shown the requirement.


The steps of solve the problem.
Step1: Open the "Style and Formatting", Create two new styles named HeaderStyle1 and HeaderStyle2

 




Setp2: select the two texts you want to add into the header, and apply the or HeaderStyle2 for your selected text.

 

Step3: Double-click the header, select Insert-Field, and select the Links and references item in Categories, then click the StyleRef and select the HeaderStyle1 or HeaderStyle2 the click OK.

 

 

Finished!

 

We will see that when we change the content which you had apply the HeaderStyle1 or HeaderStyle2 style will automatic update.

 

Other: The ref and bookmark can also do the same things, but that can not update automatic. We must update manual.

 

Notice: You can apply the HeaderStyle1 to other contents, but Word will get the first one (up to down) 

Another: When we set the Header and Footer and a line will shown in the Header include the first page, but we need not to shown in the first page. You can do following

1.       Insert the “Page Numbers”; unselect the “show number on the first page” (if been selected)

2.       Select the “First Page Header”, if has a line, you can apply any style to it that without a line except to modify the Header style without line.

 

Some shortcut:

CTR+F9: insert a field (the notation you can’t input by keyboard)

ALT+F9: Update fields.

 

Some Field:[copy no valuated]

{PAGE}

{NUMPAGES}

{= {PAGE}-1}

{= {NUMPAGES}}

{[REF] Bookmark}     // the bookmark name you had insert into your document

{STYLEREF Style1}     //the style you had defined and apply to content

转载于:https://www.cnblogs.com/zwwon/archive/2007/04/28/731344.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值