rodney_malodney
Board Regular
- Joined
- Jul 19, 2005
- Messages
- 116
the word file is open and is saved as a name that come from user input and in the code is named:
fname (with .dot behind it )
or
prname (no .dot)
how do i call the file:
windows. (prname).activate doesnt work so what does???
fname (with .dot behind it )
or
prname (no .dot)
how do i call the file:
windows. (prname).activate doesnt work so what does???
Code:
Private Sub CommandButton1_Click()
'
'yes i can do word as well, this took hours...
'
Dim prname As String
Dim docnew As Document
Dim fname As String
Dim details(0)
setdocnew = Documents.Add
'
prname = InputBox("Please Confirm Project Name/Number, (this MUST match the name given on the project folder")
'
fname = prname & ".doc"
details(0) = fname
With docnew
ActiveDocument.SaveAs FileName:=fname
End With
'
'in theory this should copy all the templates form their seperate folders to the one single folder named prname or fname
'
If CheckBox1 = True Then
Documents.Open FileName:="erectorsinstructions.dot", ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
Windows(prname).Activate
Windows("erectorsinstructions").Activate
Selection.WholeStory
Selection.Copy
Windows(prname).Activate
Selection.Paste
Windows("a code").Activate
End If
End Sub