BuffaloGuy
New Member
- Joined
- Dec 5, 2017
- Messages
- 28
I wrote some code a while back that has done exactly what I needed it to. I have a word document with filler words like Client_Address that when a button is clicked in excel, the word document is opened, a specific cell is coped in Excel and then pasted over the filler word. I have a few dozen of these cases in each word document.
What I want to do though, is instead of opening the existing word document, I want to open the template as Document1 or Blank1, something where I don't accidently save over the word template. Is that possible? I will attached the code as it already exists.
What I want to do though, is instead of opening the existing word document, I want to open the template as Document1 or Blank1, something where I don't accidently save over the word template. Is that possible? I will attached the code as it already exists.
Code:
Private Sub Desktop_Builder_Click()
Template = "C:\Users\John\Desktop\FORMS\Work Template.docx"
Set wrdApp = CreateObject("Word.Application")
Set wrdDoc = wrdApp.Documents.Open(Template, ReadOnly:=True)
Dim Effective_Date As Variant
Dim Date_Inspection As Variant
Dim Date_Written As Variant
wrdApp.Visible = True
wrdApp.Selection.Find.ClearFormatting
wrdApp.Selection.Find.Replacement.ClearFormatting