Jump to content

Recommended Posts

Posted (edited)

How to change the font type and size in MSWORD?

(vl-load-com) 
(IF (NOT TBLWORD)
   (PROGN
   (SETQ TBLWORD (STRCAT #DRV "MSWORD.OLB"))
   (vlax-import-type-library 
        :tlb-filename TBLWORD 
        :methods-prefix "VBWORDm-" 
        :properties-prefix "VBWORDp-" 
        :constants-prefix "VBWORDc-" 
   )
   )
)
(SETQ VBWORD (vlax-get-or-create-object "Word.Application")) 
(vla-put-visible VBWORD :vlax-true)
(SETQ DOCS (vla-get-documents VBWORD)) 
(setq DOC  (VBWORDm-add DOCS)) 
(SETQ paragraphs (VBWORDp-get-paragraphs doc))
(setq pg (VBWORDp-get-last paragraphs)) 
(setq range (VBWORDp-get-range pg)) 

(setq TEXTO1 "1a LINHA DE TEXTO\n")
(setq TEXTO2 "2a LINHA DE TEXTO\n")
(setq TEXTO3 "3a LINHA DE TEXTO\n")
;
(VBWORDp-put-fontname "COURIER NEW") ;????????????????????????????????
(VBWORDp-put-fontsize range "20")    ;?????????????????????????????????????
;
(VBWORDp-put-bold range 1)
(VBWORDp-put-underline range VBWORDc-wdUnderlineNone) 
(VBWORDm-InsertAfter range "MEMORIAL DESCRITIVO\n")
(VBWORDm-InsertAfter range "\n")
(VBWORDm-InsertAfter range TEXTO1)
(VBWORDm-InsertAfter range TEXTO2)
(VBWORDm-InsertAfter range TEXTO3)

 

thank you.

Edited by SLW210
Add code tags
Posted

Try this code

 
(VBWORDp-put-name (VBWORDp-get-font range ) "COURIER NEW") 
(VBWORDp-put-size (VBWORDp-get-font range ) 18)

 

~'J'~

Posted

I looked all over the internet for several days and I found this tip.

 

Thank you.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...