Author Topic: Can I create a folder that is not part of IM5? (In a script)  (Read 2484 times)

ubacher

  • Oldtimer
  • ****
  • Posts: 2297
Can I create a folder that is not part of IM5? (In a script)
« on: November 21, 2013, 06:22:02 PM »
With database.copyFilestoNamedFolder I can copy to folders outside of IM.
But only if the folder exists. How can I create a folder if it does not exist?

(Creating the folders within IM and removing them from IM later?
Could I do this inside a transactions which I then don't commit to do this elegantly?
 Running Windows command via SHELL?) HELP!

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1442
  • I'm too damn old to act my age.
Re: Can I create a folder that is not part of IM5? (In a script)
« Reply #1 on: November 21, 2013, 08:11:31 PM »
Try this.

Code: [Select]
Option Explicit

Sub main
Dim filename As String
Dim path As String
path = "D:\new folder"
filename = Dir(path, vbDirectory)
If filename = "" Then
MkDir path
End If
End Sub

ubacher

  • Oldtimer
  • ****
  • Posts: 2297
Re: Can I create a folder that is not part of IM5? (In a script)
« Reply #2 on: November 21, 2013, 09:17:12 PM »
Works like a charm. Thank you.