Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #11554 > unrolled thread

Formatting strings for MS-Word

Started byglados.1964@gmail.com
First post2018-04-23 11:58 -0700
Last post2018-04-25 03:57 -0700
Articles 4 — 3 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Formatting strings for MS-Word glados.1964@gmail.com - 2018-04-23 11:58 -0700
    Re: Formatting strings for MS-Word dlzc <dlzc1@cox.net> - 2018-04-23 12:06 -0700
    Re: Formatting strings for MS-Word "Wolfgang Riedmann" <wriedmann@gmail.com> - 2018-04-24 13:44 +0200
    Re: Formatting strings for MS-Word glados.1964@gmail.com - 2018-04-25 03:57 -0700

#11554 — Formatting strings for MS-Word

Fromglados.1964@gmail.com
Date2018-04-23 11:58 -0700
SubjectFormatting strings for MS-Word
Message-ID<0a78b658-58b7-49d2-9906-65fe70ab3dee@googlegroups.com>
Hi,

One of our applicatins uses MS-Word to printout some simple data. For this MS-Word is opened (via OLEAutoObject{'word.application'}) and a template is loaded (oword:documents:add(template)). Then some strings are send to the Word document (oword:selection:Find:Execute). This works good for our needs. The resulting text is formatted (like bold/italic) as defined in the template.

Now our IT-departement moved this application to a VM on a server. On this server there is no MS-Word (or any MS-office products) allowed.
As a (partly) solution we are now copying the strings programmatically to the clipboard which enables us (via remote desktop on a local computer) to paste it in a MS Word document again. Only thing that remains is that the formatting is lost.

The question is; Does anybody know if the strings can modified in some way to do  some simple formatting? Like bold and italic would be fine.


TIA,

Jack

[toc] | [next] | [standalone]


#11555

Fromdlzc <dlzc1@cox.net>
Date2018-04-23 12:06 -0700
Message-ID<42d2cc42-602a-4dc4-b465-0d025cf811e5@googlegroups.com>
In reply to#11554
Dear glado...:

On Monday, April 23, 2018 at 11:58:47 AM UTC-7, glado...@gmail.com wrote:
...
> The question is; Does anybody know if the strings
> can modified in some way to do some simple
> formatting? Like bold and italic would be fine.

Can you do these documents in XML / HTML, and simply do a find/replace on the tags?  That way the formatting is in unaffected tag-pairs.

David A. Smith

[toc] | [prev] | [next] | [standalone]


#11556

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2018-04-24 13:44 +0200
Message-ID<fk8jleF4o2cU1@mid.individual.net>
In reply to#11554
Hi Jack,

this should be possible copying RTF strings. Unfortunately I don't know
how they need to be formatted to be recognized as them.

Also browsers copy formatting to che clipboard sometimes, so it should
be possible.

Wolfgang

glados.1964@gmail.com wrote:

> Hi,
> 
> One of our applicatins uses MS-Word to printout some simple data. For
> this MS-Word is opened (via OLEAutoObject{'word.application'}) and a
> template is loaded (oword:documents:add(template)). Then some strings
> are send to the Word document (oword:selection:Find:Execute). This
> works good for our needs. The resulting text is formatted (like
> bold/italic) as defined in the template.
> 
> Now our IT-departement moved this application to a VM on a server. On
> this server there is no MS-Word (or any MS-office products) allowed.
> As a (partly) solution we are now copying the strings
> programmatically to the clipboard which enables us (via remote
> desktop on a local computer) to paste it in a MS Word document again.
> Only thing that remains is that the formatting is lost.
> 
> The question is; Does anybody know if the strings can modified in
> some way to do  some simple formatting? Like bold and italic would be
> fine.
> 
> 
> TIA,
> 
> Jack



-- 

[toc] | [prev] | [next] | [standalone]


#11560

Fromglados.1964@gmail.com
Date2018-04-25 03:57 -0700
Message-ID<5c5ce8c2-3366-4651-b674-dd4152942394@googlegroups.com>
In reply to#11554
On Monday, April 23, 2018 at 8:58:47 PM UTC+2, glado...@gmail.com wrote:
> Hi,
> 
> One of our applicatins uses MS-Word to printout some simple data. For this MS-Word is opened (via OLEAutoObject{'word.application'}) and a template is loaded (oword:documents:add(template)). Then some strings are send to the Word document (oword:selection:Find:Execute). This works good for our needs. The resulting text is formatted (like bold/italic) as defined in the template.
> 
> Now our IT-departement moved this application to a VM on a server. On this server there is no MS-Word (or any MS-office products) allowed.
> As a (partly) solution we are now copying the strings programmatically to the clipboard which enables us (via remote desktop on a local computer) to paste it in a MS Word document again. Only thing that remains is that the formatting is lost.
> 
> The question is; Does anybody know if the strings can modified in some way to do  some simple formatting? Like bold and italic would be fine.
> 
> 
> TIA,
> 
> Jack


OK, found it. The clue is to compose a RTF string and put this on the clipboard as an RTF string like:

	s_out:="{\rtf1\ansi\deff0 {\fonttbl {\f0 Arial;}}"  
	s_out+="{\f0\fs22\b "
	s_out+=DToC(SELF:oInspect:DATUMINS)
	s_out+="}"           
	s_out+="{\f0\fs22 "	
	s_out+=tab+AllTrim(oInspect:PLS_MTP)+': '+AllTrim(SELF:oInspect:OPM)
	s_out+="}"	
	s_out+="\line "
	s_out+="\line "

	s_appl:=SELF:PB_INS_Send_GetList()
	s_appl:=StrTran(s_appl, '^p', '\line ')		//opmaakcodes t.b.v. MS Word weghalen

	IF SLen(s_appl)>0								//alleen indien meetpunten zijn geinspecteerd
		s_out+="{\f0\fs16\i "	
		s_out+="Geïnspecteerde applicaties:"
		s_out+="\line "
		s_out+=s_appl  
		s_out+="\line " 
		s_out+="}"
	ENDIF        
	s_out+="}"

	oclip:=Clipboard{}
	oclip:Clear()
	oclip:InsertRTF(s_out)

Works really good....


Thanks for the input.

Greetings,

Jack

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web