Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.
ADDINs - Accessing the Settings/Resources in the IDE

Locked ADDINs - Accessing the Settings/Resources in the IDE

  • mercredi 17 août 2005 20:30
     
     

    I have an Addin - AddIn1.
    I want to inculde this AddIn1 in a project Project1 and access the settings/resources of the project Project1 in Addin1.

    I could get to the properties using this code - but can't get the Settings/Resources - any clue???

    this is the code in AddIn
    Private Sub SetActiveProject()
       Dim doc As Document
       Dim prjItem As ProjectItem
       Dim bfound As Boolean = False
       Dim prj As Project

       Try

       doc = applicationObject.ActiveDocument
       For Each prj In applicationObject.Solution.Projects
           For Each prjItem In prj.ProjectItems
               If prjItem.FileNames(1) = doc.FullName Then
                   If prjItem.Document.Path = doc.Path Then
                       bfound = True
                       Exit For
                    End If
               End If
           Next
           If bfound Then Exit For
       Next

       Catch ex As Exception

       End Try

       If Not bfound Then
          'prj is the first one
           prj = applicationObject.Solution.Projects.Item(1)
       End If

       Dim svbProject As String = CStr(prj.Properties.Item("FullPath").Value)

       svbProject &= CStr(prj.Properties.Item("AssemblyName").Value) & ".vbproj"
       
       dim sOutputPath = prj.ConfigurationManager.Item(1).Properties.Item("OutputPath").Value

    End Sub

     

Toutes les réponses

  • jeudi 18 août 2005 19:22
     
     Traitée
    okay..
    could get the constants frm the Add-in project using:

    prj.ConfigurationManager.ActiveConfiguration.Properties.Item("DefineConstants").Value.ToString()