R
RW
I am using Windows XP (sp2). Word 2002 (sp3)
I am trying to open a particular directory within VBA using With
Dialogs(wdDialogInsertPicture) command. For some reason, it does not want to
work correctly.
Everything is Dim'd correctly and the DirName string populates correctly.
Here's my code: Please Help.
DirName = PhotoDir & ChemName & "\"
ChangeFileOpenDirectory DirName
Selection.HomeKey Unit:=wdLine
Selection.TypeText Text:="" + vbTab
Selection.TypeText Text:="" + vbTab
VPRP = Selection.Information(wdVerticalPositionRelativeToPage)
HPRP = Selection.Information(wdHorizontalPositionRelativeToPage)
With Dialogs(wdDialogInsertPicture)
If .Display = 0 Then
Exit Sub
Else
PhotoFile = .Name
End If
End With
I am trying to open a particular directory within VBA using With
Dialogs(wdDialogInsertPicture) command. For some reason, it does not want to
work correctly.
Everything is Dim'd correctly and the DirName string populates correctly.
Here's my code: Please Help.
DirName = PhotoDir & ChemName & "\"
ChangeFileOpenDirectory DirName
Selection.HomeKey Unit:=wdLine
Selection.TypeText Text:="" + vbTab
Selection.TypeText Text:="" + vbTab
VPRP = Selection.Information(wdVerticalPositionRelativeToPage)
HPRP = Selection.Information(wdHorizontalPositionRelativeToPage)
With Dialogs(wdDialogInsertPicture)
If .Display = 0 Then
Exit Sub
Else
PhotoFile = .Name
End If
End With