Thread: [Solved] VBA FileCopy Source: problem
View Single Post
 
Old 09-23-2014, 12:42 PM
landonminden landonminden is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Sep 2014
Posts: 2
landonminden is on a distinguished road
Default VBA FileCopy Source: problem

I am trying to copy a template (Normal.dotm) from a server to desktop template folder using VBA.

The file I want to copy has xml (custom tabs) however when I run the code it copies the file but it doesnt bring the xml with the file.

If I physically copy the file it works fine and the tabs are there when I open it.


Here is the code I have copying the file to my roaming folder:
Sub copyfile()
'

MsgBox VBA.Environ("username")

Dim UserName As String
UserName = VBA.Environ("username")
Options.DefaultFilePath(Path:=wdUserTemplatesPath) = "C:\users\" & UserName & "\appdata\roaming\Microsoft\Templates"



FileCopy Source:="\\ggnnd\GROUP\PLNG\Normal.dotm", Destination:="C:\users\" & UserName & "\appdata\roaming\Microsoft\Templates\Normal.d otm"
End Sub

Do I need a macro to copy the xml somehow I couldnt find anything on the internet.


Any Help would be much appreciated.
Reply With Quote