<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Modify Function Keys</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/bdn-vba/99862/modify-function-keys</link><description>Is there any option to modify the string for a particular key in Function Keys[.mnu] using VBA?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Modify Function Keys</title><link>https://communities.bentley.com/thread/295251?ContentTypeID=1</link><pubDate>Fri, 08 Aug 2014 03:49:51 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:93a92abb-ee8b-46d3-9992-31a98d0447b3</guid><dc:creator>Dharma Rajan</dc:creator><description>&lt;p&gt;Thank you Jon :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify Function Keys</title><link>https://communities.bentley.com/thread/295191?ContentTypeID=1</link><pubDate>Thu, 07 Aug 2014 13:44:19 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:6fa767db-d95c-4ac4-b0a2-f23340233024</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;Dharmarajan&amp;quot;]Is there any option to identify that (present FunctionKey) path?[/quote]&lt;/p&gt;
&lt;p&gt;You&amp;#39;ll need this MDL function: &lt;span style="font-family:courier new,courier;"&gt;mdlFuncKey_currentMenu&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Put this declaration at the top of your VBA code&amp;nbsp;&amp;hellip;&lt;/p&gt;
&lt;pre&gt;&lt;code style="font-family:courier new,courier;"&gt;Declare Sub mdlFuncKey_currentMenu Lib &amp;quot;stdmdlbltin.dll&amp;quot; ( ByVal filename As String )&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Use it like this&amp;nbsp;&amp;hellip;&lt;/p&gt;
&lt;pre&gt;&lt;code style="font-family:courier new,courier;"&gt;&lt;span style="color:seagreen;"&gt;
&amp;#39; ---------------------------------------------------------------------
&amp;#39;   FunctionKeyMenuPath
&amp;#39;    VBA wrapper round MDL function
&amp;#39;   Returns:    String the path to the current function key menu
&amp;#39; ---------------------------------------------------------------------&lt;/span&gt;
Public Function FunctionKeyMenuPath() As String
  Dim path As String
  Const MAX_PATH As Long = 254
  path = Space(MAX_PATH)
  mdlFuncKey_currentMenu path
  FunctionKeyMenuPath = Trim(Left(path, InStr(path, Chr(0)) - 1))
End Function &lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify Function Keys</title><link>https://communities.bentley.com/thread/295176?ContentTypeID=1</link><pubDate>Thu, 07 Aug 2014 12:43:03 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:639224b0-add6-4700-b4ba-06012bb042d1</guid><dc:creator>Dharma Rajan</dc:creator><description>&lt;p&gt;Hai Jon/Jan,&lt;/p&gt;
&lt;p&gt;I think that ActiveWorkspace.ConfigurationVariableValue (&amp;quot;MS_FKEYMNU&amp;quot;) will show the default/startup path of function key menu. But the &amp;quot;attached FunctionKeyMenu&amp;quot; &amp;nbsp;path may vary[if the user manually attach/opened a FunctionKeyMenu from another location]. Is there any option to identify that (present FunctionKey)path?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify Function Keys</title><link>https://communities.bentley.com/thread/295165?ContentTypeID=1</link><pubDate>Thu, 07 Aug 2014 11:33:28 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:b534f8f7-4fcf-4290-ae43-c8cabfb04850</guid><dc:creator>Jan Šlegr</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;Jon Summers&amp;quot;]The function key menu is attached using the value of configuration variable &lt;span style="font-family:courier new,courier;"&gt;MS_FKEYMNU&lt;/span&gt;.[/quote]&lt;/p&gt;
&lt;p&gt;Yes, but if I remember right, the varible is used when MicroStation is started, but to load another mnu file from MicroStation, a key-in &lt;span style="font-family:courier new,courier;"&gt;attach menu &amp;lt;full path to mnu file&amp;gt;,FK&lt;/span&gt; has to be used.&lt;/p&gt;
&lt;p&gt;So probably the best approach is attach menu and to change MS_FKEYMNU at the same time.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify Function Keys</title><link>https://communities.bentley.com/thread/295161?ContentTypeID=1</link><pubDate>Thu, 07 Aug 2014 11:18:17 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:d8b21598-6f0a-4f72-9e95-8bf348172d7c</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;Dharmarajan&amp;quot;]How to get the attached mnu file path using VBA?[/quote]&lt;/p&gt;
&lt;p&gt;The function key menu is attached using the value of configuration variable &lt;span style="font-family:courier new,courier;"&gt;MS_FKEYMNU&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Dim menuPath As String&lt;br /&gt;menuPath = ActiveWorkspace.ConfigurationVariableValue (&amp;quot;MS_FKEYMNU&amp;quot;)&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify Function Keys</title><link>https://communities.bentley.com/thread/295129?ContentTypeID=1</link><pubDate>Thu, 07 Aug 2014 09:53:54 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5913804f-5a34-45a9-95aa-519549dabba8</guid><dc:creator>Dharma Rajan</dc:creator><description>&lt;p&gt;Thanks Jan and one more question.&lt;/p&gt;
&lt;p&gt;For editing the mnu file, how to get the attached mnu file path using VBA?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify Function Keys</title><link>https://communities.bentley.com/thread/295128?ContentTypeID=1</link><pubDate>Thu, 07 Aug 2014 09:49:23 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:64250803-5956-4cfe-80f7-62e4d8623233</guid><dc:creator>Jan Šlegr</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;mnu file is a normal text file, so you can modify it using standard text file functions available in VBA.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>