<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Want &amp;quot;apply&amp;quot; in options using vba. in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303153#M65366</link>
    <description>Here is the code.  The last two line were the suggestion of next post.  It actually works but we have to hit okay to get out of option.  Any comments would be grateful.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Private Sub CaddStandards_Click()&lt;BR /&gt;
    'This button modifies the preference which controls&lt;BR /&gt;
    ' the location for plot style table path files(ctb) - to Q:\Plotting\Plot Styles (ctb)&lt;BR /&gt;
    Dim ACADPref As AcadPreferencesFiles&lt;BR /&gt;
    Dim NewValue As String&lt;BR /&gt;
    Dim AcadPlotConfiguration As Variant&lt;BR /&gt;
    ' Get the files preferences object&lt;BR /&gt;
    Set ACADPref = ThisDrawing.Application.Preferences.Files&lt;BR /&gt;
    'change the path to the CADD Standards directory&lt;BR /&gt;
    NewValue = "Q:\Plotting\Plot Styles (ctb)"&lt;BR /&gt;
    ACADPref.PrinterStyleSheetPath = NewValue&lt;BR /&gt;
    Unload Me&lt;BR /&gt;
    MsgBox "The PrinterStyleSheetPath (ctb) path has been set to: " &amp;amp; NewValue&lt;BR /&gt;
       &lt;BR /&gt;
    SendKeys "{enter}"&lt;BR /&gt;
    ThisDrawing.SendCommand "options " &amp;amp; vbCr&lt;BR /&gt;
    &lt;BR /&gt;
End Sub</description>
    <pubDate>Wed, 05 Mar 2003 12:32:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2003-03-05T12:32:15Z</dc:date>
    <item>
      <title>Want  "apply" in options using vba.</title>
      <link>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303150#M65363</link>
      <description>A co-worker has created vba macro that will change the "plot style table search path"  The problem is when we change this using vba the ctb is not recognized (ie it plots in color instead of mono).  If we change the path manually it recognizes the ctb. It seems to have something to do with the apply button in options.  How do we get vba to apply/reinitilize or whatever it has to do in vba. Is there a command to do this.  Thanks</description>
      <pubDate>Tue, 04 Mar 2003 07:34:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303150#M65363</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-04T07:34:10Z</dc:date>
    </item>
    <item>
      <title>Want "apply" in options using vba.</title>
      <link>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303151#M65364</link>
      <description>For an accurate answer, you should post the code. Since you haven't done &lt;BR /&gt;
that, try adding .RefreshPlotDeviceInfo to the plot configuration &lt;BR /&gt;
object.&lt;BR /&gt;
___________________________&lt;BR /&gt;
Mike Tuersley&lt;BR /&gt;
AutoCAD Clinic&lt;BR /&gt;
Rand IMAGINiT Technologies</description>
      <pubDate>Tue, 04 Mar 2003 12:11:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303151#M65364</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-04T12:11:44Z</dc:date>
    </item>
    <item>
      <title>Want "apply" in options using vba.</title>
      <link>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303152#M65365</link>
      <description>Hopefully, Mike's answer will work for you.  If not...&lt;BR /&gt;
&lt;BR /&gt;
I don't know if this will work for you, but I had a similar situation.  In&lt;BR /&gt;
my case, Page Setup options wouldn't apply until the Page Setup dialog box&lt;BR /&gt;
was run.  I added code to call up the dialog box and just hit OK.  Here's&lt;BR /&gt;
that code, changed to work with the Options dialog box.  It doesn't run the&lt;BR /&gt;
Apply button, and it might not even open up on the right tab, but maybe&lt;BR /&gt;
OK'ing the dialog will do the job for you?&lt;BR /&gt;
&lt;BR /&gt;
   SendKeys "{ENTER}"&lt;BR /&gt;
   Thisdrawing.SendCommand ("options" &amp;amp; vbCr)&lt;BR /&gt;
&lt;BR /&gt;
I don't know if people will be able to cause problems with your program by&lt;BR /&gt;
smacking a bunch of keys while it runs, but I haven't had any problems with&lt;BR /&gt;
this yet.&lt;BR /&gt;
&lt;BR /&gt;
James</description>
      <pubDate>Wed, 05 Mar 2003 07:50:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303152#M65365</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-05T07:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Want "apply" in options using vba.</title>
      <link>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303153#M65366</link>
      <description>Here is the code.  The last two line were the suggestion of next post.  It actually works but we have to hit okay to get out of option.  Any comments would be grateful.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Private Sub CaddStandards_Click()&lt;BR /&gt;
    'This button modifies the preference which controls&lt;BR /&gt;
    ' the location for plot style table path files(ctb) - to Q:\Plotting\Plot Styles (ctb)&lt;BR /&gt;
    Dim ACADPref As AcadPreferencesFiles&lt;BR /&gt;
    Dim NewValue As String&lt;BR /&gt;
    Dim AcadPlotConfiguration As Variant&lt;BR /&gt;
    ' Get the files preferences object&lt;BR /&gt;
    Set ACADPref = ThisDrawing.Application.Preferences.Files&lt;BR /&gt;
    'change the path to the CADD Standards directory&lt;BR /&gt;
    NewValue = "Q:\Plotting\Plot Styles (ctb)"&lt;BR /&gt;
    ACADPref.PrinterStyleSheetPath = NewValue&lt;BR /&gt;
    Unload Me&lt;BR /&gt;
    MsgBox "The PrinterStyleSheetPath (ctb) path has been set to: " &amp;amp; NewValue&lt;BR /&gt;
       &lt;BR /&gt;
    SendKeys "{enter}"&lt;BR /&gt;
    ThisDrawing.SendCommand "options " &amp;amp; vbCr&lt;BR /&gt;
    &lt;BR /&gt;
