tags:

views:

210

answers:

1

hI I need to transfer text from richTextbox to word document and also in plain text on button_click. I need assistance on this please.

I got a vb code but need in csharp.

Dim wrdApp As Word.Application

Private Sub Form_Load()
    Set wrdApp = New Word.Application
End Sub

Private Sub Command2_Click()
    Clipboard.SetText RichTextBox1.TextRTF, vbCFRTF
    With wrdApp
        .Documents.Add
        .Selection.Paste
        .ActiveDocument.SaveAs App.Path & "RTFDOC2.doc", _
                wdFormatDocument
        .Visible = True
        .Activate
    End With
End Sub
A: 

You can call this VBA code using the activeX-IF of msword.

LuI