Results 1 to 2 of 2

Thread: [RESOLVED] How can I create a Word Document using VB/VBA?

  1. #1

    Thread Starter
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Resolved [RESOLVED] How can I create a Word Document using VB/VBA?

    Hi all,

    I would like to create some blank word document. Is there any way to create a word document? We can create a text file using vb. Similarly I would like to create a Word document (should be blank) using VB.

    Pls let me know your comments.

    Thanks,

    CS.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: How can I create a Word Document using VB/VBA?

    Documents.Add

    vba, will open a new document in word based on the normal template

    Syntax

    expression.Add(Template, NewTemplate, DocumentType, Visible)

    expression Required. An expression that returns a Documents object.

    Template Optional Variant. The name of the template to be used for the new document. If this argument is omitted, the Normal template is used.

    NewTemplate Optional Variant. True to open the document as a template. The default value is False.

    DocumentType Optional Variant. Can be one of the following WdNewDocumentType constants: wdNewBlankDocument, wdNewEmailMessage, wdNewFrameset, or wdNewWebPage. The default constant is wdNewBlankDocument.
    should also work from vb, by using the wordobjectprefix

    pete

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