473,378 Members | 1,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

word vba

rcollins
234 100+
I have made a form on my website that emails me when submitted. I want to turn this into a readable format for HR. as now, I have:
date:1/17/2007
position:any
last:blow
first:joe
What is the best way for me to do this, xml, import to form? any help would be great. Thanks
Jan 8 '07 #1
11 1985
nico5038
3,080 Expert 2GB
I assume you want to import this into a table.
Access will allow you to create a linked table to an outlook folder.
The problem hoever will be the fact that the data is in multiple rows.
Having a format:
Data,: 01-01-2007, Joe, Blow
Would allow to use the Split() function to get the pieces and drop that into a table.
Multiple rows complicate this.

Nic;o)
Jan 8 '07 #2
NeoPa
32,556 Expert Mod 16PB
I have made a form on my website that emails me when submitted. I want to turn this into a readable format for HR. as now, I have:
date:1/17/2007
position:any
last:blow
first:joe
What is the best way for me to do this, xml, import to form? any help would be great. Thanks
I can't see how Access or Word come into this.
Would this not be about the capabilities of the server side script engine (of which I sadly know v little)? VB Script or Java?
I may be on the wrong lines completely - I'm afraid the question itself isn't very clear. If I'm wrong then please ignore me, otherwise I would think that posting in the Java forum might help. If you're using VB Script then they may have some expertise in there for that too.
They may be able to tell you what is the simplest format to attach it to the e-mail with. It may be that it's MS Word I suppose - if libraries are available from there. I don't know.
Jan 8 '07 #3
rcollins
234 100+
these fields actually come in on seperate lines. I never thought about bringing it into Access. I could build a simple database for HR to use so they can import and make a report to our liking. I will look into the Split function
Jan 10 '07 #4
nico5038
3,080 Expert 2GB
The split will fill an array, use:

dim arr
dim arr2

arr = split(messagebody,vbCRLF)
This will give an array containing all lines.
With:
Expand|Select|Wrap|Line Numbers
  1. for intI = 0 to Ubound(arr)
  2.     if left(arr(intI),5) = "Data:" then
  3.       arr2 =split(arr(intI),",")
  4.       ' here process arr2(1) (being the first field when you have "Data:," as start
  5.     endif
  6. next intI
Nic;o)
Jan 10 '07 #5
rcollins
234 100+
Is there a way I can import this info into a table that would be workable?
Jan 22 '07 #6
nico5038
3,080 Expert 2GB
Yes, just link a table to the Outlook folder. (Chose the link table option when opening a new table and navigate to the folder)
Show this table in a datasheet subform and add a button to process the current record like:

Expand|Select|Wrap|Line Numbers
  1. dim arrLine
  2. dim intI as Integer
  3. dim rs as dao.recordset
  4.  
  5. set rs = currentdb.openrecordset("your table")
  6. arrLine = split(me.subformname.form.body,chr(13) & chr(10))
  7.  
  8. rs.addnew
  9. for intI = 1 to ubound(arrLine)
  10.     select case left(arrSplit(intI),INSTR(arrLine,":"))
  11.      case "Date:"
  12.       rs!DateIn =  mid(arrSplit(intI),INSTR(arrLine,":")+1)
  13.      case "Name:"
  14.       rs!DateIn =  mid(arrSplit(intI),INSTR(arrLine,":")+1)
  15.     end select
  16. next
  17. rs.update
That's the drill for one row per message.

Nic;o)
Jan 22 '07 #7
rcollins
234 100+
What about multiple row? All my stuff comes in on individual lines.
Expand|Select|Wrap|Line Numbers
  1. date:    01/22/2007
  2. position:    Any
  3. last:    Doe
  4. first:    John
  5. middle:    
  6. former:    
  7. street:    123 anywhere
  8. city:    nowhere
  9. state:CO
