Answered by:
create a folder for the output file

Question
-
Hi! how to create a new folder for output file ? this works very well:
MyPath = "C:\Documents and Settings\" & Environ("USERNAME") & "\Desktop\"
this is what I would like to work:
MyPath = "C:\Documents and Settings\" & Environ("USERNAME") & "\Desktop\" & Me.TTnr & "\"
MyFilename = Forms![tellimuste sisestus]!TellimuseJrknr & ".pdf"thank you !
Thursday, September 1, 2011 12:41 PM
Answers
-
you can use MD statement, but another problem is that you can't make any folder anywhere you want. You have to use the User 'My Documents' folder.
You can get the path of this by an API, ShGetFolderPath, http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx with the constant CSIDL_PERSONAL (for SO before Vista) or else shGetKnonFolderPath http://msdn.microsoft.com/en-us/library/bb762188(v=VS.85).aspx
please, mark this as answer if it is THE answer
----------------
Diego Cattaruzza
Microsoft MVP - Visual Basic: Development
blog: http://community.visual-basic.it/Diego
web site: http://www.visual-basic.itThursday, September 1, 2011 1:14 PM -
Hi there,
I think you are searching for something like that:
http://gallery.technet.microsoft.com/scriptcenter/96535a4e-ae71-4f29-8422-bd2dccfd2f33
Feel free and test it, after that fell free and rate it with 5 stars ;-)
Please 'Mark as Answer' if I helped. This helps others who have the same problem!Thursday, September 1, 2011 1:27 PM
All replies
-
you can use MD statement, but another problem is that you can't make any folder anywhere you want. You have to use the User 'My Documents' folder.
You can get the path of this by an API, ShGetFolderPath, http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx with the constant CSIDL_PERSONAL (for SO before Vista) or else shGetKnonFolderPath http://msdn.microsoft.com/en-us/library/bb762188(v=VS.85).aspx
please, mark this as answer if it is THE answer
----------------
Diego Cattaruzza
Microsoft MVP - Visual Basic: Development
blog: http://community.visual-basic.it/Diego
web site: http://www.visual-basic.itThursday, September 1, 2011 1:14 PM -
Hi there,
I think you are searching for something like that:
http://gallery.technet.microsoft.com/scriptcenter/96535a4e-ae71-4f29-8422-bd2dccfd2f33
Feel free and test it, after that fell free and rate it with 5 stars ;-)
Please 'Mark as Answer' if I helped. This helps others who have the same problem!Thursday, September 1, 2011 1:27 PM