Results 1 to 3 of 3

Thread: help on using wordpad in stead of Word

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    2

    help on using wordpad in stead of Word

    hi,

    I have the following code:
    Code:
    Dim MyWord As Word.Application
    Dim WordDoc As Word.Document
    
    Set MyWord = CreateObject("Word.Application") 
    Set WordDoc = MyWord.Documents.Add
    
    MyWord.Visible = False
    'MyWord.Activate
    
        MyWord.Selection.Font.Name = "Arial"
        MyWord.Selection.Font.Size = 12
    
        MyWord.Selection.InsertFile FileName:=frmSelectDir.lblTemp & "\releasenotes.txt"
        MyWord.Selection.TypeText vbNewLine
        MyWord.Selection.TypeText "Aard van de change: "
        MyWord.Selection.InsertFile FileName:=frmSelectDir.lblTemp & "\AardChange.rtf"
       MyWord.Selection.TypeText vbNewLine
        
        
    'Save the file. If the document exists it is overwriten
    WordDoc.SaveAs frmSelectDir.lblTemp & "\algemeen.doc"
    WordDoc.Close
    
    Set WordDoc = Nothing
    Set MyWord = Nothing
    this works like a charm but I would really like to use Wordpad in stead of Word to save network resources.
    there is also no need at all to save that last bit as a .doc, it can be a .rtf too.

    could anyone help me converting this code as such?

    thanks a million in advance!!!

  2. #2
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: help on using wordpad in stead of Word

    WordPad doesn't expose an automation interface. Unlike Word, which is an ActiveX EXE.

    Most of what you can do in WordPad you can do using a RichTextBox anyway.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    2

    Re: help on using wordpad in stead of Word

    well, basically what this code does is this:

    I have two forms, both with a rich text box. those rtf boxes both save their contents to a .rtf.
    this code combines those two files into one.

    so what it comes down to is the question "how do I combine multiple rft files into one, using wordpad"

Posting Permissions

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



Click Here to Expand Forum to Full Width