End Sub</description>
      <pubDate>Wed, 05 Mar 2003 12:32:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303153#M65366</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-05T12:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Want "apply" in options using vba.</title>
      <link>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303154#M65367</link>
      <description>We tried your solution.  We still have to hit okay to get out of the options dialoge.  Is there no way to get out of dialog?  It does cure the problem of the ctb not being recognized.  The code is posted above.  Thanks.</description>
      <pubDate>Wed, 05 Mar 2003 12:34:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303154#M65367</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-05T12:34:03Z</dc:date>
    </item>
    <item>
      <title>Want "apply" in options using vba.</title>
      <link>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303155#M65368</link>
      <description>1) you need to remove the space after options... i.e. "options" instead of&lt;BR /&gt;
"options ".  When I do this, the options dialog box doesn't stay... in fact,&lt;BR /&gt;
I don't even see it blink.  So you will have to check it to see if it's&lt;BR /&gt;
actually running the dialog box or just skipping it.  The extra space was&lt;BR /&gt;
making&lt;BR /&gt;
&lt;BR /&gt;
2)  I searched this NG and apparently someone else found that the SendKeys&lt;BR /&gt;
doesn't work for this dialog box.  The only solution they listed had to be&lt;BR /&gt;
done from standalone VB.  Here's the link:&lt;BR /&gt;
&lt;BR /&gt;
http://hem.fyristorg.com/cadman/autocadbugs.htm#Profiles&lt;BR /&gt;
&lt;BR /&gt;
Good luck,&lt;BR /&gt;
James</description>
      <pubDate>Wed, 05 Mar 2003 13:25:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303155#M65368</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-05T13:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Want "apply" in options using vba.</title>
      <link>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303156#M65369</link>
      <description>We removed the space and it worked great.  Not sure what happend because he cut/pasted right of this board?  Anyways thanks for your help.</description>
      <pubDate>Wed, 05 Mar 2003 13:52:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303156#M65369</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-05T13:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Want "apply" in options using vba.</title>
      <link>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303157#M65370</link>
      <description>I spoke too soon.  It works great if the last tab accessed in options is "file". Otherwise it does not update if some other tab is current.  We looked at your point 2, but we do not have the brain power to figure out how to accomplish this.  Any suggestions on how we can get the "file" tab to be the current one?&lt;BR /&gt;
Thanks for your help.</description>
      <pubDate>Mon, 17 Mar 2003 13:20:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303157#M65370</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-17T13:20:38Z</dc:date>
    </item>
    <item>
      <title>Want "apply" in options using vba.</title>
      <link>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303158#M65371</link>
      <description>I think you can do this, if you're comfortable changing a registry key.  You&lt;BR /&gt;
