Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Automation
Message
From
19/09/2006 13:23:44
 
 
To
19/09/2006 12:58:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP SP1
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01155157
Message ID:
01155173
Views:
22
Hi Curtis,

not sure why you are using Word.Basic, I think that was for a very old version of Word. You could try this code, it may get you started:
oword = CREATEOBJECT("word.application")
oword.Documents.Add()
oword.ActiveDocument.Range.Bold=.t.
oword.Visible = .t.
>I know this is a stupid question but then again most of mine are.
>How in the world to you change font ie. .bold=.t.
>I have tried numerouse way to toggle the font from regular to bold and I always get an error.
>I.e. .font.bold=.t. (error)
> .bold=.t. (error)
> .app.format.font.bold=.t. (error) ETC
>
>
>Any help would be greatly appreciated
>Thanks
>
>PUBLIC oWord,oselection,x
> x=1
>    oWord = CREATEOBJECT("Word.Basic")
>*    oselection=oword.selection
>    WITH oWord
>*       .AppShow        && Makes Wor Visible
>       .FileNewDefault && Opens up blank Word document
>
>
>          .Insert(DTOC(DATE())+" "+TIME())
>            && The above line shows the record number.
>          .InsertPara
>          .InsertPara
>		
>       	  	  .Insert(ALLTRIM(m.company_name))   && Field in the table.
>	          .InsertPara
>	          .Insert(m.company_address)
>	          .InsertPara
>	          .Insert(ALLTRIM(m.company_city)+", "+m.company_st+"  "+m.company_zip)
>	          .InsertPara
>	          .InsertPara
>	          .Insert("Separation Information Report")
>	          .InsertPara
>	          .Insert(ALLTRIM(cr_empl.first)+" "+ALLTRIM(cr_empl.lname))
>	          .InsertPara
>	          .INSERT("SSN   "+SUBSTR(cr_empl.empno,1,3)+'-'+SUBSTR(cr_empl.empno,4,2)+'-'+SUBSTR(cr_empl.empno,6,4))
>	          .InsertPara
>	          .InsertPara
>			  .Insert("Assignment History")
>			  .InsertPara
>			  .Insert(massignment)
>			  .Insertpagebreak
>			  .Insert("Contact History")
>			  .InsertPara
>			  .Insert(mreportcontact)
>*			  .Insertpagebreak
>			  .Insert("General Employee Notes")
>			  .Insertpara
>			  .Insert(cr_empl.interview_comm)
>			
>    		  .FileSaveAs(mfile)
>    		  PRIVATE manswer
>    		  IF x=1
>    		  	manswer=MESSAGEBOX('Would you like to print a copy of this report?',4+32)  && mfile declared in usexpress
>    		  ENDIF
>              IF manswer=6 AND x=1
>              	.fileprint
>              	x=x+1
>              ENDIF
>
>	       .AppClose
>    ENDWITH
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform