[python-win32] Word hyperLink problem and PageSetup question

kimwaic888-pythonwin32@yahoo.com kimwaic888-pythonwin32 at yahoo.com
Thu Jun 23 01:29:21 CEST 2005


Hi all,

Appreciate it if anybody can help me with a couple of
items:

(1) When I use the InsertFile method to insert a .doc
file into my current DOC file, all of the hyperlinks
get messed up.  In the original document, the
hyperlink is stored as an fullpath.  After InsertFile,
all of the links lost the path portion of the name. 
This is obviously not the intended result.

Any idea on how to fix this?

(2)Exactly how should I translate the following into
Python? (I tried but the result is not right - I don't
think I am understanding the range code properly)

    Selection.MoveRight Unit:=wdCharacter, Count:=1
    ActiveDocument.Range(Start:=Selection.Start,
End:=Selection.Start). _
        InsertBreak Type:=wdSectionBreakNextPage
    Selection.Start = Selection.Start + 1
    With ActiveDocument.Range(Start:=Selection.Start,
End:=ActiveDocument. _
        Content.End).PageSetup
        .LineNumbering.Active = False
        .Orientation = wdOrientLandscape
        ...others...
        .GutterPos = wdGutterPosLeft
    End With

Thanks,

--
John


More information about the Python-win32 mailing list