Results 1 to 3 of 3

Thread: String size problem.

  1. #1

    Thread Starter
    Addicted Member Alexandru_mbm's Avatar
    Join Date
    Jul 2007
    Location
    VBForums.com
    Posts
    157

    String size problem.

    Hello again 4 you all...

    In my application i have a TextBox named "Me.txt_catre.Text" and a MS Word File (.doc) containig "<<03>>" word that must be replaced with the value from TextBox...

    I use this peice of code...

    Code:
                        With myStoryRange.Find
                            .Text = "<<03>>"
                            .Replacement.Text = Me.txt_catre.Text
                            .Wrap = Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue
                            .Execute(Replace:=Microsoft.Office.Interop.Word.WdReplace.wdReplaceAll)
                        End With
    The problem is... if the "Me.txt_catre.Text" contains more than 255 characters as a string... the application gives me error...

    What solution i have to place more than 255 chars into that MS Word file ?

    Thanks in advice!
    I'm still learning VB.NET
    Sorry for my bad english
    Thanks for your help

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: String size problem.

    its likely a limitation specificly with the find/replace methods of the word object model. I would imagine if you were to do something like, remove the <<03>> and then insert the text you want in its place (versus trying to do a find/replace) then it would probably work fine.

  3. #3

    Thread Starter
    Addicted Member Alexandru_mbm's Avatar
    Join Date
    Jul 2007
    Location
    VBForums.com
    Posts
    157

    Re: String size problem.

    I just can't figure out how can i do this... i've tried in many ways... Word.Interop it drives me NUTSS..
    I'm still learning VB.NET
    Sorry for my bad english
    Thanks for your help

Posting Permissions

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



Click Here to Expand Forum to Full Width