【发布时间】:2018-08-23 15:41:41
【问题描述】:
我尝试将Word中表格中的文本复制到文本中,但是文本被覆盖后,出现在文本“黑”点中。拜托,你能告诉我我哪里错了吗?
Dim rngStory As Range
Name_1 = ActiveDocument.Tables(1).Cell(1, 2)
For Each rngStory In ActiveDocument.StoryRanges
With rngStory.Find
.Text = "<<name>>"
.Replacement.Text = Name_1
.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll
End With
Next rngStory
【问题讨论】:
-
这是因为表格单元格包含两个负责内部单元格结构的字符,在幕后:Chr(13) 和 Chr(7)。这些需要从文本中“修剪”(
Name_1)。看到这个:stackoverflow.com/a/49533912/3077495