K
KLegg14534
I am attempting to get information from a Textbox from a MSWord document.
I have gotten as far as being able to open the document I want and selecting
the text box with the information I need. After that, I am unable to get the
data to later insert into the database table.
Please see code below and let me know where I am going wrong or what to do.
Thanks,
Kevin Legg
Public Function GetConfigSheetI()
On Error Resume Next
Dim strTemp As String
Dim objCfgDoc As Object
Dim strDocName As String
Set UnitUnderTest = CurrentDb.OpenRecordset("CurrentUnit")
strFilePath = "G:\Engineering\FACTORY CALIBRATION\"
strDocName = UnitUnderTest![CfgFile] ' "IED509-1626.doc"
Set objCfgDoc = GetObject(FilePath & DocName)
objCfgDoc .Application.Visible = True
objCfgDoc .Shapes("Text Box 82").Select
'************************************
'Everything works up until this point
'************************************
strTemp = objCfgDoc .Shapes("Text Box 82").Selection.WholeStory
objCfgDoc .Shapes("Text Box 82").Selection
Set objCfgDoc = Nothing
End Function
I have gotten as far as being able to open the document I want and selecting
the text box with the information I need. After that, I am unable to get the
data to later insert into the database table.
Please see code below and let me know where I am going wrong or what to do.
Thanks,
Kevin Legg
Public Function GetConfigSheetI()
On Error Resume Next
Dim strTemp As String
Dim objCfgDoc As Object
Dim strDocName As String
Set UnitUnderTest = CurrentDb.OpenRecordset("CurrentUnit")
strFilePath = "G:\Engineering\FACTORY CALIBRATION\"
strDocName = UnitUnderTest![CfgFile] ' "IED509-1626.doc"
Set objCfgDoc = GetObject(FilePath & DocName)
objCfgDoc .Application.Visible = True
objCfgDoc .Shapes("Text Box 82").Select
'************************************
'Everything works up until this point
'************************************
strTemp = objCfgDoc .Shapes("Text Box 82").Selection.WholeStory
objCfgDoc .Shapes("Text Box 82").Selection
Set objCfgDoc = Nothing
End Function