How to jump to a tab using VBA code - dynamics-sl

I'm using VBA code to enter a SiteID on the Purchase Order Maintenance screen while I'm in the Line Items tab. Unfortunately, it jumps to the shipping information tab when I do this. What is the vba code to refocus the Line Items tab?

I guess no one monitors questions for Dynamics SL. I figured it out myself:
I Used the ApplSetFocus command to set the focus to a control on the tab I want to switch to.

Related

Export Qlikview report to Excel

I have created a Qlikview report that I would like to export to a Excel spreadsheet. The report has 8 sheets/tabs and navigation functionality on all. After some research I found that I need to create a button on the report that executes a macro.
Having the limited experience in Qlikview as I do, I was only able to go as far as to create the button.
Could anyone please point me in the right direction or better yet, provide me with a macro.
You need to set an action on the button and select external - run macro.
In the macro name field you type the name of your macro function/subroutine (in this case "MacroTest").
By pressing "Edit module..." you can access the macro edit mode (or by pressing Ctrl + M)
sub MacroTest
msgbox("macro")
end sub
Press the button and a message box will appear.
Regarding excel exports there are a lot of working examples you can find by google.
Good luck
//Micke

Save Outlook Email as text file, and then run a script on it?

I'm using Outlook 2007. I have no experience with Windows programming or VBA, as all of my background is on Unix systems. I am attempting to have Outlook save each incoming emails as text file, and then a run a python script which will parse this text file.
I found this question which seems to provide some VBA code to accomplish the first task, but I'm not sure how to utilize it. I open the Visual Basic Editor, but have no idea how to proceed from there. I tried saving the text as a module, but when I attempt add "run a script" in an Outlook rule, no scripts are available. What am I doing wrong?
EDIT: Clarification.
I'm assuming you're familiar with coding at some level, even if not on Windows. You may want to do some general background reading on Outlook VBA; some resources on this would be a Microsoft article, this article from OutlookCode, and so on - there's a ton of resources out there with walkthroughs and examples.
Addressing your specific question: take a look at this Microsoft KB article, which describes how to trigger a script from a rule.
The key to getting started once you've gotten your VBA editor open is to double-click a module on the left, for example ThisOutlookSession (under 'Microsoft Outlook Objects').
That should give you an editor you can paste code into. Bear in mind that (per the above MS page) your procedure must accept a MailItem object, which will be the item that the rule has in hand, so the linked example you gave would have the first couple of lines changed from:
Sub SaveEmail()
Dim msg As Outlook.MailItem
' assume an email is selected
Set msg = ActiveExplorer.Selection.Item(1)
' save as text
[...]
...to:
Sub SaveEmail(msg As Outlook.MailItem)
' save as text
[...]
Essentially you're being handed a MailItem rather than having to create it and connect it to the selected item in Outlook.
To achieve the second task of 'running a script' on the file, I'm assuming that you want your VBA to make changes to the file after it's been saved? This is pretty straightforward in VBA, and you'll find lots of examples for it. One pretty simple outline is in this answer.
Edit based on comments: to launch an external tool, you can use either the Shell command if you don't need to wait for it to complete, or you can use one of the many Shell-and-wait implementations floating around, for example this popular one. Or, you can use the WScript approach in this answer.
Note that you'll need to ensure Outlook is set to allow macros to run, and you will probably want to sign your code.

Dialog Box Using VB Script

Hello I have some knowledge about VB Script, but i need some help so that it will help me to move further and study in VB Script.
I want to make dialog box which will contain :
Two radio button
one Text field to enter some value
OK and CANCEL button
so, could you please help me out?
VBScript doesn't support custom dialogs. You can either use the Internet Explorer COM object to emulate a dialog, or create an HTA. Either way you're building a web page with a form.

Switching Internet Explorer Windows with VBA

I have been working on an Excel macro to automate an Internet Explorer process at work. I'm incredibly close to figuring everything out, but at the end, the macro clicks on a "Download Report" button, which launches a new window. I need to initiate a few things on this new window but I cannot figure out how to change the focus of the macro to the new window. I have found a few things online, but they have been unsuccessful. I know there are ways to toggle between browser windows by telling Excel to look for the name of the browser window, and to activate it, but parts of the name of the new window are constantly changing (it's a unique URL for that particular window).
I was wondering if there might be a way to have the Macro look for just the first Nine letters of the window and switch to that window? Similar to the LEFT function in excel? The reason being is that the first 9 characters of the URL never change. The name of the original window (the one I'm trying to switch from) never changes, so maybe I could tell Excel to look for the the Browser Window that is NOT named the original one? Or any other ideas?
Thanks in advance for any help
Is the VBA AppActivate command what you are looking for?
You will need to add the references to the Internet Controls and shell. You just need to loop through the IE windows and look at the left hand side of the url. See below
Function GetInternetWindow(urlToLookFor as String) As InternetExplorer
Dim winShell As Shell
Dim ie As InternetExplorer
Set winShell = New Shell
'loop through the windows and look at the urls
For Each ie In winShell.Windows
If Left(ie.LocationURL, 9) = urlToLookFor Then
GetInternetWindow = ie
Exit For
End If
Next
End Function

How to use AutoIt to click a window dialog in a different language

On Windows 7, when we install an unsigned driver, it will pop-up a Windows security dialog. It is easy to have it be clicked on by AutoIt. Just search the window dialog with the specified window title.
But now, I want to use it on another platform with a different language. The window title will be changed to the local language, not the 'Windows security'.
How can I create the AutoIt script, which can handle the Windows security dialog in different language?
Fix this issue by finding a child handle from the security window class.
Try to use a class on Tittle. Title = [CLASS:notepad]
for more information visit here http://autoitsourcecode.blogspot.com/2013/04/autoit-control-send.html
Use the "AutoIt v3 Window Information" Tool provided by the "AutoIt full installation" and try to get some unique information like a Class name which is occuring in each different language dialog window as descirbed in advanced window descriptions. Then use these to search for the proper security window.
I'd suggest, you use the WinWaitActive("[REGEXPTITLE:Windows Security|Windows Sicherheit]") function with regular expressions for being able to wait for multiple windows with different titles.

Resources