G
Georgios Liakopoulos
Hello,
I am using VBA (in an MS Access procedure) to locate and read text parts
from a Word document. Text parts are like ##*## where * is a variable
digit number (goes from 37 to 6000 or more).
So what I want is to locate ##*##, read it and place it in an access
table, then replace the text with something else, lets say ##READ##.
Here is the VBA code:
******************************************************
With objWord.ActiveDocument.Content.Find
.ClearFormatting
.MatchWildcards = True
.Text = "##*##"
If .Execute = True Then
Debug.Print Selection.Text 'this is like reading the number
.. . .
******************************************************
Example of the text in the Word document:
Bla, bla, bla ##45## bla bla bla ##2843## bla, bla, . . . .
Running the code should at first select ##45##, print ##45## in the
Access Immediate window and so on. . .
The problem is that it only prints: # like it only selects the first
character from the ##45##.
Can anyone help with this?
I am grateful to anyone who will read my question
I am using VBA (in an MS Access procedure) to locate and read text parts
from a Word document. Text parts are like ##*## where * is a variable
digit number (goes from 37 to 6000 or more).
So what I want is to locate ##*##, read it and place it in an access
table, then replace the text with something else, lets say ##READ##.
Here is the VBA code:
******************************************************
With objWord.ActiveDocument.Content.Find
.ClearFormatting
.MatchWildcards = True
.Text = "##*##"
If .Execute = True Then
Debug.Print Selection.Text 'this is like reading the number
.. . .
******************************************************
Example of the text in the Word document:
Bla, bla, bla ##45## bla bla bla ##2843## bla, bla, . . . .
Running the code should at first select ##45##, print ##45## in the
Access Immediate window and so on. . .
The problem is that it only prints: # like it only selects the first
character from the ##45##.
Can anyone help with this?
I am grateful to anyone who will read my question