Show/Hide images macro for Word เธรดต่อผู้เขียนข้อความ: Jo Macdonald
| Jo Macdonald สเปน Local time: 06:53 สมาชิก (2005) ภาษาอิตาลี เป็น ภาษาอังกฤษ + ...
I was wondering if anyone knows of a Word 2000 macro that will show/hide images.
Thanks
Jo | | | PAS Local time: 06:53 ภาษาโปแลนด์ เป็น ภาษาอังกฤษ + ... No macro necessary? | Dec 21, 2005 |
Word menu: Tools > Options > View Tab
Look for the [edit: picture placeholders] checkbox - I have Polish Word 2003 now, but I know this feature has been available in older versions.
I hope this is what you are looking for.
Merry Christmas
Pawel Skalinski
[Edited at 2005-12-21 18:11] | | | gianfranco บราซิล Local time: 01:53 สมาชิก (2001) ภาษาอังกฤษ เป็น ภาษาอิตาลี + ... Macro in VBA to show/hide images in Word | Dec 21, 2005 |
The simplest instruction to show images is the following
ActiveWindow.ShowPicturePlaceHolders = False
and to hide is:
ActiveWindow.ShowPicturePlaceHolders = True
A more complex macro to hide/show, that also will start only if a document is open, is the following:
If Application.Documents.Count > 0 Then
With ActiveWindow
With .View
Status = .ShowPicturePlaceHolders
Select Case Status
Case True
.ShowPicturePlaceHolders = False
This_Button.State = msoButtonDown
Case False
.ShowPicturePlaceHolders = True
This_Button.State = msoButtonUp
End Select
End With
End With
Else
MsgBox "No documents open"
End If
Just copy it into a macro and assign the macro to a button in your custom toolbar.
Pressing the button will show/hide the images.
bye
Gianfranco
[Edited at 2005-12-22 12:47] | | | Jo Macdonald สเปน Local time: 06:53 สมาชิก (2005) ภาษาอิตาลี เป็น ภาษาอังกฤษ + ... TOPIC STARTER
Hi Pas,
Yep, but I want to be able to do that at the click of a button.
Hi Gianfranco,
That’s exactly what I need, thanks.
I can get the macro to work but with a runtime error, like this:
Runtime error 424 ‘No object’
And then if I debug in visual basic, this line is highlighted yellow.
This_Button.State = msoButtonUp
The two ways I’ve got it to work are:
... See more Hi Pas,
Yep, but I want to be able to do that at the click of a button.
Hi Gianfranco,
That’s exactly what I need, thanks.
I can get the macro to work but with a runtime error, like this:
Runtime error 424 ‘No object’
And then if I debug in visual basic, this line is highlighted yellow.
This_Button.State = msoButtonUp
The two ways I’ve got it to work are:
Sub Images()
With ActiveWindow
With .View
Status = .ShowPicturePlaceHolders
Select Case Status
Case True
.ShowPicturePlaceHolders = False
This_Button.State = msoButtonDown
Case False
.ShowPicturePlaceHolders = True
This_Button.State = msoButtonUp
End Select
End With
End With
End Sub
or
Sub Images()
If Application.Documents.Count > 0 Then
With ActiveWindow
With .View
Status = .ShowPicturePlaceHolders
Select Case Status
Case True
.ShowPicturePlaceHolders = False
This_Button.State = msoButtonDown
Case False
.ShowPicturePlaceHolders = True
This_Button.State = msoButtonUp
End Select
End With
End With
End If
End Sub
Both have the same runtime error though. ▲ Collapse | |
|
|
gianfranco บราซิล Local time: 01:53 สมาชิก (2001) ภาษาอังกฤษ เป็น ภาษาอิตาลี + ...
Hi Jo,
simply remove both lines starting with "This_Button.State = ..."
The main functionality will be maintained.
Those two lines were used to keep the button depressed/raised according to the status (hidden/shown) and the button will not change its appearance (up or down), but you can probably live without it...
I have no time right now to devise and suggest a better fix.
... See more Hi Jo,
simply remove both lines starting with "This_Button.State = ..."
The main functionality will be maintained.
Those two lines were used to keep the button depressed/raised according to the status (hidden/shown) and the button will not change its appearance (up or down), but you can probably live without it...
I have no time right now to devise and suggest a better fix.
bye
Gianfranco
[Edited at 2005-12-22 12:51] ▲ Collapse | | | Jo Macdonald สเปน Local time: 06:53 สมาชิก (2005) ภาษาอิตาลี เป็น ภาษาอังกฤษ + ... TOPIC STARTER
Thanks Gian, much appreciated.
I owe you a macro.

Jo | | | To report site rules violations or get help, contact a site moderator: You can also contact site staff by submitting a support request » Show/Hide images macro for Word Trados Business Manager Lite |
---|
Create customer quotes and invoices from within Trados Studio
Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.
More info » |
| Protemos translation business management system |
---|
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!
The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.
More info » |
|
| | | | X Sign in to your ProZ.com account... | | | | | |