C
Charles DiGiovanna
In developing a website for a client I'm caught in a situation where I am
not permitted to use CGI scripts to process email messages so that the only
format I can use to send the information from the website's forms to the
client is the enctype="text/plain" option. The client finds the format of
the messages he receives difficult to read. He would also like to make
storage of the information received easier.
The client has access to all the Windows 2000 applications. As a workaround
I'm developing a project using VBA to process the text messages received in
Outlook by using Word's functionalities to reformat the information to
something more readable. (I plan to go from there to "calling" Access or
Excel to store the information into a database for the client.)
I'm developing the project from Outlook's VBA. I have easily sent the text I
want to process from the appropriate Outlook items to a procedure opening a
new Word application and document. I've defined a variable as Range and
'occupied' the range with the text I want to process by invoking the line
Set Range = ActiveDocument.Content
To process the text now resident in Range I'm trying to use the following
code:
With Range.Find
.text = "string"
....more code
End With
Until the first line of the With loop code executes all is well but as soon
as that line executes the Find object's Text property changes from
<Object variable or With block variable not set>
to
<Invalid Procedure or ..etc...>
and I immediately get an Error 5.
If I execute the code from Word (in another project) it flows
without error.
I'm guessing that the problem lies in calling the procedure from the Outlook
procedure that's processing the Outlook Item.
Can anyone give me some idea of what's happening and what I can do to to use
the Find object in this kind of application?
not permitted to use CGI scripts to process email messages so that the only
format I can use to send the information from the website's forms to the
client is the enctype="text/plain" option. The client finds the format of
the messages he receives difficult to read. He would also like to make
storage of the information received easier.
The client has access to all the Windows 2000 applications. As a workaround
I'm developing a project using VBA to process the text messages received in
Outlook by using Word's functionalities to reformat the information to
something more readable. (I plan to go from there to "calling" Access or
Excel to store the information into a database for the client.)
I'm developing the project from Outlook's VBA. I have easily sent the text I
want to process from the appropriate Outlook items to a procedure opening a
new Word application and document. I've defined a variable as Range and
'occupied' the range with the text I want to process by invoking the line
Set Range = ActiveDocument.Content
To process the text now resident in Range I'm trying to use the following
code:
With Range.Find
.text = "string"
....more code
End With
Until the first line of the With loop code executes all is well but as soon
as that line executes the Find object's Text property changes from
<Object variable or With block variable not set>
to
<Invalid Procedure or ..etc...>
and I immediately get an Error 5.
If I execute the code from Word (in another project) it flows
without error.
I'm guessing that the problem lies in calling the procedure from the Outlook
procedure that's processing the Outlook Item.
Can anyone give me some idea of what's happening and what I can do to to use
the Find object in this kind of application?