Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
How can I get the valid full name, before I call .Documents.Open() method
Before I call Documents.Open() method, I want to know if the doc's full name
is invalid in any OS(eg, English os, JPN, CN). |
#2
Posted to microsoft.public.word.newusers
|
|||
|
|||
How can I get the valid full name, before I call .Documents.Open() method
houweipeng wrote:
Before I call Documents.Open() method, I want to know if the doc's full name is invalid in any OS(eg, English os, JPN, CN). Don't bother with writing a parser for file names -- that already exists in Windows. Just include an On Error statement that will redirect the macro's execution to an error handler if the name is invalid. Dim MyFileName As String MyFileName = "X:\bad path\possibly invalid filename.doc" On Error GoTo BadFileName Documents.Open(MyFileName) ' rest of the macro... Exit Sub BadFileName: MsgBox MyFileName & " is not valid" -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
open document with full page | Page Layout | |||
Unable to see full file name in Recently open documents on file me | New Users | |||
How open attatchment that says "not a valid single file web page" | Microsoft Word Help | |||
Couldnt open filename.txt because it didnt contain valid databas | Mailmerge | |||
'document or path name is not valid' when trying to open word doc | Microsoft Word Help |