could keep this as simple as a line or two, or get more complicated if you&lt;BR /&gt;
wanted more robust code.  It looks like there's some code you can borrow in&lt;BR /&gt;
the links below.&lt;BR /&gt;
&lt;BR /&gt;
Steps...&lt;BR /&gt;
1) get name of registry key.  Simple approach:  use REGEDIT to find key,&lt;BR /&gt;
hard-wire this key name.  Robust approach:  see second link below, involves&lt;BR /&gt;
AcadX.arx.&lt;BR /&gt;
2) set the key value corresponding to "Files" tab -- on my machine it's 0&lt;BR /&gt;
3) OPTIONS in ACAD should now open to Files&lt;BR /&gt;
&lt;BR /&gt;
The main part of this (long) link that would be useful to you is the part&lt;BR /&gt;
about the ActiveTab in the Options dialog:&lt;BR /&gt;
http://groups.google.com/groups?hl=en&amp;amp;lr=&amp;amp;ie=UTF-8&amp;amp;oe=UTF-8&amp;amp;threadm=9982E1F9&lt;BR /&gt;
C001696686C095F8E5D936B2%40in.WebX.maYIadrTaRb&amp;amp;rnum=1&amp;amp;prev=/groups%3Fhl%3Den&lt;BR /&gt;
%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3Doptions%2Bdialog%2Btab%26meta%3Dgro&lt;BR /&gt;
up%253Dautodesk.autocad.customization.vba&lt;BR /&gt;
&lt;BR /&gt;
According to this one, if you want your code to work for more than one&lt;BR /&gt;
version of ACAD (i.e. ACAD 2004, Mech Desktop, etc) you will need to load&lt;BR /&gt;
and use AcadX.arx to get the ProductKey.  You could simplify your code by&lt;BR /&gt;
just hard-wiring in a specific version of ACAD... that would last you until&lt;BR /&gt;
your company upgrades.  Whether this is sat probably depends on how many&lt;BR /&gt;
people are going to be using your program.&lt;BR /&gt;
http://groups.google.com/groups?hl=en&amp;amp;lr=&amp;amp;ie=UTF-8&amp;amp;oe=UTF-8&amp;amp;threadm=E1051672&lt;BR /&gt;
39443452289A1A4CA86AA92B%40in.WebX.maYIadrTaRb&amp;amp;rnum=9&amp;amp;prev=/groups%3Fhl%3Den&lt;BR /&gt;
%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3Doptions%2Bdialog%2Btab%26meta%3Dgro&lt;BR /&gt;
up%253Dautodesk.autocad.customization.vba&lt;BR /&gt;
&lt;BR /&gt;
Here's the Google search these links came from.&lt;BR /&gt;
http://groups.google.com/groups?hl=en&amp;amp;lr=&amp;amp;ie=UTF-8&amp;amp;oe=UTF-8&amp;amp;q=options+dialog&lt;BR /&gt;
+tab&amp;amp;meta=group%3Dautodesk.autocad.customization.vba&lt;BR /&gt;
&lt;BR /&gt;
One slight cautionary note... it's not a good practice to put erroneous info&lt;BR /&gt;
into the Registry, so test your code before you actually make registry&lt;BR /&gt;
changes... i.e. msgbox your variables for key names and values.&lt;BR /&gt;
&lt;BR /&gt;
Good luck, keep us informed....&lt;BR /&gt;
&lt;BR /&gt;
James</description>
      <pubDate>Mon, 17 Mar 2003 14:46:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303158#M65371</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-17T14:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Want "apply" in options using vba.</title>
      <link>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303159#M65372</link>
      <description>Thanks for your reply James.  I found the place in regester using regedit. I can change the "Files" tab to 0. How do I hard-wire this key name?  Or is it more complicated?</description>
      <pubDate>Tue, 18 Mar 2003 13:44:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303159#M65372</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-18T13:44:14Z</dc:date>
    </item>
    <item>
      <title>Want "apply" in options using vba.</title>
      <link>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303160#M65373</link>
      <description>Sorry... I don't have much more time to give to this right now, I'm pretty&lt;BR /&gt;
swamped.&lt;BR /&gt;
&lt;BR /&gt;
Be careful in REGEDIT... don't change Data values that you are unfamiliar&lt;BR /&gt;
with...&lt;BR /&gt;
&lt;BR /&gt;
But here's a link to various ways of using the API to change registry&lt;BR /&gt;
settings.  Maybe other people on this list have code pieces which will&lt;BR /&gt;
*safely* change the value of a single key&lt;BR /&gt;
([HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R15.0\ACAD-103:409\Profiles\&amp;lt;&amp;lt;&lt;BR /&gt;
MCAD&amp;gt;&amp;gt;\Dialogs\OptionsDialog\ActiveTab, of type REG_DWORD] on my computer.&lt;BR /&gt;
I really wouldn't think this should take more than 5 or 10 lines of code,&lt;BR /&gt;
including enough error-checking to make sure you wouldn't corrupt your&lt;BR /&gt;
registry.  (Experts... this isn't a careless statement, is it?)&lt;BR /&gt;
&lt;BR /&gt;
(long link)&lt;BR /&gt;
http://www.planet-source-code.com/vb/scripts/BrowseCategoryOrSearchResults.a&lt;BR /&gt;
sp?lngWId=1&amp;amp;B1=Quick+Search&amp;amp;txtCriteria=registry+api&amp;amp;blnWorldDropDownUsed=TR&lt;BR /&gt;
UE&amp;amp;txtMaxNumberOfEntriesPerPage=100&amp;amp;blnResetAllVariables=TRUE&amp;amp;optSort=Alphab&lt;BR /&gt;
etical&lt;BR /&gt;
&lt;BR /&gt;
I wish I could be of more help right now...&lt;BR /&gt;
&lt;BR /&gt;
James</description>
      <pubDate>Tue, 18 Mar 2003 14:32:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/want-quot-apply-quot-in-options-using-vba/m-p/303160#M65373</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-18T14:32:42Z</dc:date>
    </item>
  </channel>
</rss>

