Results 1 to 7 of 7

Thread: Problem in retrieving a degree sign from a form field

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    4

    Resolved Problem in retrieving a degree sign from a form field

    I am having problems when retrieving a degree sign in a ms word form field.
    It seems that the degree sign which should have a value of 176 is being converted to a space(32). Although the character can be displayed in the field, after calling ActiveDocument.FormFields(<index>).Result, the char turns into a space. Is there a workaround to this?
    Thanks.
    Last edited by yamato; Jan 8th, 2005 at 04:29 AM.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Problem in retrieving a degree sign from a form field

    Welcome to the Forums.

    Maybe there is something else going on because I can display and retrieve
    the degree symbol from both a userform textbox and a form field textbox.

    Can you post some of the involved code?
    Attached Images Attached Images  
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    4

    Re: Problem in retrieving a degree sign from a form field

    Thanks for looking into this.

    Please see attached image.



    Here is the code.

    VB Code:
    1. Public Sub d()
    2.   MsgBox (ActiveDocument.FormFields(1).Result)
    3. End Sub

    I have tried this in different environments.
    Word 2000 and Windows 2000 - Both English
    Word XP and Windows XP - Both Chinese
    Word 2003 and Windows XP - Both Chinese

    The bug exists in all three.

    Thanks again.
    Attached Images Attached Images  

  4. #4
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: Problem in retrieving a degree sign from a form field

    Strange?????????
    same resultin Windows98SE/ Word 2000/ Language German
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Problem in retrieving a degree sign from a form field

    Ok, it must be a .Result thing. Use this instead, it works.
    VB Code:
    1. Public Sub d()
    2.   MsgBox (ActiveDocument.FormFields(1).Range.Text)
    3. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    4

    Re: Problem in retrieving a degree sign from a form field

    Thanks.
    I tried it and it works, but only for the first field. All fields after the first returns "". Let's say I have 3 bookmarks.

    VB Code:
    1. msgbox(ActiveDocument.FormFields(<bookmark name 1>).Range.Text)
    2.   msgbox(ActiveDocument.FormFields(<bookmark name 2>).Range.Text)
    3.   msgbox(ActiveDocument.FormFields(<bookmark name 3>).Range.Text)

  7. #7

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    4

    Resolved Re: Problem in retrieving a degree sign from a form field

    Never mind the question above. Problem has been solved. Thanks.

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