Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'll start this off by saying that I've worked with C++, C, Java, and
number of UNIX scripting languages but have little or no knowledge o VBA. Working with VBA is somewhat essential to the project I'm workin on at the moment so I came here for help. Just thought I'd present thi so that any reply includes everything, down to the little details tha may seem second nature to someone who has experience with VBA. Thanks and now, onto the question The company I'm working for needs a program that takes output fro their Provantis storage system (which gives the most ass-backwards fil formatting I've ever seen) and put it into an Excel spreadsheet in usable format. I need help with opening and parsing the Word file Anything relevant is welcome, but particularly information on settin delimiters VBA will read between, any functions that get lines o words, and how to then put any of this into a spreadsheet. I know it's a lot (or maybe it's very simple and I just dont kno jack), and my thanks to anyone that take the time to repl -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have you tried selecting the data in Word, copying it to the clipboard, then
going to Excel and select cell A1 on a new sheet and do Edit =Paste. Then select column 1 and do Data = Text to Columns and walk through the wizard? You can turn on the macro recorder in Word while you do this manually to get the word syntax. Then repeat again with the macro recorder turned on in Excel. -- Regards, Tom Ogilvy "Chill1 " wrote in message ... I'll start this off by saying that I've worked with C++, C, Java, and a number of UNIX scripting languages but have little or no knowledge of VBA. Working with VBA is somewhat essential to the project I'm working on at the moment so I came here for help. Just thought I'd present this so that any reply includes everything, down to the little details that may seem second nature to someone who has experience with VBA. Thanks, and now, onto the question The company I'm working for needs a program that takes output from their Provantis storage system (which gives the most ass-backwards file formatting I've ever seen) and put it into an Excel spreadsheet in a usable format. I need help with opening and parsing the Word file. Anything relevant is welcome, but particularly information on setting delimiters VBA will read between, any functions that get lines or words, and how to then put any of this into a spreadsheet. I know it's a lot (or maybe it's very simple and I just dont know jack), and my thanks to anyone that take the time to reply --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Or, you could use regular expressions to parse the horrible Word format.
You can find information on VBA regular expressions he http://msdn.microsoft.com/library/de...ting051099.asp Here is some sample code to get you started: Private Const FILE_PATH As String = "C:\MyDoc.doc" Public Sub ImportWordText() Dim appWord As New Word.Application Dim strAllText As String Dim i As Long With appWord.Documents.Open(FILE_PATH) strAllText = .Range.Text Dim re As New VBScript_RegExp_55.RegExp re.Pattern = "Insert Pattern Here" With re.Execute(strAllText) For i = 0 To .Count - 1 With .Item(idxData).SubMatches For j = 0 To .Count - 1 Debug.Print .Item(j) Next j End With Next idxData End With .Close End With CleanUp: appWord.Quit Set appWord = Nothing End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I thought about using the Macro recorder like that, but the Word file'
format is rather unpredictable so I figured whatever macro I recorde would probably screw up more often than not. Regular expressions... that almost brings a tear to my eye. That wil make some of this much easier. Thanks for pushing me in the righ direction. Now, can anyone answer my question about how to run an exe (wit commandline arguments) from VBA -- Message posted from http://www.ExcelForum.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use the shell command.
-- Regards, Tom Ogilvy "Chill1 " wrote in message ... I thought about using the Macro recorder like that, but the Word file's format is rather unpredictable so I figured whatever macro I recorded would probably screw up more often than not. Regular expressions... that almost brings a tear to my eye. That will make some of this much easier. Thanks for pushing me in the right direction. Now, can anyone answer my question about how to run an exe (with commandline arguments) from VBA? --- Message posted from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How much variability will there be in terms of the code to copy data from
word? -- Regards, Tom Ogilvy "Chill1 " wrote in message ... I thought about using the Macro recorder like that, but the Word file's format is rather unpredictable so I figured whatever macro I recorded would probably screw up more often than not. Regular expressions... that almost brings a tear to my eye. That will make some of this much easier. Thanks for pushing me in the right direction. Now, can anyone answer my question about how to run an exe (with commandline arguments) from VBA? --- Message posted from http://www.ExcelForum.com/ |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not sure I understand the question.
I'm writing it all myself and can do it whatever way gets it done -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
change excel document into word document | Excel Discussion (Misc queries) | |||
convert excel document to word document (not a picture) | Excel Discussion (Misc queries) | |||
How to change a excel document into a word document? | Excel Discussion (Misc queries) | |||
Can you transform an excel document into a word document? | Excel Discussion (Misc queries) | |||
How do I convert Word document into an Excel document? | Excel Discussion (Misc queries) |