473,606 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CreateObject("W ord.Application ")

Below is a section of the code I use to open Word with late binding, insert
text at the selected bookmarks, and make Word visible. Everything works
fine. However, I also have some Word check boxes, that I cannot figure out
how to make 'checked'. I am not allowed to alter the layout of the form; it
must be a check box. Up until now, I have simply required users to check
the box themselves, but now I'm opening up four Word forms that all have the
same check box - I really need to get this.

Anybody got a one-line solution?
Darryl Kerkeslager

-----------------------------------------------------------------
Dim mWord As Object
Set mWord = CreateObject("W ord.Application ")
mWord.Documents .Add oDocs & "odis_PPS_100_C aseClosing.dot"
With mWord.ActiveDoc ument
.Bookmarks("off _name").Range.F ields(1).Result .Text =
GetOffenderName ()
.Bookmarks("dis trict_id").Rang e.Fields(1).Res ult.Text = "#" &
GetDistrictID()
.Bookmarks("Tod ay").Range.Fiel ds(1).Result.Te xt = Date
End With
mWord.Visible = True
Set mWord = Nothing
---------------------------------------------------------------------
Nov 13 '05 #1
4 7998
Does the following help?

http://groups.google.com/groups?hl=z....microsoft.com

Herbert

"Darryl Kerkeslager" <Ke*********@co mcast.net> ¦b¶l¥ó
news:vd******** ************@co mcast.com ¤¤¼¶¼g...
Below is a section of the code I use to open Word with late binding, insert text at the selected bookmarks, and make Word visible. Everything works
fine. However, I also have some Word check boxes, that I cannot figure out how to make 'checked'. I am not allowed to alter the layout of the form; it must be a check box. Up until now, I have simply required users to check
the box themselves, but now I'm opening up four Word forms that all have the same check box - I really need to get this.

Anybody got a one-line solution?
Darryl Kerkeslager

-----------------------------------------------------------------
Dim mWord As Object
Set mWord = CreateObject("W ord.Application ")
mWord.Documents .Add oDocs & "odis_PPS_100_C aseClosing.dot"
With mWord.ActiveDoc ument
.Bookmarks("off _name").Range.F ields(1).Result .Text =
GetOffenderName ()
.Bookmarks("dis trict_id").Rang e.Fields(1).Res ult.Text = "#" &
GetDistrictID()
.Bookmarks("Tod ay").Range.Fiel ds(1).Result.Te xt = Date
End With
mWord.Visible = True
Set mWord = Nothing
---------------------------------------------------------------------

Nov 13 '05 #2
For checkboxes, I do this:
If Forms!frmForm!f rmGroup = 1 Then
.ActiveDocument .Bookmarks("chk Box1").Select
.Selection.Text = "X"
End If
If Forms!frmForm!f rmGroup = 2 Then
.ActiveDocument .Bookmarks("chk Box2").Select
.Selection.Text = "X"
End If

Et cetera. You don't get the square around the checkbox, but it
works.

I suggest using DocVariables instead of bookmarks if you have a lot of
things to bring over -- much faster. (No checkboxes, though.)
Below is a section of the code I use to open Word with late binding,

insert
text at the selected bookmarks, and make Word visible. Everything works
fine. However, I also have some Word check boxes, that I cannot figure

out
how to make 'checked'. I am not allowed to alter the layout of the form;

it
must be a check box. Up until now, I have simply required users to check
the box themselves, but now I'm opening up four Word forms that all have

the
same check box - I really need to get this.

Anybody got a one-line solution?
Darryl Kerkeslager

-----------------------------------------------------------------
Dim mWord As Object
Set mWord = CreateObject("W ord.Application ")
mWord.Documents .Add oDocs & "odis_PPS_100_C aseClosing.dot"
With mWord.ActiveDoc ument
.Bookmarks("off _name").Range.F ields(1).Result .Text =
GetOffenderName ()
.Bookmarks("dis trict_id").Rang e.Fields(1).Res ult.Text = "#" &
GetDistrictID()
.Bookmarks("Tod ay").Range.Fiel ds(1).Result.Te xt = Date
End With
mWord.Visible = True
Set mWord = Nothing
---------------------------------------------------------------------

Nov 13 '05 #3
Yes, that did it. I think I tried something like that earlier, but it must
not have been *exactly* that.

Thanks.

Darryl Kerkeslager

"Herbert Chan" <he*****@chan.c om> wrote:
Does the following help?

http://groups.google.com/groups?hl=z....microsoft.com
Nov 13 '05 #4
Thanks, but unfortunately, I had to use the checkBox. I could not alter the
form in any way.
Darryl Kerkeslager

"Nicole" <ni*****@namg.c om> wrote:
:
:
Et cetera. You don't get the square around the checkbox, but it
works.

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
13562
by: The Roys | last post by:
Hi Im doing something wrong in quitting the Word.Application in my VB program. I have General Declarations Dim AppWord As Word.Application Form_Load() Set AppWord = CreateObject("Word.Application")
4
16159
by: Microsoft | last post by:
I'm trying to display a word document inside a web page, but everytime I do I get this error: Error Type: Microsoft VBScript runtime (0x800A0046) Permission denied: 'CreateObject' Does anybody know the correct way to do this? I don't want to link to a document, but rather display a word file inside the asp page.
3
5336
by: Greg Andora | last post by:
Hello, I've had an ASP page that worked for at the minimum for a year and now it is acting very odd and I need some help to fix it. What my page does/did is creates a Word.Application object and a new document from a template. It then proceeds to fill in a bunch of the information on the word document using bookmarks and data from a database. Then it saves the document to a directory and sends the user off to go get the new document. ...
2
10233
by: MaxiWheat | last post by:
Hi, I am using a software that uses MS Word to create PDF files. When I try to run the sample code (ASP 3.0), I get an error on this statement : Set oWord = Server.CreateObject("Word.Application") That error says : The call to Server.CreateObject failed while checking permissions. Access is denied to this object.
2
5490
by: POLILOP | last post by:
When i try to do this Dim ExcelFace Set ExcelFace = CreateObject("Excel.Sheet") ......... the browser says this Error Type: Microsoft VBScript runtime (0x800A0046) Permission denied: 'CreateObject'
0
1534
by: Svet | last post by:
CreateObject("Excel.Application") on NT 4.0 hangs and I have to kill the Access 97 app that it is running on. The same code works fine as a stand alone code. This occurs on users' machines thatt have weird builds and I was wondering if anyone has seen this and can shed some light what I can look into. Thanks.
5
9351
by: KC | last post by:
Hi, I have code similar to this.. Dim xlApp As Object xlApp = CreateObject("Excel.Application", "\\MyServer") The call is from a asp.net (Intranet) application. \\Myserver is a network computer in the same domain as web server. The only way I can get this call worked is when I add the user who logs on to the web site as Administrators. I need to get this working without having to make the user administrator. Any suggestion?
1
6566
by: Raúl Martín | last post by:
I´ve a function in asp that run correctly but If I tried to change it forasp.net in asp: xmlHTTP = CreateObject("Microsoft.XMLHTTP") And I thought to use this sentence for asp.net but the server don´t response right. xmlHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
1
4861
by: David Di Donato | last post by:
hi i have a big problem. i have an asp file with the following source code.... ****** Set r_ = Server.CreateObject ("Access.Application.10") s1 = "DoAnything()" with r_
0
7951
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
8430
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
8094
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
8305
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
6770
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
5465
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
3930
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1553
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1296
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.