View Single Post
 
Old 01-10-2017, 11:11 AM
dwirony dwirony is offline Windows 7 64bit Office 2003
Advanced Beginner
 
Join Date: Oct 2016
Posts: 49
dwirony will become famous soon enough
Default

I'm sharing a lot of my code with coworkers and would like to be able to write in an option to update the code automatically as I release more.

I'm thinking that by using Auto_Open the code will read down a specific file path, and if "newcode.dotm" exists, it will bring up a userform that gives the user the option to copy that code to the startup folder. Is this option available via wordvba? I know it's someone hard to access the startup folder while word is being used, so is it possible to have code close word, replace "oldcode.dotm" with "newcode.dotm" in the startup folder, then have it reboot word?

I know this might be a bit of a stretch (I could always have people manually update it), but they're not very tech savvy and this option would make things very easy for everyone. Thanks for any input/ideas as to how I could make this work.

This is how I'm thinking of starting it

Code:
Function FileThere2(FileName As String) As Boolean
    FileThere = (Dir(FileName) > "")
End Function
Sub UpdateCode()
If FileThere("G:\SalesOffice\Public\user1\newcode.dotm") Then
    'FileThere is a private function that searches for the newer version in the G Drive
MsgBox Prompt:="oldcode has detected that there is a better version. Oldcode will now prompt you to download newcode", _
 Buttons:=vbExclamation, _
 Title:="Outdated"
frmDownloadNewCodeShow 'This prompts the user to download new code.
Else 'Do Nothing
End If
End Sub
Reply With Quote