+ Reply to Thread
Results 1 to 6 of 6

Copy rows from excel sheet to a word document

Hybrid View

  1. #1
    Ivan Raiminius
    Guest

    Re: Copy rows from excel sheet to a word document

    Hi Ashish,

    yes, it is possible with code like this:

    Sub WriteToTextFile
    Dim fsFs As Scripting.FileSystemObject
    Dim fsOutput As Scripting.TextStream
    Dim OutputFile as String

    OutputFile = ' here add path and filename, maybe also result of _
    application.getsaveasfilename

    Set fsFs = New FileSystemObject
    Set fsOutput = fsFs.OpenTextFile(Filename:=OutputFile,
    IOMode:=ForWriting, create:=True, Format:=TristateUseDefault)

    fsOutput.writeline "here add what you want to write"
    fsOutput.close
    end sub

    You need to set reference to Microsoft Scripting Runtime when trying to
    run this code.

    If anything is not clear, please let me know.

    Regards,
    Ivan


  2. #2
    Registered User
    Join Date
    02-13-2006
    Posts
    46
    Not clear with referencing the Microsoft Scripting Runtime . how to do it.
    Thanks for the help.

  3. #3
    Ivan Raiminius
    Guest

    Re: Copy rows from excel sheet to a word document

    Hi Ashish,

    in VBA editor: Tools >> References check Microsoft Scripting Runtime

    Regards,
    Ivan


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1