| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 601 人关注过本帖
标题:那位高手能看懂这段程序
只看楼主 加入收藏
dulenilovefe
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2005-11-26
收藏
 问题点数:0 回复次数:8 
那位高手能看懂这段程序
各位仁兄,那位能看懂这段程序,帮小弟一解。

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "pg=1"
.Replacement.Text = "pa=4"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
With Selection.Find
.Text = "pa=1"
.Replacement.Text = "pa=7"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
能不能让这段程序循环起来,每循环一次红色的数字加3一次,

搜索更多相关主题的帖子: False color 
2005-11-28 23:09
syh878
Rank: 1
等 级:新手上路
威 望:2
帖 子:461
专家分:0
注 册:2005-9-2
收藏
得分:0 

用变量试试


2005-11-29 09:52
dulenilovefe
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2005-11-26
收藏
得分:0 

怎么个用法,你能帮我改一下吗?

2005-11-29 13:26
slore
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1108
专家分:0
注 册:2005-7-1
收藏
得分:0 
dim i as integer
for i=0 to 5

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "pg=1"
.Replacement.Text = "pa=" & 3i+1
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With


next

快上课了……
2005-11-29 13:38
dulenilovefe
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2005-11-26
收藏
得分:0 
非常感谢!!!但出了一个小问题!!!
.Replacement.Text = "pa=" & 3i+1
这句语法错误
2005-11-29 14:17
dulenilovefe
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2005-11-26
收藏
得分:0 

这是出错的地方,版主再帮我看一看了

2005-11-29 14:57
dulenilovefe
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2005-11-26
收藏
得分:0 
图片附件: 游客没有浏览图片的权限,请 登录注册

2005-11-29 15:00
dulenilovefe
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2005-11-26
收藏
得分:0 

万岁!!!!slore版主,我已经把程序调好了,谢谢你的帮助

2005-11-29 15:54
dulenilovefe
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2005-11-26
收藏
得分:0 

所有的人万岁!!!!哈哈……

2005-11-29 15:59
快速回复:那位高手能看懂这段程序
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017960 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved