473,670 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Activate Word document after closing vb2005 dialogbox

2 New Member
Hi,

I am loading word with vb2005 customized commandbars. During the load of the Word exe, the exe automatically opens a new document. I am having
difficulty "activating " the open document within the word application after I
close the dialogbox (that is loaded upon the user clicking one of the
commandbar buttons). After I close my dialog box, I see the ibeam cursor in
my word document, however it is not flashing, just a solid vertical line. I
have tried .Activate for the application and active document. If I put a
breakpoint at the .Activate line of code, F5 to the breakpoint, then F5 to
the end of the code, focus is set back to the document and I do have a
blinking cursor. However, if I just F5 all the code (without the
breakpoint), I do not have a blinking cursor. I have tried typing text into
the document after activating the document -->
Application.Sel ection.TypeText ("test") and
Application.Sel ection.TypeBack space(). I have tried -->
Application.Act iveWindow.Activ ePane.View.Seek View =
Word.WdSeekView .wdSeekMainDocu ment -->
and still no luck. I am using form.ShowDialog () to display the dialog box
and have tried using form.Close() and also just setting the form = nothing
(without form.Close()). I thank you in advance for any information you can
offer!
Oct 5 '06 #1
0 1637

Sign in to post your reply or Sign up for a free account.

Similar topics

1
6569
by: Nicole | last post by:
Like many before me, I am tearing my hair out trying to get Acrobat 6.0 to work with VBA. I am getting close, and the error I am getting now seems like it should be easy to surmount. So why am I stumped?! ;) This code is in the middle of a large module in an ADP that takes web data and ports it to an MS Word form that is dynamically generated based on the data. Near the end, the Word doc needs to print to PDF and save both the Word...
6
2677
by: Ryan Muller | last post by:
My company just upgraded from Access 97 to Access 2003 today and we are having some issues in a database that generates a Word document from information selected in a form. Here is the code we were using without issue previous to the switch: 'Start Word and create a new doc from the template Set objWord = CreateObject("Word.Basic") objWord.AppMaximize "Microsoft Word", 1 objWord.FileNew Template:=StrTemplPath & "letter.dot"
3
3458
by: John Smith | last post by:
Hey folks, I've got a Windows C# application that generates a .doc file and then allows the user to preview it. I generate the file using the StreamWriter class and do a flush() and a close() after writing the last line (which always get runned). Because the intended users have all versions of MS Word ranging from Word 97 to 2003, I chose not to go with a dll object modeling approach and instead
5
2815
by: juststarter | last post by:
hi there here is my problem : there is a main form (frmMain) which calls a searchForm (frmSearch). Then i select an item (from the returned ones) and open a third form (frmData). Taking from there i can either : A. open a fourth form (frmComment) which is just a textbox and a button (and should return the text entered in the textbox into frmData) B. open a word document ,and paste its contents into a richtextbox in frmData The problem...
12
3444
by: Steve | last post by:
I've been building an application that will merge fields in a text file with a word template, save the resulting word file out to the user's hard drive, and then email the file as an attachment. The problem I'm having is that I can't delete the word file I saved at the end of the process due to the file being locked by the email process. It appears to take longer than the code takes to complete due to virus checking software that...
2
9428
by: ClearCut | last post by:
I have written a program in VB6 that opens an existing Word document and adds some text to the top of the document before printing it. Now I want to close the document without saving the changes. This preserves the document as a "templet". However it seems that it automatically saves the document with the changes prior to closing. Below is my code. Thanks in advance for your help. Dim strE As String Dim objWord As Word.Application ...
2
4877
by: Derek Hart | last post by:
I am using late bound Microsoft Word integration with a vb.net winforms application. If I run code such as the following: Dim objWord As Object Dim objWrdDoc As Object Dim count As Integer Dim filename As String filename = "c:\temp\mergedata\1.doc" objWord = CreateObject("Word.Application") For count = 1 To 10000
2
1380
by: vipinkmathews | last post by:
I wrote code for previewing a word dcoument in C#. In the code when the user click preview button the document gets opened and later the user manually closes the document. But in Task manager the memory is not reducing. Actually after opening the document i'm not closing the Word Document instance or not Quitting the Word instance because the user wants the word document to be opned. But in finally block i'm making the word dcoument, word...
0
1257
by: Beta | last post by:
Does anyone know how to close an embedded word document in C# application without closing an external Word document? The issue is the external Word Document share the same instance (winword.exe) as the embedded application in C#. When the program application get close, the External word Document got close as well. Is there a way to prevent the external word document being close when the program application is close?
0
8386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8903
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8814
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8592
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8661
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7419
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5684
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.