Stock to watch: DIGI (Buy on weakness)
DIGI: Temporary base near RM3.50 levels
Following the listing of its subdivided 7.775bon shares of RM0.01 each on 24 November, DIGI prices retreated from as high as RM3.88 on 23 November to close at intraday low of RM3.54 on 25 November.
The correction from its RM3.88 high nearly reached the 38.2% FR level (RM3.50) and we think a temporary base has been formed. If prices can continue to consolidate from here, there is a good chance that DIGI may reclaim the RM3.65 (23.6% FR) and RM3.75 (upper Bollinger band) and possibly even RM3.88.
Technical indicators are still showing more weaknesses ahead but traders with higher risk appetite may BUY on weakness before stronger rebound set in.
However, cut loss if the RM3.40 level (near the 50% FR) is breached. Once this level is violated, the bears will send prices lower towards RM3.31 (30-d SMA) and RM3.27 (61.8% FR).
Daily DIGI Shows Critical Support Near Mid Bollinger Band To Prevent Further Slump
Source: HLIB Research
Processing The Order
To process the orders, we’re going to open all the emails that are in the Orders Folder in Outlook. We will then read the text in the body of the e-mail. First though we need to instantiate Outlook and the two Outlook folders that we will be processing.
Set dbs = CurrentDb
Set myolApp = CreateObject("Outlook.Application")
Set myNameSpace = myolApp.GetNamespace("MAPI")
Set myfolder = myNameSpace.Folders( _
"Personal Folders").Folders(OrdersInFolder)
Set myNewfolder = myNameSpace.Folders( _
"Personal Folders").Folders(OrdersDoneFolder)
Now we work through those Order e-mails and process them one at a time. We also need to open the table where we store the new customer’s order details.
iMax = myfolder.Items.Count
If iMax = 0 Then
MsgBox "Unfortunately there are no orders"
Else
Set rstSoftOrders = dbs.OpenRecordset( _
"SoftwareOrders", DB_OPEN_DYNASET)
For iOrd = 1 To iMax
As we have to move the email message after it is processed, we always refer to item one in the order folder list. This works because the items list is amended after the Outlook Items move method.
Set myItem = myfolder.Items(1)
Now we need to save the text of the order e-mail to a string variable called EmailContents. Outlook provides this through the Items property Body. If you look at figure one, you will find the water is broken into lines with the subject followed by a colon and a number of spaces. As these are always the same in every e-mail, we pass the body text to a function that extracts all the remaining text after the subject and the spaces. We explain this routine later on.
emailContents = myItem.Body
UserName = ExtractToCR_FX(emailContents, "First Name: ") & " " & _
ExtractToCR_FX(emailContents, "Last Name: ")
ProductPurchased = ExtractToCR_FX(emailContents, "Product Name: ") & " " & _
ExtractToCR_FX(emailContents, "Total: ")
")
Now we ask the user of the software if they wish to proceed with the order. We then extract all the other fields in the e-mail body that we are going to store in access. A portion of this code is shown below.
postIt = MsgBox(UserName & ":
" & ProductPurchased, vbYesNoCancel, "Post The Following")
If postIt = vbYes Then
On Error Resume Next
rstSoftOrders.AddNew ' Create new record.
rstSoftOrders("UserID") = ExtractToCR_FX(emailContents, "User ID: ")
rstSoftOrders("FirstName") = ExtractToCR_FX(emailContents, "First Name: ")
rstSoftOrders("LastName") = ExtractToCR_FX(emailContents, "Last Name: ")
rstSoftOrders("Address1") = ExtractToCR_FX(emailContents, "Address1: ")
rstSoftOrders("Address2") = ExtractToCR_FX(emailContents, "Address2: ")
rstSoftOrders("City") = ExtractToCR_FX(emailContents, "City: ")
rstSoftOrders("State") = ExtractToCR_FX(emailContents, "State/Province: ")
' Etc ete etc for all the fields in the order email
Finally as the customer can order different items with different prices you will need to produce the emails that are based on the order. This will differ with every system. Tot send the email, we have used the older send object method to illustrate the other way to generate e-mail from Microsoft Access.
On Error GoTo
getOrdersDetails_error
rstSoftOrders.Update ' Save changes.
On Error Resume Next
If ProductPurchased = PRODUCT1FOREMAIL Then
' User has purchased the Toolbox
DoCmd.SendObject acSendNoObject, , acFormatTXT, UserEmail, , , ProductPurchased
& " from GR-FX", _
"Greetings " & UserName & "," & vbCrLf & vbCrLf &
TextFileToString_FX(GetDBPath_FX & "vb123 News.txt")
End If
Finally remove the Outlook e-mail item that we’re processing to the orders processed folder . It is safer to do this in code than to manually move the email using drag and drop. We can now process the next order.
myItem.Move myNewfolder
MsgBox "Our Order for " & UserName & " " & ProductPurchased & " .. " & UserEmail
& " >> has been moved to " & myNewfolder.Name
In addition to storing the order in a table, we add the user’s e-mail address and name to separate table so that they can receive emails about things that relate to their purchase.
DoCmd.RunSQL "insert into " & tipsList & _
" values ('" & UserName & "','" & UserEmail & "')"
Processing The Email Body
One important part of this software is the function that returns data from the e-mail body for a particular line of text in that e-mail. This line is found by identifying a string constant. All text after that constant to the next carriage return is returned by the function
For an example of how this works, look at Figure 1 which will become a very long text string produced from the Body of the email. To extract the text for the Author ID, we would write the following
MyTextStr = ExtractToCR_FX(webstring, "Author ID: ")
This will return “9999999” into the MyTextStr variable.
The code for this function is as follows
Public Function ExtractToCR_FX(textLine As Variant, _
FormItemReq As String) As String
Dim StartLine As Variant, EndLine As Variant
dim ExtractText As Variant
StartLine = InStr(textLine, FormItemReq)
If StartLine > 0 Then
StartLine = StartLine + Len(FormItemReq)
EndLine = InStr(StartLine, textLine, Chr(13))
ExtractText = Mid(textLine, StartLine, _
EndLine - StartLine)
End If
If Len(ExtractText) = 0 Then
ExtractText = " "
End If
ExtractToCR_FX = ExtractText
End Function
NOTE: In the download database, the above function is expanded to cope with the duplicated field identifiers in the Shipping section of the Regnow order email.
Summing Up
Using Microsoft Access and Outlook together can reduce manual processing of Ordering emails very substantially. I know this because sometimes it would take up to 15 minutes to undertake all the little steps of saving customer details into tables and newsletter lists. Also without software, it was very difficult to explain to other staff members what to do when an e-mail arrived. Now we can process the orders in a couple of minutes when Outlook email arrives in the correct folder. As an added bonus, I can now demonstrate to our clients that we can program the very popular Microsoft Outlook.
Author Bio.
Garry Robinson is the founder of GR-FX Pty Limited, a company based in Sydney,
Australia. If you want to keep up to date with the his latest postings on Access
Issues, visit his companies web site at http://www.vb123.com/. The web site
features Access Source Code tools and resources.. When Garry is not sitting at
a keyboard, he can be found viewing the Outlook from one of Sydney’s seaside
cafes. Contact details …
Click Here
+61 2 9340 7789
By Garry Robinson
Other Pages at VB123.com You Might Like To Read
Stop Those Annoying Outlook Warning Messages
Automate Your Email Using
Access and Exchange/Outlook
Taking Outlook and XML to
Task in MS Access
Remote Queries In
Microsoft Access
Pages Outside VB123.com
Send Email Without A Security Warning in Outlook
Downloads
Click here for the Regnow download file if you own a Feb-2003 version of "The Toolshed" or greater Else click here
Click here for the Digibuy download file if you own "The Toolshed"
Click on the following button to jump to the next page in the document loop.
Keywords: Regnow Fields Supported in Download databaseTransaction Identification, Date, RegNow OrderID, Gift Information, Gift, Pickup, Product Information, Item #, Product Name, Quantity, Tax, Total, Purchaser Information, User ID, Email Address, Shipping Info , First Name, Last Name, Company, Address1, Address2, City, State/Province, Zip/Postal Code, Country, Phone, Email, Referrer, Custom Referrer, Link Location,
- Buy Electronic Drum Set
Electronic Drum Set Sale Electronic Drum Set Deal Electronic Drum Set Sales Electronic Drum Set Deals Cheap Electronic Drum Set on Sale 2011 Cheap Electronic Drum ...
- Buypin
- Buy Taser Gun
- Beach Buying Front Property
- Felt Fabric Buy