Click here to Skip to main content
15,891,204 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: steppermotor Pin
Luc Pattyn16-Sep-10 7:10
sitebuilderLuc Pattyn16-Sep-10 7:10 
GeneralRe: steppermotor Pin
Smithers-Jones17-Sep-10 4:35
Smithers-Jones17-Sep-10 4:35 
AnswerRe: steppermotor Pin
Luc Pattyn17-Sep-10 17:32
sitebuilderLuc Pattyn17-Sep-10 17:32 
Questionsteppermotor Pin
nisharkinoo16-Sep-10 6:59
nisharkinoo16-Sep-10 6:59 
QuestionInserting a default item at the start of a combobox Pin
Jay Royall16-Sep-10 5:14
Jay Royall16-Sep-10 5:14 
AnswerRe: Inserting a default item at the start of a combobox Pin
Ian Shlasko16-Sep-10 5:42
Ian Shlasko16-Sep-10 5:42 
GeneralRe: Inserting a default item at the start of a combobox Pin
Jay Royall16-Sep-10 12:09
Jay Royall16-Sep-10 12:09 
QuestionRead .rtf file and save as .txt Pin
Anoop Brijmohun16-Sep-10 5:11
Anoop Brijmohun16-Sep-10 5:11 
Hi guys,

i have a vb.net application that watched a folder and whenever a rtf file is dropped i want to read the text an save it to a txt file.

here's my code
 Dim word_app As New Microsoft.Office.Interop.Word.Application
 Dim word_doc As New Microsoft.Office.Interop.Word.Document

 word_doc= word_app.Documents.Open(in_file, False, True, False, , , , , ,Microsoft.Office.Interop.Word.WdOpenFormat.wdOpenFormatRTF)
word_doc.ActiveWindow.Selection.WholeStory()
word_doc.ActiveWindow.Selection.Copy()
str = My.Computer.Clipboard.GetData(GetType(String).ToString)
'word_doc.SaveAs(out_file, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatText)

doc.Close(False)
word_server.Quit()

Dim sr As New IO.StreamWriter(out_file, False)
sr.Write(str)
sr.Close()


this is running on the a windows 2008 rc2 server as a window service.

the error messaage is "Object reference not set to an instance of an object"

if there is another simpler way please advise.

thank you kindly

Anoop Confused | :confused:
AnswerRe: Read .rtf file and save as .txt Pin
Jay Royall16-Sep-10 5:26
Jay Royall16-Sep-10 5:26 
GeneralRe: Read .rtf file and save as .txt Pin
Anoop Brijmohun16-Sep-10 8:59
Anoop Brijmohun16-Sep-10 8:59 
AnswerRe: Read .rtf file and save as .txt Pin
Luc Pattyn16-Sep-10 6:22
sitebuilderLuc Pattyn16-Sep-10 6:22 
AnswerRe: Read .rtf file and save as .txt Pin
Prerak Patel20-Sep-10 20:32
professionalPrerak Patel20-Sep-10 20:32 
AnswerRe: Read .rtf file and save as .txt Pin
Anoop Brijmohun20-Sep-10 21:14
Anoop Brijmohun20-Sep-10 21:14 
QuestionSome getting started questions Pin
RodClark16-Sep-10 0:35
RodClark16-Sep-10 0:35 
AnswerRe: Some getting started questions Pin
Dave Kreskowiak16-Sep-10 5:55
mveDave Kreskowiak16-Sep-10 5:55 
AnswerRe: Some getting started questions Pin
Eddy Vluggen16-Sep-10 10:47
professionalEddy Vluggen16-Sep-10 10:47 
GeneralRe: Some getting started questions Pin
RodClark16-Sep-10 12:33
RodClark16-Sep-10 12:33 
GeneralRe: Some getting started questions Pin
Eddy Vluggen17-Sep-10 6:48
professionalEddy Vluggen17-Sep-10 6:48 
GeneralRe: Some getting started questions Pin
RodClark18-Sep-10 21:12
RodClark18-Sep-10 21:12 
QuestionHow to finish the pendign input remaining last time? Pin
sanyexian15-Sep-10 16:29
sanyexian15-Sep-10 16:29 
AnswerRe: How to finish the pendign input remaining last time? Pin
Luc Pattyn15-Sep-10 16:54
sitebuilderLuc Pattyn15-Sep-10 16:54 
GeneralRe: How to finish the pendign input remaining last time? Pin
sanyexian15-Sep-10 17:35
sanyexian15-Sep-10 17:35 
GeneralRe: How to finish the pendign input remaining last time? Pin
Luc Pattyn15-Sep-10 18:01
sitebuilderLuc Pattyn15-Sep-10 18:01 
Questioninsert multiple rows between two rows in datagridview Pin
C#Coudou15-Sep-10 16:22
C#Coudou15-Sep-10 16:22 
AnswerRe: insert multiple rows between two rows in datagridview Pin
Luc Pattyn15-Sep-10 16:50
sitebuilderLuc Pattyn15-Sep-10 16:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.