Jan 5th, 2005, 01:49 AM
#1
Thread Starter
New Member
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 .
Jan 5th, 2005, 01:26 PM
#2
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
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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
Jan 5th, 2005, 08:42 PM
#3
Thread Starter
New Member
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:
Public Sub d()
MsgBox (ActiveDocument.FormFields(1).Result)
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
Jan 6th, 2005, 04:50 PM
#4
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!
Jan 6th, 2005, 11:51 PM
#5
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:
Public Sub d()
MsgBox (ActiveDocument.FormFields(1).Range.Text)
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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
Jan 8th, 2005, 12:05 AM
#6
Thread Starter
New Member
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:
msgbox(ActiveDocument.FormFields(<bookmark name 1>).Range.Text)
msgbox(ActiveDocument.FormFields(<bookmark name 2>).Range.Text)
msgbox(ActiveDocument.FormFields(<bookmark name 3>).Range.Text)
Jan 8th, 2005, 04:28 AM
#7
Thread Starter
New Member
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
Forum Rules
Click Here to Expand Forum to Full Width