I have a VBA function which runs from an MS Access Application.
The module opens a given file, highlights the first few lines of text and then closes the file.
However, I want to store this selected text within a string variable - I have very little knowledge of lotusscript and need to know how to refer to this selected area...
[vb]
Public Function ExtractWordProDetails(Filename As Variant,
Path As Variant) As Variant
'Testing? call ExtractWordProDetails("test", "C:\"
Dim WordProApp As Object
Dim WordProDoc As Object
Dim WordProOpen As Boolean
Dim CustomerAddress As String
CustomerAddress = "Not Known"
Set WordProDoc = GetObject("", "wordpro.application"
If WordProDoc Is Nothing Then
Set WordProApp = CreateObject("wordpro.application"
Else
WordProOpen = True
End If
Call WordProDoc.OpenDocument(Filename & ".lwp", Path)
Set WordProApp = WordProDoc.Parent
Set WordProDoc = WordProApp.ActiveDocument
WordProApp.Visible = True
Dim strTest As String
With WordProDoc
WordProApp.TYPE "[shiftDown][shiftDown][shiftDown]"
.CopySelection
'*****************************************
'NEED TO ASSIGN WHATEVER IS IN THE SELECTED AREA TO
'strTest VARIABLE HERE
'*****************************************
End With
Debug.Print strTest
WordProApp.Quit
Set WordProDoc = Nothing
Set WordProApp = Nothing
End Function
[/vb]
Any help greatfully appreciated.
The module opens a given file, highlights the first few lines of text and then closes the file.
However, I want to store this selected text within a string variable - I have very little knowledge of lotusscript and need to know how to refer to this selected area...
[vb]
Public Function ExtractWordProDetails(Filename As Variant,
Path As Variant) As Variant
'Testing? call ExtractWordProDetails("test", "C:\"
Dim WordProApp As Object
Dim WordProDoc As Object
Dim WordProOpen As Boolean
Dim CustomerAddress As String
CustomerAddress = "Not Known"
Set WordProDoc = GetObject("", "wordpro.application"
If WordProDoc Is Nothing Then
Set WordProApp = CreateObject("wordpro.application"
Else
WordProOpen = True
End If
Call WordProDoc.OpenDocument(Filename & ".lwp", Path)
Set WordProApp = WordProDoc.Parent
Set WordProDoc = WordProApp.ActiveDocument
WordProApp.Visible = True
Dim strTest As String
With WordProDoc
WordProApp.TYPE "[shiftDown][shiftDown][shiftDown]"
.CopySelection
'*****************************************
'NEED TO ASSIGN WHATEVER IS IN THE SELECTED AREA TO
'strTest VARIABLE HERE
'*****************************************
End With
Debug.Print strTest
WordProApp.Quit
Set WordProDoc = Nothing
Set WordProApp = Nothing
End Function
[/vb]
Any help greatfully appreciated.