Article ID: 105534
Article Last Modified on 1/18/2007
Documents.Open FileName:="""table calculation.doc""", _ ConfirmConversions:= False, ReadOnly:=False, AddToRecentFiles:=False, _ PasswordDocument:="", PasswordTemplate:="", Revert:=False, _ WritePasswordDocument:="", WritePasswordTemplate:="", _ Format:=wdOpenFormatAuto
expression.Open(FileName, ConfirmConversions, ReadOnly, AddToRecentFiles, PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument, WritePasswordTemplate, Format)To use this instruction in a Visual Basic 3.0 procedure, you would write:
WordObj.Documents.Open "C:\Test.doc", False, False, False,,, False,,, 0
FileOpen .Name = "D:\Winword\Mydoc.doc", .ReadOnly = 1, AddtoMru = 1To use this instruction in a Visual Basic procedure, you would write:
WordObj.FileOpen "D:\Winword\Mydoc.doc", , 1, 1WordObj is an object variable that refers to WordBasic (the complete Visual Basic procedure is included below). The extra comma after the file name is a placeholder for the ConfirmConversions parameter.
FileOpen .Name = text [, .ConfirmConversions = number]
[, .ReadOnly = number] [, .AddToMru = number] [, .PasswordDoc = text]
[, .PasswordDot = text] [, .Revert = number]
[, .WritePasswordDoc = text] [, .WritePasswordDot = text]
The following Visual Basic procedure opens a Word Document as read-only
with the file name appearing on the MRU (Most Recently Used) list on the File
menu.
Sub Command1_Click ()
Dim WordObj As Object
Set WordObj = CreateObject("Word.Basic")
WordObj.FileOpen "D:\WINWORD\MYDOC.DOC", , 1, 1
End Sub
119591 How to Obtain Microsoft Support Files from Online Services
Additional query words: ole automation word basic object container position
Keywords: kbdownload kbinterop KB105534