+ Reply to Thread
Results 1 to 5 of 5

How to put more than 255 characters in a string ???

  1. #1
    Registered User
    Join Date
    10-29-2007
    Posts
    12

    How to put more than 255 characters in a string ???

    Hi Guys,

    I have one variable which will hold thousands of characters. When I declare it as a string most of the data in the variable is chopped off. How can I put more than 255 characters in a string (or can I use another datatype ?) ?

    Really going bananas on this one

    Bananas

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    There has to me more to your question than that. A VBA variable-length string can contain 2^31 characters, and fixed-length strings up to 64K.

  3. #3
    Registered User
    Join Date
    10-29-2007
    Posts
    12
    ActiveWorkbook.FollowHyperlink Address:=strEmailHyperlink, NewWindow:=True

    Let's say a lot of text is added to strEmailHyperlink. strEmailHyperlink consists of a mailto variable, a cc address, a subject and the body. I declared the body as a string. When the body has more than 255 characters the mail is not generated in my mail client. When the body has less than 255 characters the mail is generated without a problem. That's why I think that the declaration is the problem.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Maybe your mail client. It's not a VBA string problem.

    After setting the string, check the length.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Bananas,

    The MailTo scheme launches your default mailer. In most Office systems this will be Outlook Express. OE has a max of 255 characters. You will need to use Outlook to get around this limit, or break up your string, and then call the FollowHyperlink for each string segment.

    Sincerely,
    Leith Ross

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1