Sign in to follow this  
Followers 0
mbiwpeoyc

Syncing outlook macro's

6 posts in this topic

#1 ·  Posted (edited)

I'm trying to get this file to sync up our outlook macro's here in my office except for one person (the guy who makes em). Now for some reason it won't copy for anyone else either, and I don't get it. No errors, no nothing, it just never copies. The files and directories exist on both ends on all the systems and none of them get errors...

Any help is greatly appreciatted

Here's what I have so far.

Assign ("noup", "login")
$path = "c:\documents and settings\%username%\Application Data\Microsoft\Outlook\"
$remote = "p:\_transer\zz\vba\"
$file = "VbaProject.OTM"
$drive = FileExists("p:\")  
$ver = FileGetTime($path & $file, 0, 1)
$rver = FileGetTime($remote & $file, 0, 1)
Do
 $drive = FileExists("p:\");Check for p drive at bootup
    Sleep(1000)
Until $drive = "1"

If @Username = $noup Then   
Exit            
EndIf
If Not FileExists("c:\documents and settings\%username%\Application Data\Microsoft\Outlook\VbaProject.OTM") Then    
    FileCopy ("p:\_transfer\zz\vba\VbaProject.OTM", "c:\documents and settings\%username%\Application Data\Microsoft\Outlook\") 

    Exit
ElseIf FileExists("c:\documents and settings\%username%\Application Data\Microsoft\Outlook\VbaProject.OTM") Then
    FileCopy ("p:\_transfer\zz\vba\VbaProject.OTM", "c:\documents and settings\%username%\Application Data\Microsoft\Outlook\", 1)
    Exit
EndIf

I realize I've got variables defined with the paths, I've tried with and without them with the same results.

Edited by mbiwpeoyc

Share this post


Link to post
Share on other sites



I think you need to replace %username% with @UserName

Share this post


Link to post
Share on other sites

I think you need to replace %username% with @UserName

<{POST_SNAPBACK}>

So...

'c:\Documents and Settings' & @UserName & '\Microsoft\Outlook\'

?

Share this post


Link to post
Share on other sites

Need to add a "\" after ...Documents and Settings

'c:\Documents and Settings\' & @UserName & '\Microsoft\Outlook\'

Share this post


Link to post
Share on other sites

Need to add a "\" after ...Documents and Settings

'c:\Documents and Settings\' & @UserName & '\Microsoft\Outlook\'

<{POST_SNAPBACK}>

Thanks guys, looks like that did it. Had to go from using explicit paths in the FileExists part to using the variables and implementing the above change there, but it worked.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0