Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-15-2015, 03:40 AM
andi_bln andi_bln is offline Need Helg formating text field Windows 7 64bit Need Helg formating text field Office 2010 64bit
Novice
Need Helg formating text field
 
Join Date: Oct 2015
Location: Berlin
Posts: 8
andi_bln is on a distinguished road
Default Need Helg formating text field

Hello,
I'm totally clueless. I'm added a textfield in a way like this :

Set ShAuthor = DC.Shapes.AddTextbox(Orientation:=msoTextOrientati onHorizontal, Left:=50, Top:=50, Width:=100, Height:=100)

With ShAuthor
.Fill.ForeColor.RGB = RGB(209, 209, 209)
.Left = Psu.PageWidth / LOGO_SHIFT_TO_RIGHT_REL
.Top = -1 * (Psu.TopMargin - 15) + CentimetersToPoints(7)
.Width = CentimetersToPoints(10)
.Height = CentimetersToPoints(1)
.TextFrame.TextRange.Text = "Author : " & "TestAuthor"


.TextFrame.TextRange.Bold = True
.TextFrame.TextRange.Font.TextColor = RGB(0, 80, 113)

I works fine, the same code in an other document, the red marked line could not be executed, because <Dieser Befehl ist nicht verfügbar.>
or The command is not available. Same code, different results...
I don't know why ... can anybody help ???
THX Andreas

Reply With Quote
  #2  
Old 10-15-2015, 05:26 AM
macropod's Avatar
macropod macropod is offline Need Helg formating text field Windows 7 64bit Need Helg formating text field Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,340
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The code works fine for me (after adding the missing 'End With').
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-15-2015, 08:54 AM
andi_bln andi_bln is offline Need Helg formating text field Windows 7 64bit Need Helg formating text field Office 2010 64bit
Novice
Need Helg formating text field
 
Join Date: Oct 2015
Location: Berlin
Posts: 8
andi_bln is on a distinguished road
Default

Hello,
I've copied the important lines only, the problem is the Font - object.
For example .lines .fill are diabled, the tested Code was execute on a empty word file ( it worked ) and on a huge word file ( it didn't work ). I'm just want to colorize the font by RGB... no way. I think it has something to do with the pagesetup, but I don't no what (((
Any other idea ? Thanks a lot for reading the issue ...

Andreas
Reply With Quote
  #4  
Old 10-15-2015, 04:43 PM
macropod's Avatar
macropod macropod is offline Need Helg formating text field Windows 7 64bit Need Helg formating text field Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,340
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

As I've said, the code works for me. Perhaps your document has some form of corruption or there's a fault in your Office installation.

Corrupt documents can often be 'repaired' by inserting a new, empty, paragraph at the very end, copying everything except that new paragraph to a new document based on the same template (headers & footers may need to be copied separately), closing the old document and saving the new one over it.

A faulty Office installation can be repaired via Start > Windows Control Panel > Programs > Programs & Features > Microsoft Office (version) > Change>Repair.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 10-16-2015, 03:33 AM
andi_bln andi_bln is offline Need Helg formating text field Windows 7 64bit Need Helg formating text field Office 2010 64bit
Novice
Need Helg formating text field
 
Join Date: Oct 2015
Location: Berlin
Posts: 8
andi_bln is on a distinguished road
Default

Hello,
I think, I've got the Solution, but for the problem itself, still I'm clueless ..

Dim Rn as Range


.TextFrame.TextRange.Text = "Author : " & H_Author
Set Rn = .TextFrame.TextRange
Rn.Font.Color = 9786419

This works fine, but I don't know why ...

Thank you for reading my problem !!!

Greetings from Berlin
Andreas
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Helg formating text field Macro to find text and replace with form field containing that text iiiiifffff Word VBA 16 06-04-2016 01:47 AM
Macro to find coloured text and replace with form-field/formtext containing that text tarktran Word VBA 1 11-26-2014 08:12 AM
Chart Formating with ChartTitle Font and DataLabel Formating shilabrow Excel Programming 0 06-30-2014 10:01 AM
Need Helg formating text field please help, need formating a .doc with simple fillable text boxes and picture boxes olson109 Word 5 03-12-2014 01:02 AM
Unable to enter text in text field yewee Word 0 08-06-2010 03:20 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:38 AM.


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