CATIA Macro Scripting - Expand Single Tree Node - vba

Is it possible to expand a single node in the tree all levels, using macro code. I see that you can expand all nodes, but I don't want to do that. Also, I see you can expand selected, but I don't want the user to have to make a choice, additionally I can't even get this StartCommand working properly. Just wondering if it's possible to expand a single node using only macro code, and if so, HOW? I'm using V5 R22.
The node has been selected already, Here is my code using SendKeys...
CATIA.StartCommand ("Expand Selection")
AppActivate "CATIA V5"
SendKeys "{UP}"
SendKeys "{TAB}"
SendKeys "{ENTER}"
This has no effect on the Expand Selection dialog

Related

AppActivate Restore Active Window App in VBA

I'm trying to restore a minimize active window app after using AppActivate by using SendKeys, however the option did popup but it didn't click the "Restore".
I believe this can be done by using Windows API, but to be honest, I don't know anything about that, so hopefully someone can help this problem so that I can use in VBA.
Below code is the example, New Folder currently minimize and I want to Restore(Open) and then screenshot.
Thanks!
AppActivate ("New Folder"), True
Application.SendKeys "(% )(R)"
Application.SendKeys "(%{1068})"

Create a custom information window in Word VBA

Is it possible to somehow have way for the Selection.Style (and possibly other info) to always show up in a custom information window similar to the way Debug.Print prints in the immediate windows but ALWAYS visible?
I find myself struggling to quickly check a Selection.Style. MsgBox requires clicking "OK".
I have used the "Reveal Formatting" window but I would like more control over how the information displays.
Is this possible?
At least for knowing the Style at the current selection point, you don't need a custom user form. Place the StyleGalleryClassic control on the QAT or a Ribbon tab.

Press/simulate keyboard keys in access vba

I am automating a process in my office, and saving a pdf file is part of it. So how can I save it? I need to press Ctr+Shift+s ..
I see solutions here but its in java. Looking for anyone who can share ways on how to simulate this. Also tried SendKeys but I can't pull Ctr and Shift.
SendKeys "S"
SendKeys "{TAB}"
this types "S", tab, well its tabs to the next control. But {CONTROL} , {SHIFT} does not work.
Is this possible? Or are there other ways to do this?
The keyboard modifiers have a special syntax, see the documentation.
Ctrl + Shift + s = SendKeys "^+s"

Simulate a click in the ribbon toolbar of visio by using vba

I'm looking for a way to simulate a click on a button (Synchronize All) from an addin (http://visguy.com/vgforum/index.php?topic=6086.msg24731#msg24731) in the ribbon toolbar of Visio within VBA-Code.
Please look at this picture for understanding: http://img4.picload.org/image/cpcgidr/ribbon.png
A pragmatic approach of mine was to use the "sendkeys"-function, because it's easy and sufficient. The problem with this approach is, i cannot navigate to the main-button (marked as 3. in the picture) by using the shortcuts "ALT+V" and "B" via sendkeys, i'm only able to navigate to the "conflicts panel" button as a subitem of "Synchronize All" (marked as 2. in the picture).
Does somebody have an idea how to click on the main-button (marked as 3. in the picture) via sendkeys or in a different way?
I'm just use this:
SendKeys "%v", True
SendKeys "b", True
SendKeys "{ENTER}", True
Please help me out with this, i've googled a lot without any results...
Best regards
Joerg
The author of that tool has implemented that trigger into that programm an has recompiled it, as you can see here: http://unmanagedvisio.com/products/backsync-backward-visio-data-synchronization/

SendKeys to click on a dialog box button in Access

I am using Access 2013. I searched a variety of online resources. I thought SendKeys was the answer.
Once per quarter, my client will receive an updated Access database. All table names should be identical each quarter. I want them to run a macro, specify the location of the new file, and then the macro updates the linked tables and executes all other queries I’ve built (I have the last part working).
The part I have not be able to get working is to check the “Always prompt for a new location box”, check the “select all” box and click OK (and then click OK and close after the client specifies the new file location). Below is the code I am using.
Function Open_LinkedTableManager()
DoCmd.RunCommand acCmdLinkedTableManager 'this step works fine
'the following lines, up until Application.Run don’t appear to be
'doing anything. The code will run, but I have to manually execute
'each of the steps I am trying to automate before it gets to the
'Application.Run step
SendKeys "%a", True ' also tried SendKeys "%(a)" and "+a", "a", etc,
'True; Alt+a checks the "Always prompt for a new location box”
SendKeys "%s", True ' also tried SendKeys "%(s)", True; Alt+s checks the "select all" 'box
SendKeys "{Enter}" ' then user specifies location of new file
SendKeys "{Enter}" ' click OK after receiving message "All selected linked tables 'were successfully refreshed"
' click Close to close linked table manager and proceed to the next step below (not 'sure how to do this)
Application.Run ("Update_all_queries") ' this is working;
End Sub
If sending to yourself then try DoEvents after each sendkey.
DoEvents Function
Yields execution so that the operating system can process other events.
Syntax
DoEvents( )
Remarks
The DoEvents function returns an Integer representing the number of open forms in stand-alone versions of Visual Basic, such as Visual Basic, Professional Edition. DoEvents returns zero in all other applications.
DoEvents passes control to the operating system. Control is returned after the operating system has finished processing the events in its queue and all keys in the SendKeys queue have been sent.
DoEvents is most useful for simple things like allowing a user to cancel a process after it has started, for example a search for a file. For long-running processes, yielding the processor is better accomplished by using a Timer or delegating the task to an ActiveX EXE component.. In the latter case, the task can continue completely independent of your application, and the operating system takes case of multitasking and time slicing.
Caution Any time you temporarily yield the processor within an event procedure, make sure the procedure is not executed again from a different part of your code before the first call returns; this could cause unpredictable results. In addition, do not use DoEvents if other applications could possibly interact with your procedure in unforeseen ways during the time you have yielded control.
I have solved your dilemma. All I needed to do was place the sendkey statements before the call to to the linked tabled manager. See Below - Worked Great For Me! I was also able to add all of the commands in your order and they worked great. Good luck, hope this helped. Let me know. Adam
PS: If you have many tables to change the path on, this will be painful for the user for every table you are forcing them to have to set the path for.
SendKeys "%s", 1
DoCmd.RunCommand acCmdLinkedTableManager