Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modify Word Field from VB.NET 1

Status
Not open for further replies.

revz

Technical User
Apr 18, 2001
10
0
0
GB
Hi,

I am trying to update fields in Microsoft Word XP. At the moment I am going through them sequentially:

w.ActiveDocument.Fields.Item(1).Select()
w.Selection.TypeText(Text:="New value here")

I would like to be able to reference each one by the name I have given them in Microsoft Word XP

If it helps, the following VB6 code is what im trying to achieve in VB.NET:

For Each sProp In w.ActiveDocument.CustomDocumentProperties
If sField = sProp.Name Then
'To change the value of custom property
sProp.Value = sValue
End If
Next sProp


Many thanks in advance

Thomas Griffiths
tom@vscan.org

P.S. If you have any Microsoft Word automation tutorials , I would be grateful for the URL, Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top