Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

6 May, 2024: The networking issue during the past two days has been identified and appears to be fixed. Will keep monitoring.


devel / comp.lang.xharbour / Re: Detecting Multi images in word document part 2

SubjectAuthor
* Detecting Multi images in word document part 2Silvester Roklasfonoshio
`* Detecting Multi images in word document part 2dlzc
 `- Detecting Multi images in word document part 2Silvester Roklasfonoshio

1
Detecting Multi images in word document part 2

<b768f837-b313-4f38-ac70-0acd069c8086n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10837&group=comp.lang.xharbour#10837

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ac8:5849:0:b0:3f2:2ac7:cda9 with SMTP id h9-20020ac85849000000b003f22ac7cda9mr1073708qth.11.1683055247461;
Tue, 02 May 2023 12:20:47 -0700 (PDT)
X-Received: by 2002:a05:6870:c8e:b0:187:c889:cb01 with SMTP id
mn14-20020a0568700c8e00b00187c889cb01mr6694765oab.6.1683055247211; Tue, 02
May 2023 12:20:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Tue, 2 May 2023 12:20:46 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=139.162.3.81; posting-account=G9HqrgoAAACi-ufhlCxUzveXrXQInSsc
NNTP-Posting-Host: 139.162.3.81
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b768f837-b313-4f38-ac70-0acd069c8086n@googlegroups.com>
Subject: Detecting Multi images in word document part 2
From: roklasfo...@gmail.com (Silvester Roklasfonoshio)
Injection-Date: Tue, 02 May 2023 19:20:47 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Silvester Roklasfono - Tue, 2 May 2023 19:20 UTC

Hi everybody i have implemented this code to detect more than one image:
#define Word_File hb_dirbase() + "MyFileTxt.docx"
procedure Main
local oWord
local oDoc
local oImgs
local oShape
oWord := Win_OleCreateObject( "Word.Application" )
oWord:Visible := .T.
oDoc := oWord:documents:open( Word_File )
if oDoc:InlineShapes:Count > 0

oImgs := oWord:Documents:Add()
for each oShape in oDoc:InlineShapes

oShape:Range:CopyAsPicture()
oImgs:Paragraphs:Add()
oWord:Selection:Paste()
endfor
endif
oWord := NIL
return

it just only works with one image and when i tested with more than one image i got this erroe:
Error 121896500/0 S_OK: PASTE

why and how i can modify this code to make it able to work with one word document contains multiple images .

Re: Detecting Multi images in word document part 2

<6eea1a56-36cd-476c-ab96-e53c6cb95ed3n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10838&group=comp.lang.xharbour#10838

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:620a:13b5:b0:74e:3542:f23d with SMTP id m21-20020a05620a13b500b0074e3542f23dmr3126038qki.11.1683056860405;
Tue, 02 May 2023 12:47:40 -0700 (PDT)
X-Received: by 2002:a05:6830:3a8d:b0:6a9:37d3:14b2 with SMTP id
dj13-20020a0568303a8d00b006a937d314b2mr3295029otb.5.1683056860049; Tue, 02
May 2023 12:47:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Tue, 2 May 2023 12:47:39 -0700 (PDT)
In-Reply-To: <b768f837-b313-4f38-ac70-0acd069c8086n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=68.107.209.13; posting-account=7bF0GwoAAABMFHX6V4fON4-1F6LFJ834
NNTP-Posting-Host: 68.107.209.13
References: <b768f837-b313-4f38-ac70-0acd069c8086n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6eea1a56-36cd-476c-ab96-e53c6cb95ed3n@googlegroups.com>
Subject: Re: Detecting Multi images in word document part 2
From: dlz...@cox.net (dlzc)
Injection-Date: Tue, 02 May 2023 19:47:40 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2225
 by: dlzc - Tue, 2 May 2023 19:47 UTC

On Tuesday, May 2, 2023 at 12:20:48 PM UTC-7, Silvester Roklasfonoshio wrote:
> why and how i can modify this code to make it able to
> work with one word document contains multiple images .

Can you automate this instead?
https://support.microsoft.com/en-us/topic/wd-how-to-extract-embedded-images-from-a-word-document-f478bf7f-3bba-6afb-6ddc-3eeb284af36b
.... the images will autoextracted and placed in a directory.

