MS Word

  • Thread starter Thread starter rjtaylor
  • Start date Start date
R

rjtaylor

Hi I have been looking throug the threads to see if i can find help
found some

this is what i have so far

Dim wdapp As Object
WBPath = ThisWorkbook.Path
WBPathPlus = WBPath & "\Starting Files\Bidding information.doc"
Set wdapp = CreateObject("Word.Application")
With wdapp
.Documents.Open Filename:=WBPathPlus
.Visible = True
End With
Set wdapp = Nothing
End Sub

However I cant close the document or save

All I really want to do is copy the file from one folder to another s
if there is another way or eiser way I would appreciat any help thank

RO
 
Take a look at FileCopy in VBA's help.

(and maybe the Name command, but filecopy will allow you to change the name of
the copied file, too)

FileCopy Source:="c:\my documents\excel\book1.xls", _
Destination:="c:\my documents\excel\test\boooooooook1.xls"

Worked ok for me.
 
I must be missing the point here. Why would you not simply use Windows
Explorer to do this?
 
The reason why is I am setting up a program that will creat all of th
workbooks and docs needed for the new scheduler to creat a newyea
schedule and by putting in four pices of information the person wil
have all of the workbooks and docs in nice neat folders. all set up fo
the year.
However I am not sure why that is important
 
Thanks Dave but when I try this I get wrong number of arguments o
invalid property assigment
 
What did you use?

If it fails again, take a look at VBA's help (or post back with your code).
 
Sub ttt()
Dim wdapp As Object
WBPath = ThisWorkbook.Path
WBPathPlus = WBPath & "\Starting Files\Bidding information.doc"
Set wdapp = CreateObject("Word.Application")
With wdapp
.Documents.Open Filename:=WBPathPlus
.Visible = True
End With
Set wdapp = Nothing
End Sub

I can get it open here this way but I don't know how to save i
somewhere else or how to (save as) for a rename thanks again

RO
 
You don't need to open Word to save it in a different location.

Take a look at filecopy in VBA's help. You'll see that it's easier than you
think.
 
Thanks I think I was doing it wrong but that worked on a simple test I
did. So I will move it into my code once again thanks
Rod
 
Back
Top