longie
-
Total Posts
:
6
- Scores: 0
-
Reward points
:
0
- Joined: 11/21/2006
-
Status: offline
|
String Length
Tuesday, November 21, 2006 6:19 AM
( permalink)
Hello All, I am having problems with the following function;
Sub ReplaceKeywordWithValue(goWord, keyName, keyValue)
on error resume next
Err.Clear
With goWord.Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Wrap = wdFindContinue
.Text = "[#" & keyName & "#]"
.Replacement.Text = keyValue
.Execute ,,,,,,,,,,2
End With
End Sub
The keyValue is returing a value that the string length is too large. I have tested this function and it looks like the max is 255 - is it possible to increase this to an unpredefined length. Cheers.
|
|
|
|
TNO
-
Total Posts
:
2094
- Scores: 36
-
Reward points
:
0
- Joined: 12/18/2004
- Location: Earth
-
Status: offline
|
RE: String Length
Tuesday, November 21, 2006 6:56 PM
( permalink)
Try passing it with the ByVal or ByRef keywords. If that doesn't work, try passing it as an array insteaad, then join it inside the procedure with an empty string ("")
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
|
|
longie
-
Total Posts
:
6
- Scores: 0
-
Reward points
:
0
- Joined: 11/21/2006
-
Status: offline
|
RE: String Length
Wednesday, November 22, 2006 12:19 AM
( permalink)
I am not familiar enough with VBS - but the keyValue will be greater than 255 thus using .Replacement.Text
will replace the winword bookmark with an empty string I am in favour of using the clipboard feature as described in another forum. There is an opportunity for the user to copy something when the bookmarks are being replaced. Any more help is appreciated. Regards, John
|
|
|
|