MS Word

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
 
D

Dave Peterson

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.
 
D

David DeRolph

I must be missing the point here. Why would you not simply use Windows
Explorer to do this?
 
R

rjtaylor

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
 
R

rjtaylor

Thanks Dave but when I try this I get wrong number of arguments o
invalid property assigment
 
D

Dave Peterson

What did you use?

If it fails again, take a look at VBA's help (or post back with your code).
 
R

rjtaylor

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
 
D

Dave Peterson

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.
 
R

rjtaylor

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top