Results 1 to 11 of 11
  1. #1
    New Lounger
    Join Date
    Jan 2002
    Location
    Arlington, Virginia, Thailand
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Send To > Microsoft Word Using VBA (Office XP)

    How can I access all those fancy ways of sending a PowerPoint presentation
    to Microsoft Word using a VBA macro? I am going to be searching a directory
    and saving each found presentation as a Word doc (using its original filename
    and the .doc extension). What next? I tried recording the macro in PowerPoint
    but it wound up perplexingly blank!

    I guess my real problem is that I am not familiar with the PowerPoint object
    model. Sorry. Please help.

  2. #2
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Send To > Microsoft Word Using VBA (Office XP)

    You might start by checking out this <post#=123212>post 123212</post#>.

    Cheers
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  3. #3
    Star Lounger
    Join Date
    Apr 2002
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send To > Microsoft Word Using VBA (Office XP)

    uhmm... I am not sure if this is exactly what you have to do. Sorry If I misunderstood your question

    Let's see. If you just need to have each slide of a Powerpoint presentation inside a Word file, I think there is a way to do this. In Powerpoint, using VBA you can export each slide as a single file (a thumbnail) Once you have all the thumbnails in your hard disk, you can create a new Word document and import these thumbnails. I don't know if this is good enough for you, or you need to have a total control of the items inside each slide using Word.

    If this is what you want, I can give you some code to do that.

  4. #4
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Send To > Microsoft Word Using VBA (Office XP)

    > How can I access all those fancy ways of sending a PowerPoint presentation to Microsoft Word using a VBA macro?
    I don't think that these are exposed to us mere mortals. You have to roll your own code, I think. Here's another thread to send just the text to word. I also wrote a macro to send the placeholders and notes to Word that I can post if you are interested.

    > I guess my real problem is that I am not familiar with the PowerPoint object model.
    PoPo's object model is the pits: Redmond took all of the worst features (like shapes) of Word, changed it just enough to drive you crazy, and called it the PowerPoint object model. And as far as I know, no one has written a PowerPoint VBA book. Shyam Pillai's site are the words from the only PowerPoint VBA guru that I know. If you search for "Shapes," you will find a lot of code here. There was one poster who was doing an archive similar to what you want to do, maybe you can find his posts (edited -- Luis who posted below is the one I was thinking of) . Also look on the VBA board. Let us know what else you need. --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  5. #5
    New Lounger
    Join Date
    Jan 2002
    Location
    Arlington, Virginia, Thailand
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send To > Microsoft Word Using VBA (Office XP)

    Attached is the code I wrote to do what I was trying to do: send a bunch of presentations to Microsoft Word. It runs from within the PowerPoint VBA environment. You have to enable the macros for it to work, of course.

    Also note that because the code uses the SendKeys kludge, you cannot effectively step through it. It appears that the keystrokes are sent to the active application, which would be the VBA IDE if you are stepping through it! That's my interpretation from what I've seen, anyway.

    Thank you all for your help, and please let me know what you think. Corrections of my errors are appreciated, if they are made gently. :-)

    DKR
    Attached Files Attached Files

  6. #6
    Star Lounger
    Join Date
    Apr 2002
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send To > Microsoft Word Using VBA (Office XP)

    I didn't know that you have a option from Powerpoint to send data to Word. It looks interesting. If I find a better way to get what you are trying to do, I'll let you know.

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Send To > Microsoft Word Using VBA (Office XP)

    It probably doesn't make your task any easier to know that you can display the Send To... Microsoft Word ("Write-up") dialog this way:

    Sub ShowSendToWord()
    CommandBars.FindControl(Id:=684).Execute
    End Sub

    You'd still need to press Alt+B and Enter (or simulate that, as you have done).

  8. #8
    New Lounger
    Join Date
    Jan 2002
    Location
    Arlington, Virginia, Thailand
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send To > Microsoft Word Using VBA (Office XP)

    Cool trick!

    I'd like to know more about this part of VBA functionality. For example, how can I call the dialog box I want in a more obvious (to the reader of the code) that just using an ID number?

    Is there a way to say (in code) something like:

    on the File menu, select Send To, then Microsoft Word

    by walking down the CommandBar and FindControl tree?

  9. #9
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Send To > Microsoft Word Using VBA (Office XP)

    The advantage of using the Id is that it is language independent.
    You could go through every control on every commandbar looking at the Caption till you find Send To... but this wouldn't work for people with menus in other languages.

    Many functions have dialog boxes that you can call using Dialogs(wdDialogXxxxYyyy).Show, for example wdFilePrint, wdFileSaveAs, wdDialogInsertSymbol etc. The easiest way to get a list of these is to start typing tghe command in Visual Basic and you will be prompted with a list of dialog box constants.

    StuartR

    This is of course a reference to Word dialog boxes, I'm not sure how to do this in PowerPoint, sorry for the confusion!

  10. #10
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Send To > Microsoft Word Using VBA (Office XP)

    Would you believe:

    CommandBars("Menu Bar").Controls("File").Controls("Send to").Controls("Microsoft Word...").Execute

    And the intellisense prompts don't really "get" that Controls("File") is another CommandBar, so you this really is not much fun...

  11. #11
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Send To > Microsoft Word Using VBA (Office XP)

    > This is of course a reference to Word dialog boxes, I'm not sure how to do this in PowerPoint
    Officially, the Dialogs collection is not a part of the PowerPoint object model, but they are actually there. If you open the Object Browser and type "Application" in the search text, then right-click on the Application object and select Show Hidden Members. Now, type dialog in the search text and you will see a whole other world that looks more straight-forward than Excel or Word, but has no documentation and no guarantees. Shyam Pillai has some great examples on his web site http://www.mvps.org/skp/ with the specific application here. Looks like fun and games: wonder what you do in PP2002. Have fun! --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Posting Permissions

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