Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-16-2015, 02:45 AM
mohsen.amiri mohsen.amiri is offline Assigning Different Styles for Texts and Pics Windows XP Assigning Different Styles for Texts and Pics Office 2007
Competent Performer
Assigning Different Styles for Texts and Pics
 
Join Date: Aug 2014
Posts: 221
mohsen.amiri is an unknown quantity at this point
Default Assigning Different Styles for Texts and Pics

Hello
There is a document which has both texts and pictures (pictures are defined as 'tight' in 'Text Wrapping').
I want to assign a Style to texts and assign another Style to pictures separately. I have no problem with assigning Style (e.g. Style.1) to texts, but when I try to assign another Style (e.g. Style.2) to pictures, it assigns that Style (Style.2) to the TEXT which is around that picture (I want to JUST picture be assigned with Style.2).
How can I solve this problem and I assign two different Styles to texts and pictures separately? Meanwhile Do not forget that the pictures are 'tight' not 'In Line With Text'.
Mohsen
Reply With Quote
  #2  
Old 02-16-2015, 06:15 AM
Guessed's Avatar
Guessed Guessed is offline Assigning Different Styles for Texts and Pics Windows 7 32bit Assigning Different Styles for Texts and Pics Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Floating pictures (those with text wrapping) are anchored to paragraphs which may or may not actually correspond with the position of the graphic.

If you want to apply a style to the graphic then you need to change the positioning of the graphic to "in line with text" and put them in their own paragraph.

You could create an empty paragraph and move the graphic's anchor to that paragraph. This would allow you to apply a style to that paragraph but I don't see the point.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 02-16-2015, 10:38 PM
mohsen.amiri mohsen.amiri is offline Assigning Different Styles for Texts and Pics Windows XP Assigning Different Styles for Texts and Pics Office 2007
Competent Performer
Assigning Different Styles for Texts and Pics
 
Join Date: Aug 2014
Posts: 221
mohsen.amiri is an unknown quantity at this point
Default

Guessed
Thank you but if I make a blank paragraph and drag my picture on it and change it's format to 'In-Line with text', then the texts around the picture move up and down the picture and the picture remains alone. I want to have texts around the picture, but with another Style.
Let me explain why I want to separate Styles of texts and pictures. Maybe you can solve the problem in another way:
The texts have so many 'Cross-Referece's. Whenever I 'Update Fields' to update the page numbers which has changed, pictures are updated TOO. When a picture is updated, it returns and resets to original size. I do not want pictures to return to original sizes, then it is necessary to select JUST texts and update them. I assign an especial Style to texts, the I can select them easily to update them justly.
Do you know a way to select JUST texts in a document to 'Update Fields'?
Mohsen
Reply With Quote
  #4  
Old 02-16-2015, 10:44 PM
Guessed's Avatar
Guessed Guessed is offline Assigning Different Styles for Texts and Pics Windows 7 32bit Assigning Different Styles for Texts and Pics Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Well you could lock the graphic fields so they won't update (until you unlock them again). To lock a field you select it and then press either Ctrl-3 or Ctrl-F11.

Alternatively, you could create and run a macro to update just the page number fields.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 02-17-2015, 12:24 AM
mohsen.amiri mohsen.amiri is offline Assigning Different Styles for Texts and Pics Windows XP Assigning Different Styles for Texts and Pics Office 2007
Competent Performer
Assigning Different Styles for Texts and Pics
 
Join Date: Aug 2014
Posts: 221
mohsen.amiri is an unknown quantity at this point
Default

Guessed
thanks.
For 'lock'ing pictures, I must select them first. How can select all pictures in a document?
Mohsen
Reply With Quote
  #6  
Old 02-18-2015, 09:40 PM
Guessed's Avatar
Guessed Guessed is offline Assigning Different Styles for Texts and Pics Windows 7 32bit Assigning Different Styles for Texts and Pics Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I think you are going to need a macro to carry out the task quickly.

If you post a sample document I can show you what code would do the job. But then again, if you are going to use a macro, you might as well just use a macro to selectively update the relevant fields.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #7  
Old 02-18-2015, 10:06 PM
mohsen.amiri mohsen.amiri is offline Assigning Different Styles for Texts and Pics Windows XP Assigning Different Styles for Texts and Pics Office 2007
Competent Performer
Assigning Different Styles for Texts and Pics
 
Join Date: Aug 2014
Posts: 221
mohsen.amiri is an unknown quantity at this point
Default

Hello
A part of the document is attached here. My Word is 2007. Would you help me in macro. By the way, after selecting the whole texts (with your macro), I have no problem in updating it.
Attached Files
File Type: docx Sample.docx (241.5 KB, 15 views)
Reply With Quote
  #8  
