Results 1 to 8 of 8

Thread: Word

  1. #1

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    Word

    I have created a word object with a reference .. oWd

    what is the syntax to open a word document.

    oWd. ???????????????
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  2. #2
    Si_the_geek
    Guest
    search this forum for "Word automation" or "automate Word", this sort of thing is asked all the time - you'll get lots of useful tips for this and everything else you'll need to do with it once you have it open.

  3. #3
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    oWd.Documents.Open "Document Path"

  4. #4
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    heres a good tip

    open up word, and record a macro of whatever you wanna do, then edit teh macro and youve pretty much got all the code you need in Vb right in front of you
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  5. #5

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    Ok .. I have it all except one thing ..

    comes up with a do you want to save changes...

    how can I skip the conversation and just close the sucker as I am not making changes, I am only printing.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  6. #6
    Si_the_geek
    Guest
    when you close Word (or just a document) you can pass a "save the changes" parameter, just set it to false, eg:

    oWord.Close SaveChanges := False

  7. #7

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    thanks all...
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  8. #8
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    use one of these depending on what you want

    VB Code:
    1. ActiveDocument.Close wdDoNotSaveChanges
    2.     ActiveDocument.Close wdPromptToSaveChanges
    3.     ActiveDocument.Close wdSaveChanges
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

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