S
Steff
Next Question on this journey...
I am trying to open a document from a master document list and then save it
using the name that the user inputs. Here is my code
Private Sub CommandButton1_Click()
'Create A Package
Dim WordApp As Word.Application
Dim strPacName As String
Dim Count As Long
Dim NewPac As Long
strPacName = InputBox("Equipment Name", "Package Creation", , , ,
"c:\Windows\Help\Procedure Help.chm", 0)
If strPacName <> "" Then
Set WordApp = CreateObject("Word.Application")
WordApp.Visible = True
WordApp.Documents.Open "C:\Documents and
Settings\slilly\Desktop\Master Form Directory\Word Documents\Example
Package.doc", ReadOnly:=False
WordApp.ActiveDocument.SaveAs FileName:="C:\Documents and
Settings\slilly\Desktop\Blank Project\Word Files\" & strPacName & ".doc"
End If
Set WordApp = Nothing
End Sub
It opens the document but then it puts up an option box telling me that the
document is already in use and "do I want to open it in read only?"... Why oh
why does this program hate me so? If I select "read only", it saves it like
it is supposed to and it lets me edit it so it is a regular file... not read
only... any ideas on why it does this?
I am trying to open a document from a master document list and then save it
using the name that the user inputs. Here is my code
Private Sub CommandButton1_Click()
'Create A Package
Dim WordApp As Word.Application
Dim strPacName As String
Dim Count As Long
Dim NewPac As Long
strPacName = InputBox("Equipment Name", "Package Creation", , , ,
"c:\Windows\Help\Procedure Help.chm", 0)
If strPacName <> "" Then
Set WordApp = CreateObject("Word.Application")
WordApp.Visible = True
WordApp.Documents.Open "C:\Documents and
Settings\slilly\Desktop\Master Form Directory\Word Documents\Example
Package.doc", ReadOnly:=False
WordApp.ActiveDocument.SaveAs FileName:="C:\Documents and
Settings\slilly\Desktop\Blank Project\Word Files\" & strPacName & ".doc"
End If
Set WordApp = Nothing
End Sub
It opens the document but then it puts up an option box telling me that the
document is already in use and "do I want to open it in read only?"... Why oh
why does this program hate me so? If I select "read only", it saves it like
it is supposed to and it lets me edit it so it is a regular file... not read
only... any ideas on why it does this?