Community
Showing results for 
Search instead for 
Do you mean 
Reply

programmatically call menu item in ACT!

Tuned Listener
Posts: 21
Country: Germany

programmatically call menu item in ACT!

Hi,

 

can anyone help?

I need to programmatically call menu item in ACT!

 

In the SDK I could not find anything (except for “Sage ACT! Uniform Resource Names”)

 

If possible, an example in C # or VB to call menu item (for example for “&Mail Merge      act-ui://com.act/application/menu/help/mailmerge”)

 

Thank you in advance

 

Alex

Employee
Posts: 1,163
Country: USA

Re: programmatically call menu item in ACT!

There may be a better way to do this other than calling the menu item itself, but instead the function that it performs. Which menu item are you trying to access?

Matthew Wood
Act! SDK Support
Community Moderator
Tuned Listener
Posts: 21
Country: Germany

Re: programmatically call menu item in ACT!

 

I need to send a mass e-mail to selected contacts, but first I have to do some checking.

 

Contacts are found, a check is made, but how to send a letter I do not know

 

Alex

Employee
Posts: 1,163
Country: USA

Re: programmatically call menu item in ACT!

There's a couple of ways to send emails using the API, there is a mail merge method in the UICorrespondenceManage class and a SendEmailtoContact method in UIEmailManager, they both behave as expected but the former requires a ContactList and template as parameters.

 

Unofortunately, I don't have an example put together using mail merge.

Matthew Wood
Act! SDK Support
Community Moderator
Tuned Listener
Posts: 21
Country: Germany

Re: programmatically call menu item in ACT!

Thanks Matthew,

now at least know where to look.

 

but if anyone can help with the examples, I will be very grateful

 

Alex

Copper Super Contributor
Posts: 478
Country: Australia

Re: programmatically call menu item in ACT!

Is there an answer to the original question?, i am trying to work out if its possible to call a new menu item i added via a Plugin but also want it called from a button on the contact view

Jason Dawson Financial Planning
Brisbane | Australia - JDFP Home Page

Act Ver - Act! Premium Version 17.1.169.0, Hot Fix 3
OS - Windows 7 (stand alone machine)
MS Office - Enterprise 2007
Phone - Samsung Galaxy s6
Copper Contributor
Posts: 42
Country: Germany

Re: programmatically call menu item in ACT!

I also would be interested in calling a third party addon's menu entry!

Silver Super Contributor
Posts: 2,328
Country: USA

Re: programmatically call menu item in ACT!

I've never done it but I'm sure it can be done.  The easiest way is probably to just manually fire the event in your code.  Enumerate the events, get the one you want (the click event for the menu item you want) and then fire the event.

 

Stan


If you would like to get more out of ACT! you can find an ACT! Certified Consultant near you by going to:www.act.com/acc.
-------------------------------------------------------------------------------------
Stan Smith
ACT! Certified Consultant
ADS Programming Services, Inc.
(205) 222-1661
www.adsprogramming.com
www.actwebhosting.com
Click Here to Purchase Act!
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: programmatically call menu item in ACT!

Execute the command.

ActApplication.ExecuteCommand("act-ui://com.act/application/menu/file/synchronizenow")

 

Here is a routine to extract all the command from Act's menu system.

 

   Private Sub GetACTMenuCommands(ByVal ActApplication As Act.UI.ActApplication)
            ' Strip out all the URNS from ACT's menu system
            ' And save them into a file named 'ACTMenus.txt'
            Dim FS As New IO.FileStream("C:\ACTMenus.txt", IO.FileMode.Append, IO.FileAccess.Write)
            Dim sw As New IO.StreamWriter(FS)
            For Each pMenu As Act.UI.Core.CommandBarControl In ActApplication.Explorer.CommandBarCollection("Connected Menus").ControlCollection
                Dim Parentname As String = pMenu.Text.Replace("&", "").ToUpper

                For Each SubMenu As Act.UI.Core.CommandBarControl In pMenu.SubItems
                    'writing text to the newly created file
                    sw.WriteLine("Public Const " + Parentname + "_" + SubMenu.Command.Substring(SubMenu.Command.LastIndexOf("/") + 1) + " As String = QUOTES " + SubMenu.Command + " QUOTES")

                    Dim SubSubName As String = SubMenu.Command.Substring(SubMenu.Command.LastIndexOf("/") + 1)

                    For Each Sub2Menu As Act.UI.Core.CommandBarControl In SubMenu.SubItems
                        'writing text to the newly created file
                        sw.WriteLine("Public Const " + Parentname + "_" + SubSubName + "_" + Sub2Menu.Command.Substring(Sub2Menu.Command.LastIndexOf("/") + 1) + " As String = QUOTES" + Sub2Menu.Command + "QUOTES")
                    Next

                Next
            Next
            sw.Close()
        End Sub

 

Hope this helps

-- Jim Durkin

Copper Super Contributor
Posts: 478
Country: Australia

Re: programmatically call menu item in ACT!

Thanks Jim works like a charm

Jason Dawson Financial Planning
Brisbane | Australia - JDFP Home Page

Act Ver - Act! Premium Version 17.1.169.0, Hot Fix 3
OS - Windows 7 (stand alone machine)
MS Office - Enterprise 2007
Phone - Samsung Galaxy s6