Hi,
How can i export the contents of a MSflexgrid to a richtextbox?
Please advise.
Many Thanks
Printable View
Hi,
How can i export the contents of a MSflexgrid to a richtextbox?
Please advise.
Many Thanks
Would this work for you?
Code:Private Sub Command12_Click()
With MSHFlexGrid1
.Col = 0
.Row = 0
.ColSel = .Cols - 1
.RowSel = .Rows - 1
Clipboard.Clear
Clipboard.SetText .Clip, vbCFRTF
.ColSel = 0
.RowSel = 0
End With
RichTextBox1.TextRTF = Clipboard.GetText(vbCFRTF)
End Sub
Hi Mate,
Thanks for reply,
unfortunately that did not work. The richtextbox remained blank :(
I think that the Clip property is only available for the MSHFlexGrid.
:confused: just had a look for the MSHflexgrid control within Project - Components and cannot find it. I have VB6 which is fully updated.
The name to look for is Microsoft Hierarchial FlexGrid Control 6.0 (SP4) the ocx name is MSHFLXGD.OCX
found it, thanks.
However, i am using a DOA data control which is not valid for a MSHflexgrid.
so i'm still looking for a solution to my original question ;)
thanks
I'm guessing you meant DAO data control.
I think if you moved to the new technology of ADO, you would have better results.
Hi Hack,
yes i mean DAO. The program was written several years ago, when DAO was all the rage. If i was to do the program again now, i would definately use ADO. I am not a programmer by trade and the program was something i wrote to make my life a bit easier in my Job. I havent got the time to redo it. Anyway, it works perfectly fine as is.
Any help with my current problem will be most appreciated.:thumb:
No, it is avalable for either flexgrid - incidentally at the time of posting I was doing something with the hierarchical grid so it came handy.Quote:
Originally Posted by Joacim Andersson
How about adding the contents of the MSFlexgrid to a text file and then adding that to the RichTextBox :bigyello:
Yeah you're right (however MSDN Library states differently). I also just tried the code you posted and it works just fine for me.Quote:
Originally Posted by RhinoBull
I'll have another look at my code and try and find the reason the data is not exporting.
I have 5 columns on my MSflexgrid.
Hi,
all is working now. Thanks for all your help :afrog: