VBA in Word Question

Discussion in 'Software' started by bdawg737, May 19, 2004.

  1. bdawg737

    bdawg737 Private E-2

    I know there has got to be a way for me to programatically add a file (another word document) with the click of a button I place in a toolbar. The file must go in the header/footer section. Anyone know how to do this?? Thanks so much
     
  2. Kodo

    Kodo SNATCHSQUATCH

    VBA for word isn't my strong point so maybe this will point you in the right direction..

    make a new module for Normal.dot and call it FileIns

    make a new sub in the module:

    Sub DoFileInert()

    selection.insertfile "C:\pathtofile\filename.doc"

    end sub

    now make a too tool bar button and drag the module onto the button from the macro's menu

    That will insert a file at the click of a button. Hope it gets you pointed in the right direction.
     
  3. bdawg737

    bdawg737 Private E-2

    Thanks for that info. Do you (or anyone else out there for that matter) know how to put it inside the header? I suspect I've got to call some header/page interface but cant seem to figure out how to do it. thanks again
     
  4. Maxwell

    Maxwell Folgers

    You may find it easier to record the macro using this feature within MS Word and assign this to your button.

    With regard to Header/Footer this is toggled under the View menu. What I usually do is to record a macro but using only keyboard shortcuts, which you can find in the MS Word on-line help.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds