fix: allow replacement without an explicit target cell

This commit is contained in:
阿白叔 committed 2026-10-19 16:15:21 +08:00
1 parent 81a8547352
commit d12478efd8
10 files changed
+141 -68

No files matched your search

@@ -2238,8 +2238,9 @@ Function QPTargetCell(ByRef Record)
QPTargetCell = ""
If Not Record.Exists("target_cell") Then Exit Function
Value = QPDecode(CStr(Record("target_cell")))
If Len(Value) = 0 Or Trim(Value) <> Value Then _
Err.Raise vbObjectError + 878, "QuickPartReplace.Cell", "target Cell selection is empty or invalid"
If Len(Value) = 0 Then Exit Function
If Trim(Value) <> Value Then _
Err.Raise vbObjectError + 878, "QuickPartReplace.Cell", "target Cell selection is invalid"
For Index = 1 To Len(Value)
If AscW(Mid(Value, Index, 1)) >= 0 And AscW(Mid(Value, Index, 1)) < 32 Then _
Err.Raise vbObjectError + 878, "QuickPartReplace.Cell", "invalid control character in target Cell"