I’ve got some code that creates a new document based on a certain template, adds stuff to the document according to various saved text files, then (supposedly) displays the resulting document to the user. I assumed that .activate would make my document the active document and bring it to the front, but it doesn’t seem to. It “activates” the taskbar button for that document, but I have to click it a couple of times to bring my document to the front. What do I add to my code to ensure my document comes to the fore when all the work is done?
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
activating new document (wd2000)
Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » activating new document (wd2000)
- This topic has 7 replies, 4 voices, and was last updated 22 years, 3 months ago.
Viewing 1 reply threadAuthorReplies-
WScarbonnb
AskWoody LoungerFebruary 7, 2003 at 1:14 pm #651547(Edited by carbonnb on 07-Feb-03 09:14. Thought of another question as soon as I clicked post.)
Dave,
Is the code running from Word or are you automating Word from another application?
Are you using a line similar to this to create the new document?
Set doc = Application.Documents.Add(Template:=”c:fullpathtoyourtemplate.dot”, Visible:=False)
Could you please post the code that you are using to create the document and the code you are using to try and activate the document?
Did you turn off the screenupdating while running the code?
-
WSDaveW
AskWoody LoungerFebruary 7, 2003 at 2:04 pm #651567The code’s running from a Word global template.
To create the document:
Dim DocReport as Document
(…code…)
Set DocReport = Documents.Add(Template:=ThisDocument.FullName) ‘note I didn’t set visibility either wayLater, to activate the document:
DocReport.activateNo, I didn’t turn off screenupdating.
HTH -
WScarbonnb
AskWoody LoungerFebruary 7, 2003 at 2:21 pm #651574Well Dave,
I just tried a quick test and it worked fine for me. I don’t know what to tell you now.
Try explicitly setting the Visible parameter to true in the Documents.Add code.
I actually had the document come to the front without using .activate.
If there are any user forms open, try closing (or hiding them if you still need to use them) before the docReport.activate line.
Other that that, I’m stumped.
-
WSGary Frieder
AskWoody Lounger
-
-
-
WSjscher2000
AskWoody LoungerFebruary 7, 2003 at 8:41 pm #651655Sounds like that TweakUI “don’t steal focus” issue in a new context. Do you run TweakUI?
-
WSDaveW
AskWoody LoungerFebruary 10, 2003 at 10:27 am #652190I’ve just tried the code on a different machine: at work we’re on Win2000 (definitely no TweakUI!), and it does what it’s supposed to, the way it’s expected to (which is the main thing, really, since it’ll be used at work when it’s all sorted out). On my machine at home (which was exhibiting the problem) I have WinXP, and possibly (I can’t recall offhand) TweakUI. I’ll have a look into it.
In the meantime, I’ll also have a go with Gary’s code, see if that makes a difference.
Thanks guys, I’ll report back with the outcome (one way or the other!)… -
WSDaveW
AskWoody LoungerFebruary 13, 2003 at 8:05 am #653139Strangely, I now can’t get it to replicate the problem – works fine now! (Though it WAS doing it all the time… must’ve been some specific set of circumstances, but I’m blown if I can work out what). Hmm… Anyway, no I wasn’t running TweakUI on my home machine either, but I’ve kept hold of that code snippet in case it leaps up again. Sorry to have troubled you guys with a problem that seems to have gone away of its own accord!
(If only they were all like that, huh?)
-
-
Viewing 1 reply thread -

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
-
Edge Seems To Be Gaining Weight
by
bbearren
1 hour, 27 minutes ago -
Rufus is available from the MSFT Store
by
PL1
10 hours, 6 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
12 hours, 16 minutes ago -
KB5061768 update for Intel vPro processor
by
drmark
8 hours, 29 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
10 hours, 27 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
8 hours, 1 minute ago -
Office gets current release
by
Susan Bradley
10 hours, 38 minutes ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
2 days ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
1 day, 9 hours ago -
Stop the OneDrive defaults
by
CWBillow
2 days, 1 hour ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
2 days, 11 hours ago -
X Suspends Encrypted DMs
by
Alex5723
2 days, 13 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
2 days, 13 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
2 days, 14 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
2 days, 15 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
2 days, 3 hours ago -
Enabling Secureboot
by
ITguy
2 days, 10 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
2 days, 23 hours ago -
No more rounded corners??
by
CWBillow
2 days, 18 hours ago -
Android 15 and IPV6
by
Win7and10
2 days, 8 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
3 days, 11 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
3 days, 14 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
3 days, 8 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
3 days, 21 hours ago -
May preview updates
by
Susan Bradley
3 days, 8 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
3 days ago -
Just got this pop-up page while browsing
by
Alex5723
3 days, 13 hours ago -
KB5058379 / KB 5061768 Failures
by
crown
3 days, 10 hours ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
2 days, 12 hours ago -
At last – installation of 24H2
by
Botswana12
4 days, 12 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
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.