Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MS Word - BookMark feature
Message
From
11/11/2006 12:35:04
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
11/11/2006 00:45:47
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01168920
Message ID:
01168944
Views:
13
>hi all,
>
>i have a couple of queries on the issue of bookmarks -
>
>1. on a MS Word document there is a DROP-DOWN list with bookmark name "DD1" and having possible values as follows - "Y", "N", "N/A" - my question is how can i set the value of the DROP-DOWN list to one of the aforesaid values for example, how can i set the value to "N/A" through vfp6.0 code using bookmarks ?
>
>2. there is also a CHECK BOX with bookmark name "Check1" - my question is how can i change its status to CHECKED (value to show a "X" in the check box) through vfp6.0 code using bookmarks ?
>
>with sincere thanks in advance.

What you're describing are not bookmarks but formfields. ie:
LOCAL oWord,ix
oWord = Createobject("Word.Application")
With oWord
	.Documents.Open( getfile("DOC") ) && open your word doc with formfields in it
	.Visible = .T.
	.Activate
	With .ActiveDocument
		* Get
		For ix = 1 To .FormFields.Count
			? .FormFields(m.ix).Name,.FormFields(m.ix).Result
		Endfor
		* Set
		.FormFields("Text1").Result = "My Text" && assuming these form fields exist
		.FormFields("Check1").Checkbox.Value = .T.
		.FormFields("DropDown1").Result = "My DD" && auto added if not in list
		
		For ix = 1 To .FormFields.Count
			? .FormFields(m.ix).Name,.FormFields(m.ix).Result
		Endfor
	Endwith
Endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform