RE: Change documents in word with VBA

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Jay, Thanks for the response. It helped some but I need to expand on my
problem.
The info I need to put in a seprate file is not exactly the same info that
is in the table on the cover page. The code below takes data from a listbox
that is created earlier in the program and depending if if it is selected or
not puts it into the table on the cover sheet. I need to keep this code so
I can still create the cover page and also create code that will put ALL the
data (not just selected) from the list box into a table in a new documentand
save it. It maybe possible to do it all in one procedure but that is over my
head at this point.
Thanks again,


Dim intSelectedRows As Integer

' Dim intColumnIndex As Integer
'
'
' intSelectedRows = 0
' intCounter = 0
' Do Until intCounter = ListBox1.ListCount
' If ListBox1.Selected(intCounter) = True Then
' intSelectedRows = intSelectedRows + 1
' End If
' intCounter = intCounter + 1
' Loop
' Set rng = .Range.Bookmarks("bmkCoverTable").Range
' .Tables.Add Range:=rng, NumRows:=intSelectedRows,
NumColumns:=ListBox1.ColumnCount, _
' DefaultTableBehavior:=wdWord9TableBehavior,
AutoFitBehavior:=wdAutoFitContent
' 'Now add the data to the table
' intCounter = 0 ' number of rows in ListBox1
' intCounter2 = 0 'number of rows in Table
' Do Until intCounter = ListBox1.ListCount
' If ListBox1.Selected(intCounter) = True Then 'this list row has
a check mark
' intCounter2 = intCounter2 + 1 'set table row number
' intColumnIndex = 0 'Listbox column number
' Do Until intColumnIndex + 1 > rng.Tables(1).Columns.Count
' If intColumnIndex = 0 Then 'Unique case for product
data titles
'
rng.Tables(1).Rows(intCounter2).Range.Cells(intColumnIndex + 1).Range.Text = _
' SetProductDataTitle(RTrim(ListBox1.List(intCounter,
intColumnIndex)))
' intColumnIndex = intColumnIndex + 1
' Else
'
rng.Tables(1).Rows(intCounter2).Range.Cells(intColumnIndex + 1).Range.Text = _
' RTrim(ListBox1.List(intCounter, intColumnIndex))
' intColumnIndex = intColumnIndex + 1
' End If
' Loop
' End If
' intCounter = intCounter + 1
' Loop
' 'this area creates the table on the page
' With rng.Tables(1)
' .TopPadding = InchesToPoints(0)
' .BottomPadding = InchesToPoints(0)
' .LeftPadding = InchesToPoints(0)
' .RightPadding = InchesToPoints(0)
' .Rows.Alignment = wdAlignRowCenter
' If intModelCount > 6 Then
' .Range.Paragraphs.Style =
ActiveDocument.Styles("ModelDetails_Small")
' .Rows(1).Range.Paragraphs.Style =
ActiveDocument.Styles("ModelDetails_Small Heading")
' .Columns(1).Select
' Selection.Style = ActiveDocument.Styles("ModelDetails_Small
Heading")
' Else
' .Range.Paragraphs.Style =
ActiveDocument.Styles("ModelDetails")
' .Rows(1).Range.Paragraphs.Style =
ActiveDocument.Styles("ModelDetails Heading")
' .Columns(1).Select
' Selection.Style = ActiveDocument.Styles("ModelDetails
Heading")
' End If
' End With
' End With
'


"Cookie" wrote:

I have an existing VBA application that takes a flat file from and AS/400
appl and formats into a word document/PDF. There is a table created on the
cover page that I would like to copy to a new document. I have been able to
get the data I need into the table and create the additional document.
However, I have not been able to get the table into the new document. Please
help!
.



Relevant Pages

  • RE: Book on Pre-MATH for cryptography and cryptanalysis. Reply
    ... She will indirectly charge due to Jay when the preliminary ears ... concern in response to the secure morning. ...
    (sci.crypt)
  • Re: Entropy sources under WinXP
    ... It died, you injured, yet Geoffrey never overnight meeted in response to the ... I'll reserve again or Jay will owe the ...
    (sci.crypt)
  • Re: England team for ABs
    ... playing career and left the door open for him to expand about how good ... he was and what he'd done to give credence to his thinly veiled ... Your response was that, and then a statement about how it was better than ... Hence why I said I left the door open for him to expand about how good ...
    (rec.sport.rugby.union)
  • Re: pass datatable in event or grab from property or pass in function?
    ... Please read my response to Jay B. Harlow. ... > various times (not just once after the construction of the object), ... The developer will always have a need to ... Again, please read my post to Jay, as it is directed to the both of you. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Retrieving the multiple values set by a form
    ... indeed overwrite each other with only the last value surviving, ... lorento. ... Thanks for your response. ... Let me expand a bit on my requirement. ...
    (comp.lang.php)