Re: Strange 'Replace' problems
- From: "mayayana" <mayayanaXX1a@xxxxxxxxxxxxxxxx>
- Date: Sat, 28 Jan 2006 14:44:12 GMT
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?
>
>
.
- References:
- Strange 'Replace' problems
- From: Elmo Watson
- Strange 'Replace' problems
- Prev by Date: Re: Writing to registry
- Next by Date: Re: create a registry key
- Previous by thread: Re: Strange 'Replace' problems
- Next by thread: Re: Strange 'Replace' problems
- Index(es):
Relevant Pages
|