String Length

Author Message
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)
0
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.

 
#1
    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)
    0
    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
     
    #2
      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)
      0
      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
       
      #3

        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9