Changing the format of text being transferred from a form

C

cbizic

I am having trouble tranferring text in a text box in a form to bookmarks in
a document. What I need to do is if the text has not been changed (the
caption is still there) I want it bolded so that the user is reminded to
change it. Otherwise it should be regular text. I would assume an if
then/else statement would do that but where would it be placed? As part of
the form? I have tried putting it in a subroutine that transfers the
information but this is not working.....any ideas?
 
J

Jezebel

Dim pRange as Word.Range

set pRange = ActiveDocument.Bookmarks(pName).Range
If pRange.Text = TextBox(pName) then
pRange.Font.Bold = TRUE
else
pRange.Font.Bold = FALSE
pRange = Textbox(pName)
ActiveDocument.Bookmarks.Add Name:=pName, Range:=pRange
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top