Help, please, with doc.open for TextStream "docs"

E

Ed from AZ

I originally wrote this code for Excel/Word 2000. I am now using
2003.

The main code takes a large file and splits it up into separate files
with a ".doc" file extension using TextStream. I realize this does
not make them Word "documents". But I do want to open them in Word.

With our current set-up - and I don't know if it's that we're now in
2003 or some other setting, when my code tries to open one of these
docs, I get the conversion warning. I think this would be very
disconcerting for some of my users. Is there a way to tell Word to
just open the file as a standard Word doc?

The code I am using to open these files is in an Excel workbook and
looks like:

doc = FPath & "\" & fName & ".doc"

On Error Resume Next
Set WD = GetObject(, "Word.Application")
If Err.Number <> 0 Then
Set WD = CreateObject("Word.Application")
End If
Err.Clear
On Error GoTo 0

DoEvents

WD.Documents.Open doc
WD.Visible = True
WD.ActiveDocument.ActiveWindow.WindowState =
wdWindowStateMaximize


Any help is greatly appreciated.

Ed
 
F

fumei via OfficeKB.com

Stop naming them with .doc extensions! Name them with .txt extensions.

If they had .txt, you would not get the conversion message.

"Is there a way to tell Word to just open the file as a standard Word doc?"

But it IS NOT a standard Word doc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top