Windows Package - How to insert a title in Word (e.g. Heading

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Windows Package - How to insert a title in Word (e.g. Heading

JohnD
> Message: 8
> Date: Thu, 9 Nov 2017 01:17:59 -0700 (MST)
> From: Pierluigi <[hidden email]>
> To: [hidden email]
> Subject: Windows Package - How to insert a title.
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=UTF-8
>
> Hi,
>
> I am writing for asking an advice on Windows Package. I am using it so far
with
> satisfaction but I did not find yet the way to insert a title (e.g.
> ?Heading 1?) in Microsoft Word? even if this seems a basic argument.
Common
> Matlab? like commands are not working for this.
> Could you recommend me a solution for this.
>
> I thank you really much in advance.
>
> Best regards,
> Pierluigi


You can use the activex control:

pkg load windows
actxWord = actxserver("Word.Application")
wordHandle = invoke(actxWord.Documents,'Add');
selection = actxWord.Selection
selection.InsertAfter('A heading')
selection.Style = 'Heading 1'
actxWord.visible=true


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Windows Package - How to insert a title in Word (e.g. Heading

Pierluigi
Thanks for your help! Very appreciated.

Thus you confirmed me to use

selection.Style = 'Heading 1'

Therefore, this limit my search on e.g.  the name of 'heading 1' on japanese ms word or using it with

Invoke()

So far this command didn't work on my machine.

Thanks,
Pierluigi



Sent from Blue
On 10 Nov 2017, at 02:52, JohnD <[hidden email]> wrote:
Message: 8
Date: Thu, 9 Nov 2017 01:17:59 -0700 (MST)
From: Pierluigi <[hidden email]>
To: [hidden email]
Subject: Windows Package - How to insert a title.
Message-ID: <1510215479906-0.post@n4.nabble.com>
Content-Type: text/plain; charset=UTF-8

Hi,

I am writing for asking an advice on Windows Package. I am using it so far
with
satisfaction but I did not find yet the way to insert a title (e.g.
?Heading 1?) in Microsoft Word? even if this seems a basic argument.
Common
Matlab? like commands are not working for this.
Could you recommend me a solution for this.

I thank you really much in advance.

Best regards,
Pierluigi


You can use the activex control:

pkg load windows
actxWord = actxserver("Word.Application")
wordHandle = invoke(actxWord.Documents,'Add');
selection = actxWord.Selection
selection.InsertAfter('A heading')
selection.Style = 'Heading 1'
actxWord.visible=true


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Windows Package - How to insert a title in Word (e.g. Heading

JohnD
On 11/09/2017 06:41 PM, Pierluigi Olmati wrote:
Thanks for your help! Very appreciated.

Thus you confirmed me to use

selection.Style = 'Heading 1'

Therefore, this limit my search on e.g.  the name of 'heading 1' on japanese ms word or using it with

Invoke()

So far this command didn't work on my machine.

Thanks,
Pierluigi



Sent from Blue
On 10 Nov 2017, at 02:52, JohnD <[hidden email]> wrote:
Message: 8 Date: Thu, 9 Nov 2017 01:17:59 -0700 (MST) From: Pierluigi [hidden email] To: [hidden email] Subject: Windows Package - How to insert a title. Message-ID: <1510215479906-0.post@n4.nabble.com> Content-Type: text/plain; charset=UTF-8 Hi, I am writing for asking an advice on Windows Package. I am using it so far
with
satisfaction but I did not find yet the way to insert a title (e.g. ?Heading 1?) in Microsoft Word? even if this seems a basic argument.
Common
Matlab? like commands are not working for this. Could you recommend me a solution for this. I thank you really much in advance. Best regards, Pierluigi
You can use the activex control: pkg load windows actxWord = actxserver("Word.Application") wordHandle = invoke(actxWord.Documents,'Add'); selection = actxWord.Selection selection.InsertAfter('A heading') selection.Style = 'Heading 1' actxWord.visible=true


Please post at the bottom of the messages


'Heading 1' is a default expected style in the english/US MS word, so probably needs to be whatever the corresponding style is on your computer.



_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Windows Package - How to insert a title in Word (e.g. Heading

Pierluigi
On 10 Nov 2017, at 09:06, John Donoghue <[hidden email]> wrote:
On 11/09/2017 06:41 PM, Pierluigi Olmati wrote:
Thanks for your help! Very appreciated.

Thus you confirmed me to use

selection.Style = 'Heading 1'

Therefore, this limit my search on e.g.  the name of 'heading 1' on japanese ms word or using it with

Invoke()

So far this command didn't work on my machine.

Thanks,
Pierluigi



Sent from Blue
On 10 Nov 2017, at 02:52, JohnD < [hidden email]> wrote:
    
Message: 8 Date: Thu, 9 Nov 2017 01:17:59 -0700 (MST) From: Pierluigi [hidden email] To: [hidden email] Subject: Windows Package - How to insert a title. Message-ID: < 1510215479906-0.post@n4.nabble.com> Content-Type: text/plain; charset=UTF-8 Hi, I am writing for asking an advice on Windows Package. I am using it so far
with
satisfaction but I did not find yet the way to insert a title (e.g. ?Heading 1?) in Microsoft Word? even if this seems a basic argument.
Common
Matlab? like commands are not working for this. Could you recommend me a solution for this. I thank you really much in advance. Best regards, Pierluigi
You can use the activex control: pkg load windows actxWord = actxserver("Word.Application") wordHandle = invoke(actxWord.Documents,'Add'); selection = actxWord.Selection selection.InsertAfter('A heading') selection.Style = 'Heading 1' actxWord.visible=true


Please post at the bottom of the messages


'Heading 1' is a default expected style in the english/US MS word, so probably needs to be whatever the corresponding style is on your computer.


Hi,

I am able to confirm that 

Selection.Style='Name of the style' 

works. In my case I had to make new styles named in roman letters because we cannot use kanji in octave isn't it. 

Thanks for your help.

Cheers,

Pierluigi



_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave