Consulting

Results 1 to 6 of 6

Thread: Toolbar button

  1. #1

    Toolbar button

    Using Word 2002 (Windows XP)

    1. Is there any way in Word to add a button to a toolbar that opens a specified folder?

    2. Also, is there a way to save a file to a particular folder using a macro or toolbar command (or something else)? I tried to create a macro but "got stuck" when the folder opened and I tried to insert a pause command (to insert a filename). I normally use WordPerfect so not sure what can and can't be done in Word.

    THANKS FOR ANY HELP!

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by Joyce Jung
    Using Word 2002 (Windows XP)

    1. Is there any way in Word to add a button to a toolbar that opens a specified folder?
    Hi and Welcome to VBAX!

    What do you mean whit open a specified folder?
    Do you want to open a Explorer (Windows) window with that particular path?

    Quote Originally Posted by Joyce Jung
    2. Also, is there a way to save a file to a particular folder using a macro or toolbar command (or something else)? I tried to create a macro but "got stuck" when the folder opened and I tried to insert a pause command (to insert a filename). I normally use WordPerfect so not sure what can and can't be done in Word.

    THANKS FOR ANY HELP!
    This Part is why I asked the first question!

    It seams to me that you want to press a button that will open a SaveDialog and when you enter the name in it you want the activedocument to be saved to that path.

    Am I correct.
    If so this possible.

    So could you confirm or rephrase your question?
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  3. #3
    Quote Originally Posted by Joyce Jung
    Using Word 2002 (Windows XP)

    1. Is there any way in Word to add a button to a toolbar that opens a specified folder?

    2. Also, is there a way to save a file to a particular folder using a macro or toolbar command (or something else)? I tried to create a macro but "got stuck" when the folder opened and I tried to insert a pause command (to insert a filename). I normally use WordPerfect so not sure what can and can't be done in Word.

    THANKS FOR ANY HELP!

    Re question 1: I am trying to create a button on a toolbar that will open a subfolder of MyDocuments. I hope I am explaining this OK. (Have done this in WordPerfect, but not sure if I can do the same thing in Word)

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi,

    I understand you want to open that folder but don't understand how you wish to use it.

    So must this be part of a filesave macro? Like:
    1. Press button
    2. Diallog pop-up in specific folder
    3. You enter a name press enter
    4. File get's saved in that folder by that name
    OR: You just want an explorer screen open with a specific folder view and you just want to look at it?

    So try to give me more detail because I'm not understanding it.
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  5. #5
    What you describe as a "filesave macro" to a specific folder is what I am looking for.

    Hope I explained this OK.

  6. #6
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by Joyce Jung
    What you describe as a "filesave macro" to a specific folder is what I am looking for.

    Hope I explained this OK.
    Hi Joyce,

    Sure I've got it now...I think you want something like this:[VBA]
    Option Explicit

    'Change the file path to the folder you want to start the dialog in!
    Const sRoot As String = "C:\Documents and Settings\"

    Sub SaveMyFile()
    Dim dlgSave As Dialog
    Application.ChangeFileOpenDirectory Path:=sRoot
    Set dlgSave = Dialogs(wdDialogFileSaveAs)

    With dlgSave
    .Name = sRoot
    If .Display = -1 Then
    If .Name <> "" Then
    ActiveDocument.SaveAs FileName:=.Name
    End If
    End If
    End With

    Set dlgSave = Nothing
    End Sub
    [/VBA]

    Copy in a new codemodule and press ALT+F8 to execute the sub from within Word.

    Enjoy!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

Posting Permissions

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