Community
Showing results for 
Search instead for 
Do you mean 
Reply

Command line "open layout"

Nickel Contributor
Posts: 493
Country: USA

Command line "open layout"

Hello.

 

I was wondering if anyone knew how to open an alternative layout via the command line?

 

"C\Program Files\ACT!\........{layout name}  ??????

 

What is the string to open another layout?

 

Thanks,

 

P

Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Command line "open layout"

Pat,

Here is some code that may help.

 

CDull

 

private bool SetLayout() 
{ 
    
    try { 
        System.Windows.Forms.OpenFileDialog oOpenFileDialog = new System.Windows.Forms.OpenFileDialog(); 
        oOpenFileDialog.Multiselect = false; 
        oOpenFileDialog.DefaultExt = "cly"; 
        oOpenFileDialog.FileName = Toolkit.ACTAPP.UILayoutDesignerManager.GetCurrentLayout(Act.UI.LayoutDesigner.LayoutType.contact).layoutName; 
        oOpenFileDialog.Filter = "Contact Layout File|*.cly|All Files| *.*"; 
        oOpenFileDialog.InitialDirectory = Toolkit.ACTFM.SupplementalFileManager.Workgroup.Path + "\\Layouts\\"; 
        
        if (oOpenFileDialog.ShowDialog(Toolkit.ACTAPP) == Windows.Forms.DialogResult.OK) { 
            Toolkit.ACTAPP.UILayoutDesignerManager.SetCurrentLayout(Act.UI.LayoutDesigner.LayoutFileInfo.CreateLayoutFileInfo(oOpenFileDialog.FileName)); 
            return true; 
        } 
        
        return false; 
    } 
    
    catch (Exception ex) { 
        LogError.Write(ex, "Toolkit:SetLayout"); 
        
    } 
    
} 

 

VB

 

  Private Function SetLayout() As Boolean

        Try
            Dim oOpenFileDialog As New System.Windows.Forms.OpenFileDialog()
            oOpenFileDialog.Multiselect = False
            oOpenFileDialog.DefaultExt = "cly"
            oOpenFileDialog.FileName = Toolkit.ACTAPP.UILayoutDesignerManager.GetCurrentLayout(Act.UI.LayoutDesigner.LayoutType.contact).layoutName
            oOpenFileDialog.Filter = "Contact Layout File|*.cly|All Files| *.*"
            oOpenFileDialog.InitialDirectory = Toolkit.ACTFM.SupplementalFileManager.Workgroup.Path + "\Layouts\"

            If oOpenFileDialog.ShowDialog(Toolkit.ACTAPP) = Windows.Forms.DialogResult.OK Then
                Toolkit.ACTAPP.UILayoutDesignerManager.SetCurrentLayout(Act.UI.LayoutDesigner.LayoutFileInfo.CreateLayoutFileInfo(oOpenFileDialog.FileName))
                Return True
            End If

            Return False

        Catch ex As Exception
            LogError.Write(ex, "Toolkit:SetLayout")

        End Try

    End Function

 

Nickel Contributor
Posts: 493
Country: USA

Re: Command line "open layout"

Thanks Jim for you hard work!

 

Is there any way of doing it via a simple command line i.e. "Start", "Run".  Please don't tell me ACT! never set this up.  Please no.

Almost every single software out there has command line arguments for almost every action in it's software.  Please tell me I'm wrong.  Pretty please with sugar on top?

 

-P

 

 

Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Command line "open layout"

Sorry to say my understanding is that ACT! only has 3 command line arguments:

-nooffice
-nosplash
path\filename.pad
 This was from ACT 2006- maybe somebody from ACT can chime in if this has changed.
-- jim durkin