Copy Task Field Data to Task Hyperlink builtin field

P

Projectuser

How can I automatically copy a Task level custom field data containing URL to
the default hyperlink field?

Thanks
 
J

JulieS

Hello ProjectUser,

The following sample code will copy the entry of the text1 field to
the hyperlink field. It will need to be run each time the data in
the Text1 field changes. Because the hyperlink field is not a
custom field, you cannot write formulas in the hyperlink field.
Also note, the hyperlink field contains only hyperlink data so any
extra text in the Text1 field becomes part of the hyperlink
rendering the hyperlink useless.

Sub CopyToHyperlink()
Dim tk As Task

For Each tk In ActiveProject.Tasks
If Not tk Is Nothing Then
tk.HyperlinkAddress = tk.Text1
End If
Next tk

End Sub

I hope this helps. Let us know how you get along.

Julie
Project MVP

Visit http://project.mvps.org/ for the FAQs and additional
information about Microsoft Project
 

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