![]() |
|
#2
|
||||
|
||||
|
Try something along the lines of:
Code:
Private Sub Document_Open()
With ActiveDocument
If .SaveFormat = wdFormatRTF Then
If InStr(.Name, "Contract", vbTextCompare) > 0 Then
Call FoodAndBeverageMacro(ActiveDocument)
End If
End If
End With
End Sub
Sub FoodAndBeverageMacro(Doc As Document)
Dim Rslt
Rslt = MsgBox("Do you wish to remove gratuity detail from F&B clause" & vbCr & _
"(Canadian Properties only)?", vbYesNo, "Canadian F&B Clause Change")
If Rslt = vbYes Then
With Doc.Content.Find
'Find/Replace code goes here
End With
End If
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
| Tags |
| macros don't work, macros in word, vba word |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Word file type in 2007
|
casaserves | Word | 4 | 08-03-2013 01:11 AM |
can I run a macro when I open a specific doc ??
|
ximpostor | Word VBA | 10 | 10-12-2012 12:35 PM |
Need VBA For Macro On How To Remove Specific Words
|
netchie | Word VBA | 6 | 08-28-2012 03:37 PM |
| can I run a macro when I open a specific doc. | shreked | Word | 8 | 01-12-2012 03:36 AM |
| Getting COMException Incompatible file type and file extension | sbalerao | Mail Merge | 0 | 04-21-2011 10:30 AM |