#16
|
|||
|
|||
Thank you sir, I did put in right place but realised very late for the below syntax
Quote:
Code:
Dim oSec As Section Dim oHeaderFooter As HeaderFooter Dim oLogo As inlineshape Set oSec = ActiveDocument.Sections Set oHeaderFooter = oSec.Headers(wdHeaderFooterPrimary) With oHeaderFooter.Range .ParagraphFormat.Alignment = wdAlignParagraphRight Set oLogo = .InlineShapes.AddPicture(Filename:="C:\FORMS\1-Seal.jpg", LinkToFile:=False, SaveWithDocument:=True) End With With oLogo .Height = 75 .Width = 100 End With |
#17
|
||||
|
||||
You don't need:
Code:
Dim oSec As Section Dim oHeaderFooter As HeaderFooter Code:
Const wdAlignTabRight As Long = 2 Dim oLogo As Object '…. With .Sections.First.Footers(wdHeaderFooterPrimary).Range.Paragraphs(1).Range .Text = "Footer Note" & vbTab .Paragraphs(1).TabStops.Add wdApp.InchesToPoints(7.5), wdAlignTabRight Set oLogo = .InlineShapes.AddPicture("C:\FORMS\1-Seal.jpg", False, True, .Characters.Last) With oLogo .Height = 75 .Width = 100 End With End With
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#18
|
|||
|
|||
Was Succesfull At the end when i tried the following which i think after the whole document is made and then insert footnote with following code with your reply on the following
Forum Solved: Image in Footer behind text but somehow niehther the width changes height changes of the image nor the image goes behind the text also error "variable" not defined was seen when implemented with InchesToPoints(1) or CentimetersToPoints(4.5) Code:
'''''Set wdDoc = wdApp.Documents.Add Dim shp As Shape With wdDoc.Sections(1).Footers(wdHeaderFooterPrimary).Range .Paragraphs.Alignment = wdAlignParagraphRight Set shp = .inlineshapes.AddPicture(Filename:="C:\FORMS\1-Seal.jpg", LinkToFile:=False, SaveWithDocument:=True)''', Height:=45, Width:=55) With shp .WrapFormat.Type = wdWrapBehind .LockAspectRatio = msoTrue .Height = 20 .Width = 20 'InchesToPoints(1) '20 'CentimetersToPoints(4.5) End With .collapse Direction:=0 End With |
#19
|
||||
|
||||
Well, you're now not working with an inlineshape, but one you're converting to a floating shape. It's impossible to know how to code things when you keep changing the parameters.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#20
|
|||
|
|||
Extremely Sorry Sir,
I got error when you posted the following code at same point InchesToPoints(7.5) Variable not defined. Quote:
I am novice in basic learning phase with VBA word. |
#21
|
|||
|
|||
I am still confused between .inlineshapes and Floating shapes and messed up.
my image size is 6.32 cm H and 5.27 cm W. I would like to resize to 25% of left sizes provided and Image to be provided behind text. .Paragraphs(1).TabStops.Add InchesToPoints(7.5), wdAlignTabRight this poped up with error hiliting InchesToPoints(7.5) "Sub or Function Not defined Sir indeed your coding was practical to what i desired Quote:
|
#22
|
||||
|
||||
You've omitted the wdApp. reference.
In any event, everything I provided for inlineshape insertion is all irrelevant now, because of: Quote:
isn't really what you want at all. I'm done wasting time on this: use a template!
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#23
|
|||
|
|||
Sir, thank you so much Indeed your inputs and guidance were really helpful.
I achieved what i desired and the page representation has come really beautifully and correctly. With your strong suggestion will use template. My last question on this thread as coding has gone much more into it. How about proper reference or syntax in footernote with its respective paragraph number have few characters bold in them. I used the following No Error but nothing displayed in as bold was not triggered. I feel somewhere i've not given proper reference Code:
Dim rngCharcs As Object Set rngCharcs = wdDoc.Sections.First.footers(wdHeaderFooterPrimary).Range rngCharcs(rngCharcs.Paragraphs(1).Range.Characters(1).Start, rngCharcs.Paragraphs(1).Range.Characters(10).End).Font.Bold = True |
#24
|
||||
|
||||
Try this instead
Code:
Dim rngFoot As Range Set rngFoot = wdDoc.Sections(1).Footers(wdHeaderFooterPrimary).Range.Paragraphs(1).Range rngFoot.End = rngFoot.Start + 10 rngFoot.Font.Bold = True
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#25
|
|||
|
|||
Thanks Andrew Lockton(Guessed) for the reply
I get Error as Arguement Not Optional rngFoot.End = and then i used the following too rngFoot.End(xltoRight) Nothing worked Also tried below but nothing worked Code:
Dim rngFoot As Range Set rngFoot = wdDoc.Sections(1).footers(wdHeaderFooterPrimary).Range.Paragraphs(1).Range With rngFoot .Collapse Direction:=0 .End(xlToRight) = .Start + 10 .Font.Bold = True End With |
#26
|
||||
|
||||
Perhaps your first paragraph doesn't contain 10 characters.
Refer to Macropod's multi-stated request for you to use a template.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#27
|
||||
|
||||
Andrew, the OP can't use:
Dim rngFoot As Range because everything is being done with late binding. Even with early binding, one would have to tell the code which application Range belongs to. In any event, since my code had already defined: wdRng As Object the OP could reuse that, as he had already been shown in posts 5 & 11.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#28
|
|||
|
|||
Macropd and Guessed
Thank you so much for your valuable Time inputs and suggestions. I've resolved by not implementing anything in footernote . I just left as is the text without fromating in footernote. although. It works well Template would have been right Method. I agree Guys thank you so much as i've learnt so much from this thread Thanks SamD |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I create an index of every word in a document? | jbengal | Word | 5 | 11-23-2022 02:17 PM |
Can I create word wizards with Word 2016 to automate document creation? | OkiDoki | Word | 4 | 09-30-2016 11:41 AM |
Word 2010 - How to create a fillable document from a boilerplate document | sheaters | Word | 2 | 05-04-2016 01:57 PM |
How to create a special TOC in word document? | gn4619 | Word VBA | 5 | 04-29-2015 04:25 PM |
How to identify whether Word 2007 was used to create a document saved as Word 2003 | noviceatwork | Word | 0 | 03-08-2012 06:40 AM |