Word doc saving path

Ashfaque

Search Beautiful Girls from your town for night
Local time
Today, 04:40
Joined
Sep 6, 2004
Messages
897
Hi,

I am saving my word doc thru below vba code

.......
..........
doc.SaveAs ("Customers.doc")
..........
.......

Which is saving here :

C:\Users\ashfaque\Documents

I need to save it to desktop or somewhere I want.

How can I specifically mention the path in my vba code to save this document at the desired place?

Thanks,

Ashfaque
 
....
strPath = c:\users\ashfaque\desktop\

Doc.Saveas(strPath & "customers.doc")

....
 
Hi
Your statement
Code:
doc.SaveAs ("Customers.doc")
is the equivalent of
Code:
doc.SaveAs ("C:\Users\ashfaque\Documents\Customers.doc")
You can make the path explicit by modifying the second instance with the path you want. If you use a string variable 'strPath' where you have the path you want, modify your statement to
Code:
doc.SaveAs (strPath & "Customers.doc")
Don't forget to add a trailing '\' to the path name value, or alternatively put it as a prefix to the file name literal ("\Customers.doc")
 
Thanks Jack N Roku,

Ideas of both you are good.

Thanks a lot....

With kind regards,
Ashfaque
 

Users who are viewing this thread

Back
Top Bottom