Link to home
Start Free TrialLog in
Avatar of kenabbott
kenabbottFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Problem with Word Macro

Hi

I am trying to create a macro in word that would setup page margins and fonts etc and make it look like the attached.  But when I run it the box appears to the left next to the text and not where I want it.

The vba is
Sub InsertGraph()
'
' InsertGraph Macro
 
    Dim shp As Word.Shape
    Application.Run MacroName:="BulletsAndHeadings"
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeParagraph
     Set shp = ActiveDocument.Shapes.AddShape(msoShapeRectangle, 150, 210, 242, 259)
    Selection.TypeText Text:="Source:"
    Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
    Selection.Font.Grow
    Selection.Font.Size = 7.5
End Sub

Open in new window

BulletsAndHeading is a separate macro and page layout is 2 column. Basically, I need a way to right align the shape.

Any ideas?

many thanks
 
Word.jpg
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial