Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

How to add a custom hidden object into MS Word Document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ahmad Jalil Qarshi - 18 Feb 2005 10:48 GMT
hi!

i am working in VC7. I want to add a custom object (Image+Data) into the MS
Word Document. The Data will be something related to the image i.e name of
the image, format details etc and will be linked to the image shown on the
word document. Further more the data will be hidden. i.e. not visible to the
viewer of the document.

i have added the image into the Word document using the following code.

VARIANT var1; VariantInit(&var1);

VARIANT var2; VariantInit(&var2);

var1.vt = VT_BOOL; var1.boolVal = true; //SaveWithDocument

var2.vt = VT_BOOL; var2.boolVal = false; //LinkToFile

spSelect->InlineShapes->AddPicture("C:\\Documents and
Settings\\ahmadjalil\\My Documents\\My Pictures\\Sample.jpg",&var2,&var1);

VariantClear(&var1); VariantClear(&var2);

where spSelect is smart pointer of type Selection Object.

if some one knows about that. Please help me.

Thanks in advance.

Ahmad Jalil Qarshi
Jean-Guy Marcil - 18 Feb 2005 16:32 GMT
Ahmad Jalil Qarshi was telling us:
Ahmad Jalil Qarshi nous racontait que :

> hi!
>
[quoted text clipped - 3 lines]
> image shown on the word document. Further more the data will be
> hidden. i.e. not visible to the viewer of the document.

From the look of your code, that is not a beginner query!

I do not think that you can associate metadata with a picture in Word,
unless, maybe, that you use an XML document.

Here are 3 ideas anyways:

1) Add the text next to the picture and format it as Hidden (Font dialog).
It will only be visible if the user clicks on Show All (?) and is not
printed by default.

2) For very picture you insert, create a text custom property to store the
info.

3) For every picture you insert create a document variable to store the
information.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Jean-Guy Marcil - 18 Feb 2005 16:34 GMT
Ahmad Jalil Qarshi was telling us:
Ahmad Jalil Qarshi nous racontait que :

> hi!
>
[quoted text clipped - 3 lines]
> image shown on the word document. Further more the data will be
> hidden. i.e. not visible to the viewer of the document.

Please do not multipost.

If you want  you can crosspost (Many newsgroups in the To: field when you
create your message.)

The reason is simple:
People may end up "wasting" their time answering a post that has already
been answered elsewhere, thus it may be very likely that their particular
response to a post be totally ignored if the reply received elsewhere was
satisfactory to the original poster.
Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org 

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.