Hi,
I am tyring to set up a contract document with a userform in word to enter all the input information throughout the document. all fields are setup in the document and the reference names are all correct however I am getting an issue with my code when I run it, which is no surprise really!
If anyone could give me some assistance, it would be much appreciated!
Option Explicit
Private Sub UserForm_Initialize()
With cboWorks_Ins
.AddItem "Alternative 1"
.AddItem "Alternative 2"
End With
With cboPL_Ins
.AddItem "Alternative 1"
.AddItem "Alternative 2"
End With
With cboPC_Date_Time
.AddItem "Date"
.AddItem "Duration (in weeks)"
End With
End Sub
Private Sub cmdCancel_Click()
Unload Me
ActiveDocument.Close SaveChanges:=False
End Sub
Private Sub cmdOK_Click()
Application.ScreenUpdating = False
With ActiveDocument
.Bookmarks("Project_No").Range.Text = txtProject_No.Value
.Bookmarks("Proj_Name").Range.Text = txtProj_Name.Value
.Bookmarks("Client").Range.Text = txtClient.Value
.Bookmarks("Client_Address").Range.Text = txtClient_Address.Value
.Bookmarks("Client_ABN").Range.Text = txtClient_ABN.Value
.Bookmarks("Council").Range.Text = txtCouncil.Value
.Bookmarks("Water_Auth").Range.Text = txtWater_Auth.Value
.Bookmarks("Elect_Auth").Range.Text = txtElect_Auth.Value
.Bookmarks("Main_Drain_Auth").Range.Text = txtMain_Drain_Auth.Value
.Bookmarks("Comms_Auth").Range.Text = txtComms_Auth.Value
.Bookmarks("Tender_Close").Range.Text = txtTender_CLose.Value
.Bookmarks("LDs").Range.Text = txtLDs.Value
.Bookmarks("Works_Ins").Range.Text = cboWorks_Ins.Value
.Bookmarks("PL_Ins").Range.Text = cboPL_Ins.Value
.Bookmarks("Possession_Time").Range.Text = txtPossession_Time.Value
.Bookmarks("Possession_Trigger").Range.Text = txtPossession_Trigger.Value
.Bookmarks("PC_Date_Time").Range.Text = cboPC_Date_Time.Value
.Bookmarks("PC").Range.Text = txtPC.Value
End With
Application.ScreenUpdating = True
Unload Me
End Sub