-
May 27th, 2013, 10:46 PM
#1
How to open current word document? Please help me...
In the database saving a lots of files which are differentiate by ID. Same ID could have more than one but different date. Im trying to create the code to retrieve the word document with latest current date:
If FileExist(strFileName) Then
objword.Documents.Open strFileName
Call WordSetting("Protect")
ElseIf FileExist(strNewFileName) Then
Set objTempWord = New Word.Application
objTempWord.Visible = False
'strNewFileName = Format(Date, "MM/DD/YYYY")
'FileExist(strNewFileName)
objTempWord.Documents.Open strNewFileName, "", "", "", "", "", "", "", "", Format(strNewFileNa me, "DD/MMM/YYYY hh:nn:ss", "", vbUseSystem)
Call WordSetting("Protect")
Function for FileExist:
Public Function FileExist(strFileExist As String) As Boolean
On Error GoTo SystemError
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
FileExist = fs.FileExists(strFileExist)
Set fs = Nothing
On Error GoTo 0
Exit Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|