Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2007

Tip: Looking for answers? Try searching our database.

Output Array

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Bundy - 19 Jul 2007 14:24 GMT
Thanks for looking

I work with Excel a lot and have built an array of string values, there are
about 200 in the test. I am trying to output these to word using code found
here, I'm getting no errors but nothing is happening either. Thanks for any
help and the code is below

Set owordapp = CreateObject("Word.Application")

  'open a new document in Word
  owordapp.Documents.Add DocumentType:=wdNewBlankDocument
owordapp.Visible = True
     
storeIndex = 1
'===THIS IS THE PROBLEM==========
Do Until storeArray(storeIndex, 16) = ""
  activedocument.Range.insertafter storeArray(storeIndex, 16) & vbCrLf
  activedocument.Range.insertafter storeArray(storeIndex, 17) & vbCrLf
  storeIndex = storeIndex + 1
Loop

Probably something easy but I'm lost in Word
Signature

-John
Please rate when your question is answered to help us and others know what
is helpful.

John Bundy - 19 Jul 2007 15:10 GMT
Found some help that worked from Excel side, for those looking this is what I
did

Set owordapp = CreateObject("Word.Application")

  'open a new document in Word
  owordapp.Documents.Add DocumentType:=0

owordapp.Visible = True
storeIndex = 1

Do Until storeArray(storeIndex, 16) = ""
  owordapp.Selection.TypeText storeArray(storeIndex, 16) & vbCrLf
    storeIndex = storeIndex + 1
Loop
Signature

-John
Please rate when your question is answered to help us and others know what
is helpful.

> Thanks for looking
>
[quoted text clipped - 18 lines]
>
> Probably something easy but I'm lost in Word
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.