Re: Strange 'Replace' problems

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



According to the code snippet you posted,
the processed string was never put into
the RTB. You have: mSelText = .txtEdit.SelText
Then you ran Replace on that string. But you
never used: .txtEdit.SelText = mSelText


> Ok here it is - I've got this code, converting tabs to spaces :
> mSelText = ActiveForm.txtEdit.SelText '<---richtextbox/mSelText
> is a global string variable
> mSelText = Replace(mSelText, vbTab, " ")
>
> I've used 'Replace' for years....but now, for some reason, I'm getting a
> Compile Error:
> "Wrong Number of Arguments or invalid property assignment"
>
> So - I moved the code to the TxtEdit form (this is a MDI app, if you
haven't
> figured it out)
> removed all the ActiveForm stuff - it goes through the code - but nothing
> happens - I can see it highlight the text, but no replacement happens
> Code:
> (Do with statment[With frmMain.ActiveForm] - define start and end points)
> .txtEdit.SelStart = SelStart
> .txtEdit.selLength = SelEnd - SelStart
> mSelText = .txtEdit.SelText
> mSelText = Replace(mSelText, Chr(9), "")
> .txtEdit.SelStart = SelStart
> .txtEdit.selLength = 0
> .txtEdit.SetFocus
> End With
>
> I've tried it with and without the With frmMain (pure txtedit.seltext) - -
> same problem
>
> Any ideas?
>
>


.



Relevant Pages

  • Re: RTF2 Report (across multiple pages)
    ... Lets' go back to the start on your SelStart issue. ... Dim sdd As String ... Dim QWE As Integer ...
    (comp.databases.ms-access)
  • Re: Adding string to Memo
    ... if SelStart gives me the position, ... add the 'string' at the position? ... Brian ... Prev by Date: ...
    (alt.comp.lang.borland-delphi)
  • Re: Adding string to Memo
    ... > if SelStart gives me the position, ... > add the 'string' at the position? ... Prev by Date: ...
    (alt.comp.lang.borland-delphi)