Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jan 2003
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Insert Symbol Default Font (Word 2000)

    Post deleted by mjairix

  2. #2
    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: Insert Symbol Default Font (Word 2000)

    I thought it defaulted to the last set you used... anyway, help lists the following valid parameters for the dialog:

    Font, Tab, CharNum, Unicode, Hint

    But, of course, there is a lack of documentation on how to use them. <img src=/S/grin.gif border=0 alt=grin width=15 height=15> Inasmuch as one usually can rely on the heritage of WordBasic to understand how to use these parameters, using the name of the font is the correct approach, but unfortunately it doesn't work for me.

    <pre>With Dialogs(wdDialogInsertSymbol)
    .Tab = 0 'Shows first tab
    .Font = "Symbol" 'Doesn't work!
    .Show
    End With</pre>

    Perhaps if you search the web using the dialog name you can find some help on this? The first few references in Google didn't seem very helpful for this (useful for other things, but not this).

    The last refuge of desperate Office programmers would be SendKeys:

    <pre>With Dialogs(wdDialogInsertSymbol)
    .Tab = 0 'Shows first tab
    SendKeys "%FSymbol{TAB}" 'Works with Word 2002 dialog
    .Show
    End With</pre>

    This will work some of the time, and fail some of the time, and generally be unpredictable. But maybe it's good enough for now?

  3. #3
    2 Star Lounger
    Join Date
    Jan 2003
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Insert Symbol Default Font (Word 2000)

    Many thanks for your quick response. I finally got it to work with the following code. I thought I had tried the exact code before and it didn't work, but now it does. Again, many thanks for your help!...Mary

    Sub InsertSymbol()
    'Dialogs(wdDialogInsertSymbol).Show
    With Dialogs(wdDialogInsertSymbol)
    .Font = "symbol"
    .Show
    End With
    End Sub

  4. #4
    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: Insert Symbol Default Font (Word 2000)

    Hi Mary, for future reference, please do not delete your original post after someone has responded. The thread kind of loses its context. (See <!rule=6>Rule 6<!/rule>.)

    I tried out your new version, and it doesn't work in Word 2002 if the previously used font was, say, Wingdings, which was mine. You are lucky if it works in Word 2000.

    My earlier code had a flaw, in that it seemed to insert something even if I canceled. This version should work better, and I changed it a bit to be called with the name of the font as a parameter:
    <pre>Sub MyInsertSymbol()
    ' Call the dialog with your choice of font!
    InsertSymbolUsingFont "Symbol"
    End Sub

    Sub InsertSymbolUsingFont(strFont As String)
    ' Use SendKeys to set the font drop-down and then display
    With Dialogs(wdDialogInsertSymbol)
    SendKeys "%F" & Trim(strFont) & "{TAB}"
    .Display
    End With
    End Sub</pre>

    Hope this helps someone, even if you don't need it. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

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