Transfer Table content with DOCVARIABLES from a textbox

A

Alok

Hi all

Plz tell me .
I want to transfer a doc. table's contents to the textbox in a userform.
the tables have docvariable already embedded .

I want that, when i transfer the contents from the textbox back to the doc.
table then the docvariable should be persisting in the table.

Right now it removes the docvariable name and transfers staticaly .

eg.
txt1.value = activedocument.tables(1).Range.text
activedocument.tables(1).Range.text = trim(txt1.value)

any help is appreciating .

Thanks,
Alok
 
D

Doug Robbins - Word MVP

Why not use

txt1.Value = ActiveDocument.Variables("varname").Value

and

ActiveDocument.Variables("varname").Value = txt1.value
ActiveDocument.Fields.Update 'to update the DOCVARIABLE field with the new
value from txt1

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
A

Alok

hi,
sorry that is not probably what i want..
actually i am already using all that stuff to populate the value of a
variable in the table .
the issue here is when i assign the table (which has docvariable in it) to
the text box and again transfer back to the table in the document , it remove
the docvariable placeholder and the value of the docvariable is pasted
statically .

eg.what i am doing is .
text1.value = activedocument.tables(10).range.text
[the table has a docvariable in it ]
...........<snippets>
..........
activedocument.tables(10).range.text = text1.value
[now the table removes any docvariable placeholder in it ? ]
 

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