Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

PLUG IT IN!!!


devel / comp.lang.xharbour / Detecting multi image in word document

SubjectAuthor
* Detecting multi image in word documentSilvester Roklasfonoshio
`* Re: Detecting multi image in word documentdlzc
 `* Re: Detecting multi image in word documentSilvester Roklasfonoshio
  `- Re: Detecting multi image in word documentSilvester Roklasfonoshio

1
Detecting multi image in word document

<07dc7254-3b9f-4eb3-b97e-c639f65b7538n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:620a:1994:b0:74a:505:b63 with SMTP id bm20-20020a05620a199400b0074a05050b63mr1560102qkb.13.1680727360628;
Wed, 05 Apr 2023 13:42:40 -0700 (PDT)
X-Received: by 2002:a05:6870:8a22:b0:17e:5bc4:9ac9 with SMTP id
p34-20020a0568708a2200b0017e5bc49ac9mr3607528oaq.10.1680727360420; Wed, 05
Apr 2023 13:42:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!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: Wed, 5 Apr 2023 13:42:40 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=151.115.51.214; posting-account=G9HqrgoAAACi-ufhlCxUzveXrXQInSsc
NNTP-Posting-Host: 151.115.51.214
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <07dc7254-3b9f-4eb3-b97e-c639f65b7538n@googlegroups.com>
Subject: Detecting multi image in word document
From: roklasfonoshio@gmail.com (Silvester Roklasfonoshio)
Injection-Date: Wed, 05 Apr 2023 20:42:40 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1855
 by: Silvester Roklasfono - Wed, 5 Apr 2023 20:42 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 more than one image

Re: Detecting multi image in word document

<8a271674-97b8-44fb-9f7b-1599aa7ec82bn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:620a:2804:b0:746:99e0:92b4 with SMTP id f4-20020a05620a280400b0074699e092b4mr2770039qkp.5.1680797233278;
Thu, 06 Apr 2023 09:07:13 -0700 (PDT)
X-Received: by 2002:a05:6871:214:b0:177:b258:5a06 with SMTP id
t20-20020a056871021400b00177b2585a06mr4919316oad.8.1680797233046; Thu, 06 Apr
2023 09:07:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.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: Thu, 6 Apr 2023 09:07:12 -0700 (PDT)
In-Reply-To: <07dc7254-3b9f-4eb3-b97e-c639f65b7538n@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: <07dc7254-3b9f-4eb3-b97e-c639f65b7538n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8a271674-97b8-44fb-9f7b-1599aa7ec82bn@googlegroups.com>
Subject: Re: Detecting multi image in word document
From: dlzc1@cox.net (dlzc)
Injection-Date: Thu, 06 Apr 2023 16:07:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2478
 by: dlzc - Thu, 6 Apr 2023 16:07 UTC

On Wednesday, April 5, 2023 at 1:42:41 PM UTC-7, Silvester Roklasfonoshio wrote:
> 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 more than one image

You are copying from oWord, and creating and instance in oImgs, but then...
> oWord:Selection:Paste()

Is that right? I don't do this, so I don't see how you are directing output images to oImgs... just throwing it at the Word.Application and hoping for it to know what you meant to happen.

David A. Smith

Re: Detecting multi image in word document

<0b96d3aa-146c-43b9-8d38-c3600acff3b6n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ac8:7d16:0:b0:3d2:8d87:6710 with SMTP id g22-20020ac87d16000000b003d28d876710mr72813qtb.12.1680816654203;
Thu, 06 Apr 2023 14:30:54 -0700 (PDT)
X-Received: by 2002:a05:6808:919:b0:389:95ac:61ba with SMTP id
w25-20020a056808091900b0038995ac61bamr56879oih.1.1680816653933; Thu, 06 Apr
2023 14:30:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!newsfeed.hasname.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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: Thu, 6 Apr 2023 14:30:53 -0700 (PDT)
In-Reply-To: <8a271674-97b8-44fb-9f7b-1599aa7ec82bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=151.115.51.214; posting-account=G9HqrgoAAACi-ufhlCxUzveXrXQInSsc
NNTP-Posting-Host: 151.115.51.214
References: <07dc7254-3b9f-4eb3-b97e-c639f65b7538n@googlegroups.com> <8a271674-97b8-44fb-9f7b-1599aa7ec82bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0b96d3aa-146c-43b9-8d38-c3600acff3b6n@googlegroups.com>
Subject: Re: Detecting multi image in word document
From: roklasfonoshio@gmail.com (Silvester Roklasfonoshio)
Injection-Date: Thu, 06 Apr 2023 21:30:54 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3386
 by: Silvester Roklasfono - Thu, 6 Apr 2023 21:30 UTC

في الخميس، 6 أبريل 2023 في تمام الساعة 8:07:14 م UTC+4، كتب dlzc رسالة نصها:
> On Wednesday, April 5, 2023 at 1:42:41 PM UTC-7, Silvester Roklasfonoshio wrote:
> > 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 more than one image
> You are copying from oWord, and creating and instance in oImgs, but then....
> > oWord:Selection:Paste()
>
> Is that right? I don't do this, so I don't see how you are directing output images to oImgs... just throwing it at the Word.Application and hoping for it to know what you meant to happen.
>
> David A. Smith
Thank you very much for your answer my dear brother ...it works perfectly with one image i mean when the word document has one image it can correctly extract that image and paste it in new word document but when the document has more than one image it just paste the first image and give me the previous error i show you previously :
Error 121896500/0 S_OK: PASTE
and i dont know why ? so what do suggest ? where is the problem exactly ?

Re: Detecting multi image in word document

<b6889689-e31d-4b03-9272-4a64b3659f00n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:622a:394:b0:3d7:9d03:75b0 with SMTP id j20-20020a05622a039400b003d79d0375b0mr1194972qtx.13.1680901239984;
Fri, 07 Apr 2023 14:00:39 -0700 (PDT)
X-Received: by 2002:a05:6870:d355:b0:17e:71a3:e509 with SMTP id
h21-20020a056870d35500b0017e71a3e509mr1691895oag.8.1680901239765; Fri, 07 Apr
2023 14:00:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!newsfeed.hasname.com!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: Fri, 7 Apr 2023 14:00:39 -0700 (PDT)
In-Reply-To: <0b96d3aa-146c-43b9-8d38-c3600acff3b6n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=139.162.85.184; posting-account=G9HqrgoAAACi-ufhlCxUzveXrXQInSsc
NNTP-Posting-Host: 139.162.85.184
References: <07dc7254-3b9f-4eb3-b97e-c639f65b7538n@googlegroups.com>
<8a271674-97b8-44fb-9f7b-1599aa7ec82bn@googlegroups.com> <0b96d3aa-146c-43b9-8d38-c3600acff3b6n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b6889689-e31d-4b03-9272-4a64b3659f00n@googlegroups.com>
Subject: Re: Detecting multi image in word document
From: roklasfonoshio@gmail.com (Silvester Roklasfonoshio)
Injection-Date: Fri, 07 Apr 2023 21:00:39 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3898
 by: Silvester Roklasfono - Fri, 7 Apr 2023 21:00 UTC

في الجمعة، 7 أبريل 2023 في تمام الساعة 1:30:55 ص UTC+4، كتب Silvester Roklasfonoshio رسالة نصها:
> في الخميس، 6 أبريل 2023 في تمام الساعة 8:07:14 م UTC+4، كتب dlzc رسالة نصها:
> > On Wednesday, April 5, 2023 at 1:42:41 PM UTC-7, Silvester Roklasfonoshio wrote:
> > > 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 more than one image
> > You are copying from oWord, and creating and instance in oImgs, but then...
> > > oWord:Selection:Paste()
> >
> > Is that right? I don't do this, so I don't see how you are directing output images to oImgs... just throwing it at the Word.Application and hoping for it to know what you meant to happen.
> >
> > David A. Smith
> Thank you very much for your answer my dear brother ...it works perfectly with one image i mean when the word document has one image it can correctly extract that image and paste it in new word document but when the document has more than one image it just paste the first image and give me the previous error i show you previously :
> Error 121896500/0 S_OK: PASTE
> and i dont know why ? so what do suggest ? where is the problem exactly ?
Iam still waiting for your answer my dear brother .

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor