Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox.Value as a new text file
I need to prompt the Save as dialog box, filter by *doc (and *.txt
if possible) have the Textbox.Value as the body of the txt/doc file which will be named by the user to his/her convenience. Thanks in advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox.Value as a new text file
Luis,
Try something like this: Private Sub CommandButton1_Click() 'must have a reference to the word object library Dim wdApp As Word.Application Dim wdDoc As Word.Document Set wdApp = CreateObject("Word.application") Set wdDoc = wdApp.Documents.Add 'wdApp.Visible = True wdDoc.Sentences(1) = Me.TextBox1.Text wdApp.ActiveDocument.Save wdDoc.Close Set wdDoc = Nothing wdApp.Quit Set wdApp = Nothing End Sub -- Dan |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox.Value as a new text file
Thanks a lot
|
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox.Value as a new text file
Dan, How can I force the file to be saved as .txt only? Thanks "Dan R." wrote: Luis, Try something like this: Private Sub CommandButton1_Click() 'must have a reference to the word object library Dim wdApp As Word.Application Dim wdDoc As Word.Document Set wdApp = CreateObject("Word.application") Set wdDoc = wdApp.Documents.Add 'wdApp.Visible = True wdDoc.Sentences(1) = Me.TextBox1.Text wdApp.ActiveDocument.Save wdDoc.Close Set wdDoc = Nothing wdApp.Quit Set wdApp = Nothing End Sub -- Dan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using a TextBox value in a file String | Excel Programming | |||
textbox to file (.txt or .doc) | Excel Programming | |||
Highlight all Text in a Textbox when the textbox is selected | Excel Programming | |||
Textbox & Save file problem | Excel Programming | |||
check variable(text) with cell (text), textbox | Excel Programming |