Solved

MS Project 2010 pastelink fields - finding tasks with VBA

Posted on 2015-01-29
3
150 Views
Last Modified: 2016-02-23
We have used the copy and Paste Special - Text Link feature to create hammock tasks in MS Project 2010. I know they show a small gray triangle in the lower right corner of a start or finish date field which is linked to another task's date field. But, we need to document which tasks have that link in either start or finish or both. I'm sure this requires some VBA examination of the contents of a date field and then either adding that link reference information to the task's notes, a custom text field, or another list to be pasted into a Word or Excel document for further viewing.

I have little VBA experience, so I'm using my paid resource to see if someone here can show what that kind of loop through all the tasks would look like. I'm just looking for links in start and finish. If we can store the UID of the linked task  in a number field or text field, I would be fine with that. Probably one field for a start link and one for a finish link. And, whether the link is to the task's start or finish field, now that I think about it. Those would go in a text field.

Thanks for the guidance.
0
Comment
Question by:Shannon Mollenhauer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Expert Comment

by:Dr. Thomas Henkelmann
ID: 40583445
Hi,

as far as I know you can only find the tasks with linked fields by running through all tasks and checking for the LinkedFields property. Unfortunately there is no way to see WHERE the link goes to.

A simple Version of the code would be:
---
Sub FindLinkedTasks()

    Dim oTask As Task
   
    For Each oTask In ActiveProject.Tasks
        If Not oTask Is Nothing Then
            If oTask.LinkedFields Then
                'need some code here to count or display the tasks that have linked fields
            End If
        End If
    Next

End Sub
---

Hope this helps

Thomas
0
 

Author Comment

by:Shannon Mollenhauer
ID: 40612218
Thanks for the help. I'll use your structure for the basic loop and see if I can get an accumulator in there to display the count and task IDs for linked tasks. Maybe I can post something in the MS community or some MSP SIG forum about this. The data indicating where the link goes has to be stored somewhere in order for the program itself to know what to link, so hopefully it's accessible through code.
0
 
LVL 12

Accepted Solution

by:
Dr. Thomas Henkelmann earned 500 total points
ID: 41457888
Hi,

while the source of the object link is not accessible via VBA code you can use this as a workaround:

     For Each oTask In ActiveProject.Tasks
         If Not oTask Is Nothing Then
             If oTask.LinkedFields Then
 ***                ObjectLinks
             End If
         End If
     Next

The *** indicates the ObjectLinks command that opens a window showing THAT there is a link. If you then click on "Open source" the current (selected) task jumps to the source of the link. Unfortunately it does NOT even show you WHICH field has been used as the source...sigh

Sorry I don't have a better answer!

Thomas
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a serious pitfall that can happen when deleting shapes using VBA.
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question