Mostly what I see is "OLE cannot do this".
https://www.google.com/search?q=word+%22ole%22+extract+multiple+images+site%3Amicrosoft.com&lr=&safe=images&as_qdr=all&ei=TmdRZMb6KsS_kPIPxsWZ8A8&ved=0ahUKEwjG2eL0sdf-AhXEH0QIHcZiBv4Q4dUDCA8&uact=5&oq=word+%22ole%22+extract+multiple+images+site%3Amicrosoft.com&gs_lcp=Cgxnd3Mtd2l6LXNlcnAQA0oECEEYAVCIC1jgG2DKImgBcAB4AIABYIgBuAGSAQEymAEAoAEBwAEB&sclient=gws-wiz-serp#ip=1

David A. Smith

Re: Detecting Multi images in word document part 2

<06d2f2a4-b8c3-4bbf-a06e-6407761a563en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10860&group=comp.lang.xharbour#10860

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:620a:4056:b0:759:3297:5774 with SMTP id i22-20020a05620a405600b0075932975774mr731660qko.8.1684004332864;
Sat, 13 May 2023 11:58:52 -0700 (PDT)
X-Received: by 2002:a05:6830:1349:b0:6a3:c42f:b653 with SMTP id
r9-20020a056830134900b006a3c42fb653mr4367755otq.5.1684004332346; Sat, 13 May
2023 11:58:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Sat, 13 May 2023 11:58:52 -0700 (PDT)
In-Reply-To: <6eea1a56-36cd-476c-ab96-e53c6cb95ed3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=139.177.182.190; posting-account=G9HqrgoAAACi-ufhlCxUzveXrXQInSsc
NNTP-Posting-Host: 139.177.182.190
References: <b768f837-b313-4f38-ac70-0acd069c8086n@googlegroups.com> <6eea1a56-36cd-476c-ab96-e53c6cb95ed3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <06d2f2a4-b8c3-4bbf-a06e-6407761a563en@googlegroups.com>
Subject: Re: Detecting Multi images in word document part 2
From: roklasfo...@gmail.com (Silvester Roklasfonoshio)
Injection-Date: Sat, 13 May 2023 18:58:52 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3748
 by: Silvester Roklasfono - Sat, 13 May 2023 18:58 UTC

في الثلاثاء، 2 مايو 2023 في تمام الساعة 11:47:41 م UTC+4، كتب dlzc رسالة نصها:
> On Tuesday, May 2, 2023 at 12:20:48 PM UTC-7, Silvester Roklasfonoshio wrote:
> > why and how i can modify this code to make it able to
> > work with one word document contains multiple images .
> Can you automate this instead?
> https://support.microsoft.com/en-us/topic/wd-how-to-extract-embedded-images-from-a-word-document-f478bf7f-3bba-6afb-6ddc-3eeb284af36b
> ... the images will autoextracted and placed in a directory.
>
> Mostly what I see is "OLE cannot do this".
> https://www.google.com/search?q=word+%22ole%22+extract+multiple+images+site%3Amicrosoft.com&lr=&safe=images&as_qdr=all&ei=TmdRZMb6KsS_kPIPxsWZ8A8&ved=0ahUKEwjG2eL0sdf-AhXEH0QIHcZiBv4Q4dUDCA8&uact=5&oq=word+%22ole%22+extract+multiple+images+site%3Amicrosoft.com&gs_lcp=Cgxnd3Mtd2l6LXNlcnAQA0oECEEYAVCIC1jgG2DKImgBcAB4AIABYIgBuAGSAQEymAEAoAEBwAEB&sclient=gws-wiz-serp#ip=1
>
> David A. Smith
Thank you for your answer my dear brother i have successed in doing that by modifing the code little bit to become as follow :
#define Word_File hb_dirbase() + "MyFileTxt.docx"
#define msoLinkedPicture 11 // Linked picture.
#define msoPicture 13 // Picture.

procedure Main
local oWord
local oDoc
local oImgs
local oShape
setmode( 43, 80 )

oWord := Win_OleCreateObject( "Word.Application" )
oWord:Visible := .T.
oDoc := oWord:documents:open( Word_File,, .T. )
if oDoc:Shapes:Count > 0
for each oShape in oDoc:Shapes
if oShape:Type == msoLinkedPicture .or. oShape:Type == msoPicture
oShape:ConvertToInlineShape()
endif
endfor
endif

if oDoc:InlineShapes:Count > 0
oImgs := oWord:Documents:Add()
for each oShape in oDoc:InlineShapes
oShape:Range:CopyAsPicture()
oImgs:Paragraphs:Add()
oWord:Selection:Paste()
oImgs:Paragraphs:Add()
endfor
endif
oWord := nil
return
// end code.
it now works perfectly just i want one more thing which is how we can know the location of each photo in the word document ?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor