
myteam
Members-
Posts
15 -
Joined
-
Last visited
Everything posted by myteam
-
Open Outlook Custom Form (OFT) and read
myteam replied to myteam's topic in AutoIt General Help and Support
@error trick work!! Thank you very much Water!! I'm planning to do next automation project later using excel as the source after finish fixing up all the bug in my script. Hope you will be there!! Autoit is awesome!!! p/s: You maybe not Outlook Guru but you are Master! -
Open Outlook Custom Form (OFT) and read
myteam replied to myteam's topic in AutoIt General Help and Support
$oControl = $oNewItem.GetInspector.ModifiedFormPages("Message").Controls("Label28") Nope, it not working since the program will crash in this line because it point to non-existence control. By the way, I seem to have problem with stringsplit. If the code is like this: $aMail = StringSplit("water@google.com;myteam@yahoo.com",";") I can have the result to show = water@google.com But, sometimes there is only 1 email without the ";". That's when my script crash. Example: $aMail = StringSplit("water@google.com",";") = CRASH How can I check if the email contain ";"? Do I need to use Autoit error handling just like checking the label? p/s: I feel bad using error handling to make my buggy script work -
Open Outlook Custom Form (OFT) and read
myteam replied to myteam's topic in AutoIt General Help and Support
It work great!!! Thank you very much for your kind guidance. -
Open Outlook Custom Form (OFT) and read
myteam replied to myteam's topic in AutoIt General Help and Support
I think I need to use loop + autoit error handling for this thing. But don't understand the example in help file nor in outlook udf to code them. -
Open Outlook Custom Form (OFT) and read
myteam replied to myteam's topic in AutoIt General Help and Support
WOW!!! you really are something!! It work!! Now need to figure out how to check whether the address is label or textbox and execute the command depend on the type. Then skip the "State: " and only capture the value after that which the character can increase depend on the address. (I think I will go with StringStripWS + StringSplit , ":") Really need to know how to check whether the textbox/label exist in the form. i think it something like this I try with this code but got error since "= Nothing" is wrong syntax for Autoit $Findlabel = $oNewItem.GetInspector.ModifiedFormPages("Message").Controls("Label5") If NOT $Findlabel = Nothing Then MsgBox(0, "", "Got Label!") Else MsgBox(0, "", "No Label!") Endif -
Open Outlook Custom Form (OFT) and read
myteam replied to myteam's topic in AutoIt General Help and Support
Sorry I cannot make the form publicly because of company policies. Please check your inbox.. Hope you can come with some idea to read the address. -
Open Outlook Custom Form (OFT) and read
myteam replied to myteam's topic in AutoIt General Help and Support
Error: The requested action with this object has failed. I ready hope someone can help me read the label in outlook. Search in google usually return result about changing label instead of reading it... I try with this code also get same error $sDistDistAddress1 = $oNewItem.Controls.items("Label28") -
Open Outlook Custom Form (OFT) and read
myteam replied to myteam's topic in AutoIt General Help and Support
Thanks for the idea. Another help needed, I have no problem to read address in the form that have textbox. However, sometimes the form use label (caption) to show the address. The problem is: - cannot highlight the label (cannot copy) - The data is in property: caption. - There is no value to point to. (label don't have property name) How can I read the label? I try with $sDistAddress1 = $oNewItem.Label28.caption But get an error since the OFT form is read only. Just to make thing clear, I want to read this data from the label (Circled) -
Open Outlook Custom Form (OFT) and read
myteam replied to myteam's topic in AutoIt General Help and Support
$oIE = _IEAttach ("Link Contact") $oIEContactPerson = _IEGetObjByName($oIE, "LASTNAME1") $oIEClearDistPhone1 = _IEGetObjByName($oIE, "PHONE") $oIEClearDistPhone2 = _IEGetObjByName($oIE, "HOME_PHONE") $oIEClearDistEmail = _IEGetObjByName($oIE, "EMAIL") _IEFormElementSetValue($oIEContactPerson, $sClearDistContactPerson) _IEFormElementSetValue($oIEClearDistPhone1, $sClearDistPhone1) _IEFormElementSetValue($oIEClearDistPhone2, $sClearDistPhone2) _IEFormElementSetValue($oIEClearDistEmail, $sClearDistEmail) It Work!!! Really! Thank You again for advice me !!! One more question, Can give me some idea how to code this? ex: water@google.com;myteam@yahoo.com I just want the output just take the first mail "water@google.com", of course the number of character can be increase depend on the email name. -
Open Outlook Custom Form (OFT) and read
myteam replied to myteam's topic in AutoIt General Help and Support
It work!!! thanks again!! Now need to study how to transfer the value to the IE form. Can give me some reference for example? -
Open Outlook Custom Form (OFT) and read
myteam replied to myteam's topic in AutoIt General Help and Support
Not working Keep getting Error: Object reference outside a "With" statement. Edited: Yeah! Its working!!!! my mistake is wrong properties name xD Thanks you very much! Can give me some idea how to code this? Ex1: CU-0JP208-21833-943-01W8 and the output just "JP208" (take only the fifth number to number 8 and removing others - of course the number of the serial is random but will have same format just like this) Ex2: #I love you water# and the output would be just "I love you water" without the # (actually I want to remove leading and trailing space) (It look like StringStripWS can do the trick) -
Open Outlook Custom Form (OFT) and read
myteam replied to myteam's topic in AutoIt General Help and Support
Your code had working only for normal properties such as cc, subject, to How I want to retieve data from custom properties? such as Textbox1? I try with this code but cannot capture the data. $sSolution = $oNewItem.UserProperties("TextBox17") msgbox(0,"","Solution: " & $sSolution -
Open Outlook Custom Form (OFT) and read
myteam replied to myteam's topic in AutoIt General Help and Support
#Include <HotKey.au3> Global Const $VK_ESCAPE = 0x1B Global Const $VK_F1 = 0x70 ; Assign "F1" switch to Outlook _HotKeyAssign($VK_F1, 'win1') Func win1() IF WinExists("Outlook Today - Microsoft Outlook") Then IF NOT WinActive("Outlook Today - Microsoft Outlook") Then WinActivate("Outlook Today - Microsoft Outlook") $oOutlook = ObjCreate("Outlook.Application") $oNewItem = $oOutlook.CreateItemFromTemplate("c:\test.oft") $oNewItem.Display else $oOutlook = ObjCreate("Outlook.Application") $oNewItem = $oOutlook.CreateItemFromTemplate("c:\test.oft") $oNewItem.Display EndIf Else MsgBox(0, "", "No Outlook program Opened!") EndIf EndFunc ; Assign "CTRL-ESC" with Quit() _HotKeyAssign(BitOR($CK_CONTROL, $VK_ESCAPE), 'Quit') While 1 Sleep(10) WEnd Func Quit() Exit EndFunc ;==>Quit Thank you so much! It work! Now I need to study how to access them using COM. -
Open Outlook Custom Form (OFT) and read
myteam replied to myteam's topic in AutoIt General Help and Support
I already see that, in fact I already search outlook and see all the 40 page result for 3 days. All the code are more toward mail and not custom form. So it's kinda give me problem to use it in my script. Need a better example to navigate and copy in Custom Form as well as converting the Open OFT VBA script. -
I'm totally newbie with Autoit and still trying to learn how Autoit can help me to automate some of my work. Here is what I'm trying to do: - The oft files is always on desktop, only 1 oft files with random names - Display Outlook custom form (OFT) (Outlook Form Template) in Outlook 2007 - Read data in the form (Name, Address, etc) - Paste the data in other program specific text box (Name, Address, etc) What I achieve so far: - Assign Hotkey to execute the command - Check if the outlook already open, and active - Open the oft Here some of my progress: #Include <HotKey.au3> Global Const $VK_ESCAPE = 0x1B Global Const $VK_F1 = 0x70 ; Assign "F1" switch to Open OFT in outlook _HotKeyAssign($VK_F1, 'OpenOFT') Func OpenOFT() IF WinExists("Microsoft Outlook") Then IF NOT WinActive("Microsoft Outlook") Then WinActivate("Microsoft Outlook") send ("{ALT}fno{DOWN 7}{Enter}") else send ("{ALT}fno{DOWN 7}{Enter}") EndIf Else MsgBox(0, "", "No Outlook Program Opened!") EndIf EndFunc ; Assign "CTRL-ESC" with Quit() _HotKeyAssign(BitOR($CK_CONTROL, $VK_ESCAPE), 'Quit') While 1 Sleep(10) WEnd Func Quit() Exit EndFunc ;==>Quit After searching the internet, I found more reliable way to open the OFT using VBA: Sub MakeItem() Set newItem = Application.CreateItemFromTemplate("c:\your path\open test.oft") newItem.Display Set newItem = Nothing End Sub But I don't know how to convert this to Autoit and how to read the OFT data. - Should I send {TAB} to get to the input box and send ^c ? - Send command to save the data in notepad and calling it back to paste in my other program by lines? Any help would be appreciate.