![]() |
#1
|
|||
|
|||
![]()
Hi!
I have this code that works from Excel but from Word I get an error 13/type mismatch. Can anyone help me make this work from Word, please? Code:
Sub CreateNewFolder() Dim _ fso As FileSystemObject, _ fol As Folder, _ fol_add As Folder, _ fil As File Const strFolPath As String = "\\Fileserver\commonh\GROUP\SDF_data_export" Set fso = CreateObject("Scripting.FileSystemObject") Set fol = fso.GetFolder(strFolPath) On Error GoTo Finish If Not fso.FolderExists(strFolPath & "\" & ThisDocument.Textbox59.Value) Then Set fol_add = fso.CreateFolder(fol.Path & "\" & ThisDocument.Textbox59.Value) End If End If Set fso = Nothing Set fol = Nothing End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
rvessio | Word VBA | 4 | 07-25-2016 12:37 PM |
![]() |
webharvest | Word VBA | 1 | 06-29-2011 04:56 PM |
Create Custom menu using a macro | twnty2 | PowerPoint | 0 | 06-29-2011 04:26 PM |
How to create macro to paste text after style? | Srivas | Word | 0 | 03-16-2010 05:28 AM |
Cannot create a public folder? | gfkbob | Outlook | 0 | 01-07-2010 07:18 AM |