View Single Post
 
Old 11-30-2013, 12:52 PM
gmanword gmanword is offline Windows 8 Office 2010 32bit
Novice
 
Join Date: Nov 2013
Posts: 3
gmanword is on a distinguished road
Default Code

Below is the code I used I probably didn't explain it very well in my previous post. Included what I did to get the macro to autorun when the filename contains a specific string.


Code:
Private Sub Document_Open()
Call Filename 
End Sub 
 
Sub Filename() 
Dim Docname As String
Docname = ActiveDocument.Name
 
If Docname Like "*Contract*" Then
  Call contractchange
End If
 
If Docname Like "*contract*" Then
  Call contractchange
End If 
End Sub 
 
Sub contractchange()
Dim run As Variant
run = MsgBox("do you want to make changes',vbYesNo)
If run = vbNo Then Exit Sub
If run = vbYes Then "remaining code goes here)

Last edited by macropod; 11-30-2013 at 02:48 PM. Reason: Added code tags
Reply With Quote