Reply
 
Thread Tools Display Modes
  #1   Report Post  
?yvind Blom
 
Posts: n/a
Default Unlinking large number of images with macro in Word 97

I have a word document with 150 pages and 250 images. All the images
are linked from a sub-directory to the document and not saved within
the file. I want to split this file into serveral smaller documents
that are
to be published in Sharepoint 2003 with each image saved within the
file, nor extracted or outside.

The images are graphics formatted with text wrap (float over text)?
The only way to edit or remove the links is to (remove the "float")
under image properties. It is therefore impossible to select the
entire document CTRL + A and remove all links.

My problem arises when trying to automate this process. During macro
recording the item "remove float" is blanked out !

Am I doomed spending weeks on word, selecting 250 images manually ??
Or does anyone have a nice macro to share.

Thanks
Oyvind
  #2   Report Post  
Charles Kenyon
 
Posts: n/a
Default

Try the following on a _copy_ of your document. AFAIK it unlinks all fields
in a document, regardless of whether they are in the body of the document or
elsewhere. Please report back on your results.

Sub FieldsUnlinkAllStory()
' All Story Field Unlinker
' Written by Charles Kyle Kenyon
' repaired with help from Jezebel 10 December 2004
Dim oStory As Range
On Error Resume Next
For Each oStory In ActiveDocument.StoryRanges
Do
oStory.Fields.Unlink
Set oStory = oStory.Next
Loop Until oStory Is Nothing
Next
End Sub
--

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"?yvind Blom" wrote in message
om...
I have a word document with 150 pages and 250 images. All the images
are linked from a sub-directory to the document and not saved within
the file. I want to split this file into serveral smaller documents
that are
to be published in Sharepoint 2003 with each image saved within the
file, nor extracted or outside.

The images are graphics formatted with text wrap (float over text)?
The only way to edit or remove the links is to (remove the "float")
under image properties. It is therefore impossible to select the
entire document CTRL + A and remove all links.

My problem arises when trying to automate this process. During macro
recording the item "remove float" is blanked out !

Am I doomed spending weeks on word, selecting 250 images manually ??
Or does anyone have a nice macro to share.

Thanks
Oyvind



  #3   Report Post  
Jezebel
 
Posts: n/a
Default

Not sure what you're getting at with the 'float' issue. As I understand it,
currently your document has some 250 { LINK .... } fields, each connected
to a graphic. You need to replace these fields with the same graphic
embedded. The fact that the graphic is floating is largely irrelevant (it
just means you're working with the Shapes collection rather than
InlineShapes).

This is doable by macro, but it's tricky to say the least. Roughly: iterate
the Shapes collection. For each one, store the size and position properties;
find the corresponding LINK field to get the filename; delete the field and
insert the graphic from file (ie, add it to the Shapes collection) and set
the size and position properties.

On balance, I think you're probably better doing it manually. It'll take a
day or so, but writing a macro that does this effectively will likely take
most of a day and you would still need to edit the document to fix the ones
that go wrong. At least by doing it manually you know the task is finite
(even if infinitely tedious). Find a teenager who needs to earn some pocket
money.





"?yvind Blom" wrote in message
om...
I have a word document with 150 pages and 250 images. All the images
are linked from a sub-directory to the document and not saved within
the file. I want to split this file into serveral smaller documents
that are
to be published in Sharepoint 2003 with each image saved within the
file, nor extracted or outside.

The images are graphics formatted with text wrap (float over text)?
The only way to edit or remove the links is to (remove the "float")
under image properties. It is therefore impossible to select the
entire document CTRL + A and remove all links.

My problem arises when trying to automate this process. During macro
recording the item "remove float" is blanked out !

Am I doomed spending weeks on word, selecting 250 images manually ??
Or does anyone have a nice macro to share.

Thanks
Oyvind



  #4   Report Post  
Suzanne S. Barnhill
 
Posts: n/a
Default

I assume they're actually INCLUDEPICTURE fields. The field codes for these
fields cannot be displayed (and are therefore inaccessible to Find and
Replace) when graphics are wrapped.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Jezebel" wrote in message
...
Not sure what you're getting at with the 'float' issue. As I understand

it,
currently your document has some 250 { LINK .... } fields, each connected
to a graphic. You need to replace these fields with the same graphic
embedded. The fact that the graphic is floating is largely irrelevant (it
just means you're working with the Shapes collection rather than
InlineShapes).

This is doable by macro, but it's tricky to say the least. Roughly:

iterate
the Shapes collection. For each one, store the size and position

properties;
find the corresponding LINK field to get the filename; delete the field

and
insert the graphic from file (ie, add it to the Shapes collection) and set
the size and position properties.

On balance, I think you're probably better doing it manually. It'll take a
day or so, but writing a macro that does this effectively will likely take
most of a day and you would still need to edit the document to fix the

ones
that go wrong. At least by doing it manually you know the task is finite
(even if infinitely tedious). Find a teenager who needs to earn some

pocket
money.





"?yvind Blom" wrote in message
om...
I have a word document with 150 pages and 250 images. All the images
are linked from a sub-directory to the document and not saved within
the file. I want to split this file into serveral smaller documents
that are
to be published in Sharepoint 2003 with each image saved within the
file, nor extracted or outside.

The images are graphics formatted with text wrap (float over text)?
The only way to edit or remove the links is to (remove the "float")
under image properties. It is therefore impossible to select the
entire document CTRL + A and remove all links.

My problem arises when trying to automate this process. During macro
recording the item "remove float" is blanked out !

Am I doomed spending weeks on word, selecting 250 images manually ??
Or does anyone have a nice macro to share.

Thanks
Oyvind




  #5   Report Post  
Suzanne S. Barnhill
 
Posts: n/a
Default

If you don't have any other fields in the document, you can Ctrl+A,
Ctrl+Shift+F9. This command will unlink all fields, however.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"?yvind Blom" wrote in message
om...
I have a word document with 150 pages and 250 images. All the images
are linked from a sub-directory to the document and not saved within
the file. I want to split this file into serveral smaller documents
that are
to be published in Sharepoint 2003 with each image saved within the
file, nor extracted or outside.

The images are graphics formatted with text wrap (float over text)?
The only way to edit or remove the links is to (remove the "float")
under image properties. It is therefore impossible to select the
entire document CTRL + A and remove all links.

My problem arises when trying to automate this process. During macro
recording the item "remove float" is blanked out !

Am I doomed spending weeks on word, selecting 250 images manually ??
Or does anyone have a nice macro to share.

Thanks
Oyvind


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
In typing dates in Word, i.e. "January 12" how do you keep the "1. Carol Microsoft Word Help 2 January 12th 05 09:09 PM
word xp crashes after macros are recorded kharris0405 Microsoft Word Help 3 January 11th 05 11:50 PM
WP Delay Code - Word Equiv Mike G - Milw, WI Microsoft Word Help 6 January 10th 05 05:12 PM
How to change merge forms from Word Perfect to Microsoft Word dollfindance Microsoft Word Help 2 December 30th 04 04:35 PM
Splitting large word 97 file with linked images ?yvind Blom Microsoft Word Help 1 December 8th 04 07:39 PM


All times are GMT +1. The time now is 12:24 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"