Old 02-18-2015, 10:59 PM
Guessed's Avatar
Guessed Guessed is offline Assigning Different Styles for Texts and Pics Windows 7 32bit Assigning Different Styles for Texts and Pics Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The graphics in that document are not 'fields' so a macro to update all the fields would be as follows.

I have included a debug line so you can review (in the VBA Immediate Window) all the fields that get updated by this macro.

Code:
Sub UpdateFields()
  Dim aFld As Field
  For Each aFld In ActiveDocument.Fields
    Debug.Print aFld.Type & ": " & aFld.Code
    aFld.Update
  Next aFld
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #9  
Old 02-18-2015, 11:03 PM
mohsen.amiri mohsen.amiri is offline Assigning Different Styles for Texts and Pics Windows XP Assigning Different Styles for Texts and Pics Office 2007
Competent Performer
Assigning Different Styles for Texts and Pics
 
Join Date: Aug 2014
Posts: 221
mohsen.amiri is an unknown quantity at this point
Default

Guessed
Thank you. I will use your macro.
But a serious question occurred. It maybe help me in solving my problem: What is 'Field' exactly?
An 'In-Line with text' photo is field? What about 'tight' photo or 'square' photo?
{Meanwhile I had to change the format of pictures (in the sample document) to 'In-Line with text' and 'tight'}
Reply With Quote
  #10  
Old 02-19-2015, 12:58 AM
mohsen.amiri mohsen.amiri is offline Assigning Different Styles for Texts and Pics Windows XP Assigning Different Styles for Texts and Pics Office 2007
Competent Performer
Assigning Different Styles for Texts and Pics
 
Join Date: Aug 2014
Posts: 221
mohsen.amiri is an unknown quantity at this point
Default

Guessed
Your macro Updates texts and 'In-Line with Text' pictures too. It works like 'Update Fields' exactly option.
I want to Update just texts (especially Cross-refrences)
Reply With Quote
  #11  
Old 02-19-2015, 10:07 PM
mohsen.amiri mohsen.amiri is offline Assigning Different Styles for Texts and Pics Windows XP Assigning Different Styles for Texts and Pics Office 2007
Competent Performer
Assigning Different Styles for Texts and Pics
 
Join Date: Aug 2014
Posts: 221
mohsen.amiri is an unknown quantity at this point
Default

Guessed
Is there any macro to select JUST CHARACTERS in a complicated document?
Thanks in advance.
Reply With Quote
  #12  
Old 02-19-2015, 10:27 PM
Guessed's Avatar
Guessed Guessed is offline Assigning Different Styles for Texts and Pics Windows 7 32bit Assigning Different Styles for Texts and Pics Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Macros using selections are not a great idea and I haven't ever felt the need to use discontinuous selections for anything.

How about you specify the type of field you want to update. The sample document you posted had a bunch of pageref fields so you can update just those like this. It is simple to expand this macro to include or exclude other types of fields if you know what you want to do.
Code:
Sub UpdateFields()
  Dim aFld As Field
  For Each aFld In ActiveDocument.Fields
    Debug.Print aFld.Type & ": " & aFld.Code
    If aFld.Type = wdFieldPageRef Then
      aFld.Update
    End If
  Next aFld
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #13  
Old 02-19-2015, 10:31 PM
mohsen.amiri mohsen.amiri is offline Assigning Different Styles for Texts and Pics Windows XP Assigning Different Styles for Texts and Pics Office 2007
Competent Performer
Assigning Different Styles for Texts and Pics
 
Join Date: Aug 2014
Posts: 221
mohsen.amiri is an unknown quantity at this point
Default

Guessed
Does this macro update all page references in sample document?
Reply With Quote
  #14  
Old 02-19-2015, 10:52 PM
Guessed's Avatar
Guessed Guessed is offline Assigning Different Styles for Texts and Pics Windows 7 32bit Assigning Different Styles for Texts and Pics Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

It is supposed to but in the sample document there are a bunch of broken refs since you only copied a sample of the text and some of the links are broken.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

Tags
picture, style, text

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assigning Different Styles for Texts and Pics Don't want to see contact pics spottedtapps Outlook 1 09-18-2014 07:03 PM
Assigning templates to existing documents. Update Styles Enmasse. bannerdog Word 1 02-28-2012 03:53 PM
How do I type on multiple pics? TimHudson Drawing and Graphics 0 07-28-2011 10:28 AM
Customize Animation of several Pics on 1 slide gburya PowerPoint 4 10-29-2010 01:18 PM
Assigning Different Styles for Texts and Pics Pics not showing up in Word kpinks Word 1 08-24-2007 12:03 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:00 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft