By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Locate plain text variables <*> in word doc

P: n/a
Hi All,

I would like to be able to check whether there are any remaining plain
text variables left in a word document after it has been built based on
a template. At this stage, I roll through a recordset and replace any
plain text variables using the following code:

Set rs = db.OpenRecordset("SELECT * FROM tbl_Doc WHERE zDocID = '" &
Me.cboTask & "' or zMakeAvailable = true;")
Do Until rs.EOF
wdRange.Find.Execute FindText:=rs("zFind"),
ReplaceWith:=rs("zReplace"), Replace:=wdReplaceAll
rs.MoveNext
Loop
rs.Close
Set db = Nothing
Set rs = Nothing

After completing this process I would like to search through the
activedocument and determine whether there are any user based variables
that were not included in the recordset. I would then add the variable
to the table and prompt the user to declare it and search through the
document again to perform the find/replace procedure. This would
therefore make the new values available the next time the document is
built. All variables in the document are in the following format
<VariableName>.

Thanks in advance for any thoughts on this problem. Anton

Jan 9 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.