Hi all,
I have a for next loop that has a case select section.
One of the cases opens a word document and populates some form fields.
I keep getting a dialog box stating that the document is locked by me and asks if i want to open it as read only.
When the document is opened it is the only instance of the doument so i cannot understand how it can already be locked.
here is the case select code.
I hope some one can help on this.
I have search the forum but can't seem to find an answer
thanks in advance.
I have a for next loop that has a case select section.
One of the cases opens a word document and populates some form fields.
I keep getting a dialog box stating that the document is locked by me and asks if i want to open it as read only.
When the document is opened it is the only instance of the doument so i cannot understand how it can already be locked.
here is the case select code.
Code:
Select Case StatUs
Case "Input", "Sales Capture", "Awaiting Refer Sales Contact", "Awaiting Sales Contact", "Awaiting Quoting", "Sent to Underwriting"
smsMessage = "Your recent loan application has been provisionally approved. Call us on 08704 428030, quoting your name & postcode so your loan can be arranged."
Call SendSmS
Case "Originals Pack Sent"
smsMessage = "Your signable documents have been sent out and should be with your in 48 hours. Please call us on 08704 428030 if you do not receive them."
Call SendSmS
Case "Awaiting Docs"
smsMessage = "We have not received your loan documents back. Please complete and return A.S.A.P. Please call us if you have any problems on 08704 428030"
Call SendSmS
Case "Advance Pack Sent"
Set WD = CreateObject("Word.Application")
Dim Wdoc As Word.Document
On Error GoTo openwRddOc
Set Wdoc = WD.Documents.Open(App.Path + "\Documents\dfnocontact.doc")
'WD.Active = True
WD.Visible = True
Pause 7500
On Error GoTo sEtFields
With Wdoc.Bookmarks
.Item("Text1").Range.Text = objC.GetField(46)
.Item("Text2").Range.Text = objC.GetField(55)
.Item("Text3").Range.Text = objC.GetField(53)
.Item("Text4").Range.Text = objC.GetField(61)
.Item("Text5").Range.Text = objC.GetField(60)
.Item("Text6").Range.Text = objC.GetField(59)
.Item("Text7").Range.Text = objC.GetField(27)
.Item("Text8").Range.Text = objC.GetField(30)
.Item("Text9").Range.Text = objC.GetField(31)
.Item("Text10").Range.Text = objC.GetField(32)
End With
On Error GoTo ActiveDoC
WD.PrintOut True
Do While WD.BackgroundPrintingStatus <> 0
Loop
On Error GoTo closeWrd
WD.Application.Quit wdDoNotSaveChanges
Pause 2500
Set WD = Nothing
End Select
I hope some one can help on this.
I have search the forum but can't seem to find an answer
thanks in advance.