Jan 22 '07 #8
rcollins
234 100+
So I have modified the code to fit , here is the error I get "Object doesn't support this property or method"
Table is Applications
form is Applications
Subform is Applications subform
Expand|Select|Wrap|Line Numbers
  1. Dim arrLine
  2.  
  3. Dim arrSplit
  4. Dim intI As Integer
  5. Dim rs As dao.Recordset
  6.  
  7. Set rs = CurrentDb.OpenRecordset("Applications")
  8.  
  9. arrLine = Split(Me.Applications_subform.Form.Application, Chr(13) & Chr(10))
  10. rs.AddNew
  11. For intI = 1 To UBound(arrLine)
  12.     Select Case Left(arrSplit(intI), InStr(arrLine, ":"))
  13.      Case "Date:"
  14.       rs!DateIn = Mid(arrSplit(intI), InStr(arrLine, ":") + 1)
  15.      Case "Name:"
  16.       rs!DateIn = Mid(arrSplit(intI), InStr(arrLine, ":") + 1)
  17.     End Select
  18. Next
  19. rs.Update
Jan 22 '07 #9
nico5038
3,080 Expert 2GB
Try:

Expand|Select|Wrap|Line Numbers
  1. Dim arrLine
  2. Dim intI As Integer
  3. Dim rs As dao.Recordset
  4.  
  5. Set rs = CurrentDb.OpenRecordset("Applications")
  6.  
  7. arrLine = Split(Me.Applications_subform.Form.Application, Chr(13) & Chr(10))
  8. rs.AddNew
  9. For intI = 1 To UBound(arrLine)
  10.     Select Case Left(arrLine(intI), InStr(arrLine, ":"))
  11.      Case "Date:"
  12.       rs!DateIn = Mid(arrLine(intI), InStr(arrLine, ":") + 1)
  13.      Case "Name:"
  14.       rs!DateIn = Mid(arrLine(intI), InStr(arrLine, ":") + 1)
  15. ' add here the other fields you need to fill in the table
  16.     End Select
  17. Next
  18. rs.Update
  19.  
Would be better to use:
frmApplication
tblApplication
sfrmApplication
etc. to make the code easier to check.

Nic;o)
Jan 22 '07 #10
rcollins
234 100+
I got them named right. Your code had no error thistime. Now, for the other part. In the table, there is a field 'Contents". I am assuming this is where all of the message would go if it was one line message. What about the multiple line?
Jan 22 '07 #11
nico5038
3,080 Expert 2GB
The Contents should hold all lines, thus the Split looking for the different lines.
Just check the linked outlook table by making the row heigher or create a form with large textboxes to see multiple lines appear.

Nic;o)
Jan 22 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
3
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone...
2
by: Mikey | last post by:
Sample VB .NET source code to create mailing labels or customized letters using MS Word MailMerge This VB .NET source code will start MS Word and call methods and set properties in MS Word to...
7
by: Dave | last post by:
Apologies for the newbie question. I have created a vb.net program for my company that is designed to work with Word Templates (about forty of them that we commonly use) that are selected by the...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
1
by: beanie | last post by:
i am a c programming beginner and i am trying to Create a concordance of Word Count for a text File in c programming but my code isn't working.please can u help me out.here is my code: #include...
2
by: beanie | last post by:
i am a beginer in c programming and i am trying to Create a Concordance of Word Count for a Text File but my code is not working.pls can anyone helpme out.here is my code: #include <stdio.h>...
0
by: alivip | last post by:
I write code to get most frequent words in the file I won't to implement bigram probability by modifying the code to do the following: How can I get every Token (word) and ...
5
by: alivip | last post by:
How can I get every Token (word) and PreviousToken(Previous word) From multube files and frequency of each two word my code is trying to get all single word and double word (every Token (word) and...
1
by: dittytwo | last post by:
Hi there The below code works if you don't try to do anything to the word document which is great (Not :D) I am having problems with the context command both text (i.e initial document with no...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.