Update a graphic automatically

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Update a graphic automatically

Post by Robie »

I think the answer is probably no but I will just ask anyway.

I have created a template for the training department where there logo keeps changing based on the level they are at, (external accreditation) . e.g. starts with bronze border, then moves to silver, then to gold and so on. So what happens is that I have to physically update each document created using the training template everytime the logo colour changes :-( (which is a pain). We have lots of training courses.

They have just moved from bronze to silver. SO now I have to update each course to use the new logo - only difference is the border. I suppose, when they pass the next level accreditation, the logo on the training couse notes changes to gold - so I have to go through the same exercise again. Therefore the question: is there anyway I can keep the image external to the document (e.g. in the template) so that it is updated automatically when the document is opened, i,e, therefore the suggestion of using the custom properties.

Is there a way of 'automatically' updating an image in a document? Similar to udpating fields in a document, e.g. if we use the standard builtin SAVEDATE then it updates it in the document when it is saved. Or for that matter any custom properties field used in a document. I guess what I am asking is that could I use something like custom document properties to define an image and then update the automatically whenever that image is updated in the template.

Thanks. Robie

User avatar
HansV
Administrator
Posts: 78492
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Update a graphic automatically

Post by HansV »

If the documents are for internal use, you could link to a picture stored on a shared network drive instead of using an embedded picture.. That way, you only need to replace the picture on the network drive, and all documents with a link to the picture will be updated automatically.
If you need to send the document to an external recipient, you can break the link, so that the picture becomes a static embedded picture.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15624
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Update a graphic automatically

Post by ChrisGreaves »

Robie wrote:I think the answer is probably no but I will just ask anyway.
Bzzzzzz!
The answer is always YES!

FWIW I wrote some Word2000/VBA code a year ago that absorbs an image file into a macro within the application. The image is stored as a string representation of the ascii codes of a (say) JPEG file, and doesn't seem to take up an exorbitant amount of space.
In my case I had to generate an appropriate graphic to sit in a table, so I generated the JPG file on-the-fly from the internal ascii codes then inserted it into a table.

If I understand your case, you want to generate an appropriate image (bronze, Silver, Gold etc) according to a real-time code; you might then just invoke the function offering the level as a parameter; the function would insert the appropriate image.

No image files need be installed or need remain on the user system.
If you'd like to use it I'll package it up; may take a day or two; it's been a year .....
There's nothing heavier than an empty water bottle

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Update a graphic automatically

Post by Robie »

ChrisGreaves wrote:
Robie wrote:I think the answer is probably no but I will just ask anyway.
Bzzzzzz!
The answer is always YES!

FWIW I wrote some Word2000/VBA code a year ago that absorbs an image file into a macro within the application. The image is stored as a string representation of the ascii codes of a (say) JPEG file, and doesn't seem to take up an exorbitant amount of space.
In my case I had to generate an appropriate graphic to sit in a table, so I generated the JPG file on-the-fly from the internal ascii codes then inserted it into a table.

If I understand your case, you want to generate an appropriate image (bronze, Silver, Gold etc) according to a real-time code; you might then just invoke the function offering the level as a parameter; the function would insert the appropriate image.

No image files need be installed or need remain on the user system.
If you'd like to use it I'll package it up; may take a day or two; it's been a year .....
Hi Chris,

Yes, definitely interested. If you can find it and package it up then I would be very grateful. A BIG thanks.

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Update a graphic automatically

Post by Robie »

HansV wrote:If the documents are for internal use, you could link to a picture stored on a shared network drive instead of using an embedded picture.. That way, you only need to replace the picture on the network drive, and all documents with a link to the picture will be updated automatically.
If you need to send the document to an external recipient, you can break the link, so that the picture becomes a static embedded picture.
Hans, thanks for your response. That was indeed my worry of sending the document externally. For time being I have embedded the image into the template and update each training document so that the new image is displayed (what a chore - boring). I guess, I will just have to update all training documents all over again when they move to the next colour :-(

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15624
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Update a graphic automatically

Post by ChrisGreaves »

Robie wrote:If you can find it and package it up then I would be very grateful.
Hi Robie, and I apologize for the delay. Some paid work came up, and as you know, dollars are MUCH more important than friends (grin!).
I hope to get around to digging out the code mid-week, and I will post back in this thread when it is available.
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15624
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Update a graphic automatically

Post by ChrisGreaves »

Robie wrote:If you can find it and package it up then I would be very grateful.
Well, OK then. If you insist (grin!)

Robie, thanks again for the nudge.
8:30 a.m. here.
I've found the code and run it to a successful conclusion.
I want to spend an hour or two removing client-relevant code, and then compile a web page that describes it for you, but we are well on our way.

Just so you know:
As a developer:
You run a macro "TESTMakeImagesmacro"
Which solicits a few image files from you via a browser dialog box
Then solicits a target template from you via a browser dialog box
Then generates macro(s), one per image, and drops them into your target template.

As an end-user
You run one of the generated macros
Which dumps a graphic image at the current selection point.

The original scheme was for one of a set of small images to be loaded into the header of a document.
There's nothing heavier than an empty water bottle

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Update a graphic automatically

Post by Robie »

ChrisGreaves wrote:
Robie wrote:If you can find it and package it up then I would be very grateful.
Well, OK then. If you insist (grin!)

Robie, thanks again for the nudge.
8:30 a.m. here.
I've found the code and run it to a successful conclusion.
I want to spend an hour or two removing client-relevant code, and then compile a web page that describes it for you, but we are well on our way.

Just so you know:
As a developer:
You run a macro "TESTMakeImagesmacro"
Which solicits a few image files from you via a browser dialog box
Then solicits a target template from you via a browser dialog box
Then generates macro(s), one per image, and drops them into your target template.

As an end-user
You run one of the generated macros
Which dumps a graphic image at the current selection point.

The original scheme was for one of a set of small images to be loaded into the header of a document.
This would be of great use to me Chris. Very much obliged.
THANK YOU VERY MUCH.

Robie

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15624
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Update a graphic automatically

Post by ChrisGreaves »

Robie wrote:Very much obliged.
Well, Robie, I'm glad you feel that way, because ... :evilgrin:

I'm nearly done.
I'm testing the stripped-down code as we squeak.
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15624
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Update a graphic automatically

Post by ChrisGreaves »

Robie wrote:This would be of great use to me Chris. Very much obliged. Robie
Here you go.
http://www.chrisgreaves.com/Images/index.htm
Comments welcome.
There's nothing heavier than an empty water bottle

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Update a graphic automatically

Post by Robie »

ChrisGreaves wrote:
Robie wrote:This would be of great use to me Chris. Very much obliged. Robie
Here you go.
http://www.chrisgreaves.com/Images/index.htm
Comments welcome.
Thank you very much Chris. I won't get a chance to try it out for a while (as I will be away from Work for about 2 weeks) but will let you know how I get on.

Thanks again.