-
mvpjjf
AskWoody PlusFirst, that function doesn’t do what you think it does, and I don’t recall offhand what the right one is — I may be able to find it tomorrow.
Jeff Prosise explained it this way:
“When a Windows program draws to a screen, a printer, or another output device, it doesn’t communicate directly with the device as an MS-DOS program is apt to do. Rather, the Windows program draws to a logical “display surface” represented by a device context (DC). Deep inside Windows, a device context is a data structure containing fields that describe everything the GDI needs to know about the display surface and the context in which it is being used…”The following is from a C++ viewpoint. I’m not sure you can do the same thing in VB…
You can make copies of a DC and modify them before displaying them. If your function receives a copy of a DC and needs to add some text to it, you may need to find out what face is already selected there. That’s what GetTextFace is for: you pass in the DC (actually a handle to the DC, hence hDC) and a buffer that can hold a string. The nCount parameter says how big the buffer is. When the function returns, the buffer contains the name of the selected font in the DC.
The MS documentation is at http://msdn.microsoft.com/library/default….ontext_3jtx.asp, but again, that’s based on C++ and may be hard to apply to VB.
-
mvpjjf
AskWoody PlusHi, Chris,
Format/Background is only for Web pages. (You might notice that as soon as you assign a background, Word flips into Web view, and if you switch to Page Layout view the background disappears.) These backgrounds won’t print.
First, to make things easier, go into Tools/Options and turn on display of paragraph marks and object anchors.
Put the cursor in the paragraph that follows the table, and use Insert/Picture. It’ll come in as an in-line graphic, on a second page. On the Picture toolbar, click the Wrapping button and select Behind Text.
Drag the picture to cover one label and size it to fit. (It will keep trying to get away from you
but drag it back carefully, and spit on it
to make it stay put.) If the anchor jumps into the table, drag it back to the final paragraph mark. (If the picture is anchored in a table cell, it interferes with the alignment of text in the cell.)
Click the Image Control button on the Picture toolbar and select Watermark. If that makes it too washed-out, fiddle with the Less Brightness and More Contrast buttons until you like it.
Hold down Ctrl and drag the picture to the other cell, and play games again until it’s positioned in the cell and anchored outside the table.
Finally, add your text and print the labels.
-
mvpjjf
AskWoody PlusIn Word 2000, the file grows from 20KB to “only” 397KB with the small dashes, 262KB with the large dashes, and 149KB with the dot-dash line.
-
mvpjjf
AskWoody PlusTo expand on this a bit… Set up the merge main document as a landscape page, with the vertical alignment set to Center. Insert a 1-row x 2-column table. Right-click one cell of the table, choose Text Direction, and rotate the text clockwise. Do the same to rotate the other cell counterclockwise. Now put in the merge fields.
-
mvpjjf
AskWoody PlusThere may be an easier way in VB, but I haven’t found it.
The Win32API way works, but it’s complicated. Put this behind a command button, run it, and then look at the Explorer key in RegEdit.
Const ERROR_SUCCESS = 0& Const HKEY_LOCAL_MACHINE = &H80000002 Const REG_SZ = 1 ' Unicode nul terminated string Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" _ (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long Private Declare Function RegCloseKey Lib "advapi32.dll" _ (ByVal hKey As Long) As Long Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" _ (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, _ ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long ' Note that if you declare the lpData parameter as String, ' you must pass it By Value. Private Sub Command1_Click() Dim nRet As Long, hKey As Long Dim SubKey As String, ValName As String, ValValue As String SubKey = "SoftwareMicrosoftWindowsCurrentVersionExplorer" ValName = "Demonstration" ValValue = "My string value" nRet = RegOpenKey(HKEY_LOCAL_MACHINE, SubKey, hKey) If (ERROR_SUCCESS = nRet) Then nRet = RegSetValueEx(hKey, ValName, 0&, REG_SZ, ByVal ValValue, _ Len(ValValue) + 1) If (ERROR_SUCCESS nRet) Then MsgBox "SetValue failed." End If RegCloseKey (hKey) Else MsgBox "SetValue failed." End If Unload Me End Sub
-
mvpjjf
AskWoody PlusThat’s what I do, too. But if block select worked in the VBE, I wouldn’t have to do a two-step shuffle. Surely MS knows that programmers are the laziest folk on the face of the planet — we’ll work all day to avoid two extra keystrokes!
-
mvpjjf
AskWoody PlusWhen all else fails, use the ASCII value of the character. For a backslash, that’s ^92.
-
mvpjjf
AskWoody PlusSometimes I grab a chunk of code out of the quoted section of a newsgroup post, and it has > signs all down the left margin. My newsreader doesn’t support block select, so the code still has that garbage when I paste it into the VBA editor. Instant mass syntax error!
It’s fairly easy to get rid of the junk with F&R, but block select would be quicker and easier.
-
mvpjjf
AskWoody PlusSeptember 21, 2001 at 11:19 pm in reply to: Space between text and underline ((all, but target is word97sr2) #543638There’s no adjustment I’m aware of. These fields are pretty primitive, as I don’t think this part of the code has been touched in 10 years.
The spacing is probably a fixed percentage of the font size, since it always seems to clear the descenders by the same visual space.
BTW, I discovered a limitation while I was playing with it: The text in the parentheses can’t contain a comma. That’s because EQ fields use the comma as a parameter separator. Including a comma makes the field interpreter think you have two parameters, but the x switch only accepts one parameter.
In W2K, in the Help topic on the EQ field, go to the subsection on the x switch and click the button to see the four options to, bo, le, and ri. They aren’t independent switches, just options for the x switch.
-
mvpjjf
AskWoody PlusSeptember 20, 2001 at 11:35 pm in reply to: Macro Help! – PageWidth Setting (Word 2000 SR-1) #543445Hi, Rich,
I just tried it (I’m also using Word 2000 SR-1) and it works fine for me. I tried declaring vPageWidth both as a String and as a Single (which is what the Help topic for .PageWidth says it returns)… same result. For an 8.5″ Letter page, for instance, I get 612, which is 8.5 inches * 72 points/inch.
Maybe your printer driver is returning some funny results to Word?
-
mvpjjf
AskWoody PlusSeptember 20, 2001 at 11:22 pm in reply to: Space between text and underline ((all, but target is word97sr2) #543441One more possibility: Use an EQ field with the x (box) switch and the bo (bottom only) qualifier…
{eq xbo(Your text here)}
Works in any version of Word, all the way back to 2.0 and maybe earlier.
A possible drawback is that the line extends a point or two to the left and right of the text, since it’s part of an enclosing box. Your choice.
-
mvpjjf
AskWoody PlusSeptember 18, 2001 at 3:11 pm in reply to: Document File Size, Too Big for So Little (Word 97 SR2) #542987At the risk of heading seriously off-topic, the “minimum file block” (MS calls it “cluster size”) isn’t that big — it’s between 4KB and 32KB for a FAT32-formatted partition, as explained at http://www.pcguide.com/ref/hdd/file/partFAT32-c.html.
Yes, 19KB is the minimum file size for a Word 97/2000 document (and I expect the same for 2002, since it uses the same file structure). It takes that much just to set up the “containers” that you put text, graphics, formatting, tables, document information, comments, and all the other junk into.
If disk space is a significant worry to you, use a compression program like WinZip. Word documents scrunch down to fairly small percentages of their original size.
-
mvpjjf
AskWoody PlusIt most assuredly is in Word 2000. I just used it a minute ago. What ticks me off is that it doesn’t work in the VBA editor.
-
mvpjjf
AskWoody PlusI’ll assume that you mean the attorney wants to see Normal view whenever he opens a document, and not that he wants to force other people to open his documents in Normal view. (I never underestimate the arrogance of an attorney
, but the latter would be a really bad idea.)
Put this macro in the attorney’s Normal.dot, or in a template located in his Word Startup folder:
Public Sub FileOpen() If Dialogs(wdDialogFileOpen).Show = -1 Then ActiveDocument.ActiveWindow.View.Type = wdNormalView End If End Sub
-
mvpjjf
AskWoody PlusSeptember 18, 2001 at 2:17 pm in reply to: Adding all headings to a list box (VBA for Word 2000) #542977Pardon my stepping in here…
Change the name of your procedure to Userform_Initialize, and it will work.
The reason you weren’t getting anything in the listbox is that the procedure frmAppendixStartsat_Initialize() never executed. For reasons that aren’t clear to me,
Microsoft decreed that all events that belong to a userform — any userform, regardless of its name — are called Userform_XXXX(), not ActualUserformName_XXXX().
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Can’t make Opera my default browser
by
bmeacham
2 hours, 24 minutes ago -
Do not Fall For This Purdentix Scam (Awaiting moderation)
by
elizabethkaur56
4 hours, 58 minutes ago -
*Some settings are managed by your organization
by
rlowe44
14 hours, 56 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
17 hours, 10 minutes ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
17 hours, 35 minutes ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
1 day, 2 hours ago -
AI slop
by
Susan Bradley
1 day, 1 hour ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
1 day, 3 hours ago -
Two blank icons
by
CR2
13 hours, 26 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
1 day, 12 hours ago -
End of 10
by
Alex5723
1 day, 15 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
13 hours, 21 minutes ago -
test post
by
gtd12345
1 day, 21 hours ago -
Privacy and the Real ID
by
Susan Bradley
1 day, 11 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
1 day, 3 hours ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
2 days, 1 hour ago -
Upgrading from Win 10
by
WSjcgc50
13 hours, 31 minutes ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
17 hours, 4 minutes ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
2 days, 17 hours ago -
The story of Windows Longhorn
by
Cybertooth
2 days, 5 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
2 days, 19 hours ago -
Are manuals extinct?
by
Susan Bradley
5 hours, 2 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
3 days, 4 hours ago -
Network Issue
by
Casey H
2 days, 15 hours ago -
Fedora Linux is now an official WSL distro
by
Alex5723
3 days, 16 hours ago -
May 2025 Office non-Security updates
by
PKCano
3 days, 17 hours ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
3 days, 18 hours ago -
pages print on restart (Win 11 23H2)
by
cyraxote
2 days, 19 hours ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
3 days, 21 hours ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
3 days, 21 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.